diff --git a/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/client.go b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/client.go new file mode 100644 index 000000000000..1f47b03e82fa --- /dev/null +++ b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/client.go @@ -0,0 +1,53 @@ +// Package regionmove implements the Azure ARM Regionmove service API version 2019-10-01-preview. +// +// A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between +// zones within a region. +package regionmove + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Regionmove + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Regionmove. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// 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) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/enums.go b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/enums.go new file mode 100644 index 000000000000..2fffeb82ae4c --- /dev/null +++ b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/enums.go @@ -0,0 +1,220 @@ +package regionmove + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// DependencyType enumerates the values for dependency type. +type DependencyType string + +const ( + // RequiredForMove ... + RequiredForMove DependencyType = "RequiredForMove" + // RequiredForPrepare ... + RequiredForPrepare DependencyType = "RequiredForPrepare" +) + +// PossibleDependencyTypeValues returns an array of possible values for the DependencyType const type. +func PossibleDependencyTypeValues() []DependencyType { + return []DependencyType{RequiredForMove, RequiredForPrepare} +} + +// JobName enumerates the values for job name. +type JobName string + +const ( + // InitialSync ... + InitialSync JobName = "InitialSync" +) + +// PossibleJobNameValues returns an array of possible values for the JobName const type. +func PossibleJobNameValues() []JobName { + return []JobName{InitialSync} +} + +// MoveResourceInputType enumerates the values for move resource input type. +type MoveResourceInputType string + +const ( + // MoveResourceID ... + MoveResourceID MoveResourceInputType = "MoveResourceId" + // MoveResourceSourceID ... + MoveResourceSourceID MoveResourceInputType = "MoveResourceSourceId" +) + +// PossibleMoveResourceInputTypeValues returns an array of possible values for the MoveResourceInputType const type. +func PossibleMoveResourceInputTypeValues() []MoveResourceInputType { + return []MoveResourceInputType{MoveResourceID, MoveResourceSourceID} +} + +// MoveState enumerates the values for move state. +type MoveState string + +const ( + // AssignmentPending ... + AssignmentPending MoveState = "AssignmentPending" + // CommitFailed ... + CommitFailed MoveState = "CommitFailed" + // CommitInProgress ... + CommitInProgress MoveState = "CommitInProgress" + // CommitPending ... + CommitPending MoveState = "CommitPending" + // Committed ... + Committed MoveState = "Committed" + // DiscardFailed ... + DiscardFailed MoveState = "DiscardFailed" + // DiscardInProgress ... + DiscardInProgress MoveState = "DiscardInProgress" + // MoveFailed ... + MoveFailed MoveState = "MoveFailed" + // MoveInProgress ... + MoveInProgress MoveState = "MoveInProgress" + // MovePending ... + MovePending MoveState = "MovePending" + // PrepareFailed ... + PrepareFailed MoveState = "PrepareFailed" + // PrepareInProgress ... + PrepareInProgress MoveState = "PrepareInProgress" + // PreparePending ... + PreparePending MoveState = "PreparePending" +) + +// PossibleMoveStateValues returns an array of possible values for the MoveState const type. +func PossibleMoveStateValues() []MoveState { + return []MoveState{AssignmentPending, CommitFailed, CommitInProgress, CommitPending, Committed, DiscardFailed, DiscardInProgress, MoveFailed, MoveInProgress, MovePending, PrepareFailed, PrepareInProgress, PreparePending} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Creating ... + Creating ProvisioningState = "Creating" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Creating, Failed, Succeeded, Updating} +} + +// ResolutionType enumerates the values for resolution type. +type ResolutionType string + +const ( + // Automatic ... + Automatic ResolutionType = "Automatic" + // Manual ... + Manual ResolutionType = "Manual" +) + +// PossibleResolutionTypeValues returns an array of possible values for the ResolutionType const type. +func PossibleResolutionTypeValues() []ResolutionType { + return []ResolutionType{Automatic, Manual} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" + // UserAssigned ... + UserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned, UserAssigned} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // ResourceTypeMicrosoftComputeavailabilitySets ... + ResourceTypeMicrosoftComputeavailabilitySets ResourceType = "Microsoft.Compute/availabilitySets" + // ResourceTypeMicrosoftComputevirtualMachines ... + ResourceTypeMicrosoftComputevirtualMachines ResourceType = "Microsoft.Compute/virtualMachines" + // ResourceTypeMicrosoftNetworkloadBalancers ... + ResourceTypeMicrosoftNetworkloadBalancers ResourceType = "Microsoft.Network/loadBalancers" + // ResourceTypeMicrosoftNetworknetworkInterfaces ... + ResourceTypeMicrosoftNetworknetworkInterfaces ResourceType = "Microsoft.Network/networkInterfaces" + // ResourceTypeMicrosoftNetworknetworkSecurityGroups ... + ResourceTypeMicrosoftNetworknetworkSecurityGroups ResourceType = "Microsoft.Network/networkSecurityGroups" + // ResourceTypeMicrosoftNetworkpublicIPAddresses ... + ResourceTypeMicrosoftNetworkpublicIPAddresses ResourceType = "Microsoft.Network/publicIPAddresses" + // ResourceTypeMicrosoftNetworkvirtualNetworks ... + ResourceTypeMicrosoftNetworkvirtualNetworks ResourceType = "Microsoft.Network/virtualNetworks" + // ResourceTypeMicrosoftSqlservers ... + ResourceTypeMicrosoftSqlservers ResourceType = "Microsoft.Sql/servers" + // ResourceTypeMicrosoftSqlserversdatabases ... + ResourceTypeMicrosoftSqlserversdatabases ResourceType = "Microsoft.Sql/servers/databases" + // ResourceTypeMicrosoftSqlserverselasticPools ... + ResourceTypeMicrosoftSqlserverselasticPools ResourceType = "Microsoft.Sql/servers/elasticPools" + // ResourceTypeMoveResourcePropertiesSourceResourceSettings ... + ResourceTypeMoveResourcePropertiesSourceResourceSettings ResourceType = "MoveResourceProperties_sourceResourceSettings" + // ResourceTypeResourceGroups ... + ResourceTypeResourceGroups ResourceType = "resourceGroups" + // ResourceTypeResourceSettings ... + ResourceTypeResourceSettings ResourceType = "ResourceSettings" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{ResourceTypeMicrosoftComputeavailabilitySets, ResourceTypeMicrosoftComputevirtualMachines, ResourceTypeMicrosoftNetworkloadBalancers, ResourceTypeMicrosoftNetworknetworkInterfaces, ResourceTypeMicrosoftNetworknetworkSecurityGroups, ResourceTypeMicrosoftNetworkpublicIPAddresses, ResourceTypeMicrosoftNetworkvirtualNetworks, ResourceTypeMicrosoftSqlservers, ResourceTypeMicrosoftSqlserversdatabases, ResourceTypeMicrosoftSqlserverselasticPools, ResourceTypeMoveResourcePropertiesSourceResourceSettings, ResourceTypeResourceGroups, ResourceTypeResourceSettings} +} + +// TargetAvailabilityZone enumerates the values for target availability zone. +type TargetAvailabilityZone string + +const ( + // NA ... + NA TargetAvailabilityZone = "NA" + // One ... + One TargetAvailabilityZone = "1" + // Three ... + Three TargetAvailabilityZone = "3" + // Two ... + Two TargetAvailabilityZone = "2" +) + +// PossibleTargetAvailabilityZoneValues returns an array of possible values for the TargetAvailabilityZone const type. +func PossibleTargetAvailabilityZoneValues() []TargetAvailabilityZone { + return []TargetAvailabilityZone{NA, One, Three, Two} +} + +// ZoneRedundant enumerates the values for zone redundant. +type ZoneRedundant string + +const ( + // Disable ... + Disable ZoneRedundant = "Disable" + // Enable ... + Enable ZoneRedundant = "Enable" +) + +// PossibleZoneRedundantValues returns an array of possible values for the ZoneRedundant const type. +func PossibleZoneRedundantValues() []ZoneRedundant { + return []ZoneRedundant{Disable, Enable} +} diff --git a/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/models.go b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/models.go new file mode 100644 index 000000000000..f035ee7dd835 --- /dev/null +++ b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/models.go @@ -0,0 +1,2648 @@ +package regionmove + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/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/preview/regionmove/mgmt/2019-10-01-preview/regionmove" + +// AffectedMoveResource the RP custom operation error info. +type AffectedMoveResource struct { + // ID - READ-ONLY; The affected move resource id. + ID *string `json:"id,omitempty"` + // SourceID - READ-ONLY; The affected move resource source id. + SourceID *string `json:"sourceId,omitempty"` + // MoveResources - READ-ONLY; The affected move resources. + MoveResources *[]AffectedMoveResource `json:"moveResources,omitempty"` +} + +// AutomaticResolutionProperties defines the properties for automatic resolution. +type AutomaticResolutionProperties struct { + // MoveResourceID - Gets the MoveResource ARM ID of + // the dependent resource if the resolution type is Automatic. + MoveResourceID *string `json:"moveResourceId,omitempty"` +} + +// AvailabilitySetResourceSettings gets or sets the availability set resource settings. +type AvailabilitySetResourceSettings struct { + // FaultDomain - Gets or sets the target fault domain. + FaultDomain *int32 `json:"faultDomain,omitempty"` + // UpdateDomain - Gets or sets the target update domain. + UpdateDomain *int32 `json:"updateDomain,omitempty"` + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) MarshalJSON() ([]byte, error) { + asrs.ResourceType = ResourceTypeMicrosoftComputeavailabilitySets + objectMap := make(map[string]interface{}) + if asrs.FaultDomain != nil { + objectMap["faultDomain"] = asrs.FaultDomain + } + if asrs.UpdateDomain != nil { + objectMap["updateDomain"] = asrs.UpdateDomain + } + if asrs.TargetResourceName != nil { + objectMap["targetResourceName"] = asrs.TargetResourceName + } + if asrs.ResourceType != "" { + objectMap["resourceType"] = asrs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return &asrs, true +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. +func (asrs AvailabilitySetResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &asrs, true +} + +// AzureResourceReference defines reference to an Azure resource. +type AzureResourceReference struct { + // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. + SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` +} + +// CloudError an error response from the service. +type CloudError struct { + // Error - Cloud error body. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// CommitRequest defines the request body for commit operation. +type CommitRequest struct { + // ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite. + ValidateOnly *bool `json:"validateOnly,omitempty"` + // MoveResources - Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. + MoveResources *[]string `json:"moveResources,omitempty"` + // MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID' + MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"` +} + +// DiscardRequest defines the request body for discard operation. +type DiscardRequest struct { + // ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite. + ValidateOnly *bool `json:"validateOnly,omitempty"` + // MoveResources - Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. + MoveResources *[]string `json:"moveResources,omitempty"` + // MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID' + MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,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 - Gets or sets 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 - Gets or sets 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 - Gets or sets 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 - Gets or sets 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 namespace: + // 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 namespace: + // Read any 'display.resource' Create or Update any 'display.resource' Delete any + // 'display.resource' 'ActionName' any 'display.resources'. + Description *string `json:"description,omitempty"` +} + +// Identity defines the MSI properties of the Move Collection. +type Identity struct { + // Type - Possible values include: 'None', 'SystemAssigned', 'UserAssigned' + Type ResourceIdentityType `json:"type,omitempty"` + // PrincipalID - Gets or sets the principal id. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - Gets or sets the tenant id. + TenantID *string `json:"tenantId,omitempty"` +} + +// JobStatus defines the job status. +type JobStatus struct { + // JobName - Possible values include: 'InitialSync' + JobName JobName `json:"jobName,omitempty"` + // JobProgress - Gets or sets the monitoring job percentage. + JobProgress *string `json:"jobProgress,omitempty"` +} + +// LBBackendAddressPoolResourceSettings defines load balancer backend address pool properties. +type LBBackendAddressPoolResourceSettings struct { + // Name - Gets or sets the backend address pool name. + Name *string `json:"name,omitempty"` +} + +// LBFrontendIPConfigurationResourceSettings defines load balancer frontend IP configuration properties. +type LBFrontendIPConfigurationResourceSettings struct { + // Name - Gets or sets the frontend IP configuration name. + Name *string `json:"name,omitempty"` + // PrivateIPAddress - Gets or sets the IP address of the Load Balancer.This is only specified if a specific + // private IP address shall be allocated from the subnet specified in subnetRef. + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + // PrivateIPAllocationMethod - Gets or sets PrivateIP allocation method (Static/Dynamic). + PrivateIPAllocationMethod *string `json:"privateIpAllocationMethod,omitempty"` + Subnet *SubnetReference `json:"subnet,omitempty"` + // Zones - Gets or sets the csv list of zones. + Zones *string `json:"zones,omitempty"` +} + +// LoadBalancerBackendAddressPoolReference defines reference to load balancer backend address pools. +type LoadBalancerBackendAddressPoolReference struct { + // Name - Gets the name of the proxy resource on the target side. + Name *string `json:"name,omitempty"` + // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. + SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` +} + +// LoadBalancerNatRuleReference defines reference to load balancer NAT rules. +type LoadBalancerNatRuleReference struct { + // Name - Gets the name of the proxy resource on the target side. + Name *string `json:"name,omitempty"` + // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. + SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` +} + +// LoadBalancerResourceSettings defines the load balancer resource settings. +type LoadBalancerResourceSettings struct { + // Sku - Gets or sets load balancer sku (Basic/Standard). + Sku *string `json:"sku,omitempty"` + // FrontendIPConfigurations - Gets or sets the frontend IP configurations of the load balancer. + FrontendIPConfigurations *[]LBFrontendIPConfigurationResourceSettings `json:"frontendIPConfigurations,omitempty"` + // BackendAddressPools - Gets or sets the backend address pools of the load balancer. + BackendAddressPools *[]LBBackendAddressPoolResourceSettings `json:"backendAddressPools,omitempty"` + // Zones - Gets or sets the csv list of zones common for all frontend IP configurations. Note this is given + // precedence only if frontend IP configurations settings are not present. + Zones *string `json:"zones,omitempty"` + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) MarshalJSON() ([]byte, error) { + lbrs.ResourceType = ResourceTypeMicrosoftNetworkloadBalancers + objectMap := make(map[string]interface{}) + if lbrs.Sku != nil { + objectMap["sku"] = lbrs.Sku + } + if lbrs.FrontendIPConfigurations != nil { + objectMap["frontendIPConfigurations"] = lbrs.FrontendIPConfigurations + } + if lbrs.BackendAddressPools != nil { + objectMap["backendAddressPools"] = lbrs.BackendAddressPools + } + if lbrs.Zones != nil { + objectMap["zones"] = lbrs.Zones + } + if lbrs.TargetResourceName != nil { + objectMap["targetResourceName"] = lbrs.TargetResourceName + } + if lbrs.ResourceType != "" { + objectMap["resourceType"] = lbrs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return &lbrs, true +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. +func (lbrs LoadBalancerResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &lbrs, true +} + +// ManualResolutionProperties defines the properties for manual resolution. +type ManualResolutionProperties struct { + // TargetID - Gets or sets the target resource ARM ID of the dependent resource if the resource type is Manual. + TargetID *string `json:"targetId,omitempty"` +} + +// MoveCollection define the move collection. +type MoveCollection struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives. + Location *string `json:"location,omitempty"` + Identity *Identity `json:"identity,omitempty"` + Properties *MoveCollectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for MoveCollection. +func (mc MoveCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mc.Tags != nil { + objectMap["tags"] = mc.Tags + } + if mc.Location != nil { + objectMap["location"] = mc.Location + } + if mc.Identity != nil { + objectMap["identity"] = mc.Identity + } + if mc.Properties != nil { + objectMap["properties"] = mc.Properties + } + return json.Marshal(objectMap) +} + +// MoveCollectionProperties defines the move collection properties. +type MoveCollectionProperties struct { + // SourceRegion - Gets or sets the source region. + SourceRegion *string `json:"sourceRegion,omitempty"` + // TargetRegion - Gets or sets the target region. + TargetRegion *string `json:"targetRegion,omitempty"` + // ProvisioningState - Possible values include: 'Succeeded', 'Updating', 'Creating', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MoveCollectionResultList defines the collection of move collections. +type MoveCollectionResultList struct { + autorest.Response `json:"-"` + // Value - Gets the list of move collections. + Value *[]MoveCollection `json:"value,omitempty"` + // NextLink - Gets the value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MoveCollectionResultListIterator provides access to a complete listing of MoveCollection values. +type MoveCollectionResultListIterator struct { + i int + page MoveCollectionResultListPage +} + +// 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 *MoveCollectionResultListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionResultListIterator.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 *MoveCollectionResultListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MoveCollectionResultListIterator) 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 MoveCollectionResultListIterator) Response() MoveCollectionResultList { + 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 MoveCollectionResultListIterator) Value() MoveCollection { + if !iter.page.NotDone() { + return MoveCollection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MoveCollectionResultListIterator type. +func NewMoveCollectionResultListIterator(page MoveCollectionResultListPage) MoveCollectionResultListIterator { + return MoveCollectionResultListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mcrl MoveCollectionResultList) IsEmpty() bool { + return mcrl.Value == nil || len(*mcrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mcrl MoveCollectionResultList) hasNextLink() bool { + return mcrl.NextLink != nil && len(*mcrl.NextLink) != 0 +} + +// moveCollectionResultListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mcrl MoveCollectionResultList) moveCollectionResultListPreparer(ctx context.Context) (*http.Request, error) { + if !mcrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mcrl.NextLink))) +} + +// MoveCollectionResultListPage contains a page of MoveCollection values. +type MoveCollectionResultListPage struct { + fn func(context.Context, MoveCollectionResultList) (MoveCollectionResultList, error) + mcrl MoveCollectionResultList +} + +// 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 *MoveCollectionResultListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionResultListPage.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.mcrl) + if err != nil { + return err + } + page.mcrl = 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 *MoveCollectionResultListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MoveCollectionResultListPage) NotDone() bool { + return !page.mcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MoveCollectionResultListPage) Response() MoveCollectionResultList { + return page.mcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MoveCollectionResultListPage) Values() []MoveCollection { + if page.mcrl.IsEmpty() { + return nil + } + return *page.mcrl.Value +} + +// Creates a new instance of the MoveCollectionResultListPage type. +func NewMoveCollectionResultListPage(getNextPage func(context.Context, MoveCollectionResultList) (MoveCollectionResultList, error)) MoveCollectionResultListPage { + return MoveCollectionResultListPage{fn: getNextPage} +} + +// MoveCollectionsCommitFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type MoveCollectionsCommitFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MoveCollectionsCommitFuture) Result(client MoveCollectionsClient) (osVar OperationStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsCommitFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("regionmove.MoveCollectionsCommitFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { + osVar, err = client.CommitResponder(osVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsCommitFuture", "Result", osVar.Response.Response, "Failure responding to request") + } + } + return +} + +// MoveCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type MoveCollectionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MoveCollectionsDeleteFuture) Result(client MoveCollectionsClient) (osVar OperationStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("regionmove.MoveCollectionsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { + osVar, err = client.DeleteResponder(osVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsDeleteFuture", "Result", osVar.Response.Response, "Failure responding to request") + } + } + return +} + +// MoveCollectionsDiscardFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type MoveCollectionsDiscardFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MoveCollectionsDiscardFuture) Result(client MoveCollectionsClient) (osVar OperationStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsDiscardFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("regionmove.MoveCollectionsDiscardFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { + osVar, err = client.DiscardResponder(osVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsDiscardFuture", "Result", osVar.Response.Response, "Failure responding to request") + } + } + return +} + +// MoveCollectionsInitiateMoveFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type MoveCollectionsInitiateMoveFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MoveCollectionsInitiateMoveFuture) Result(client MoveCollectionsClient) (osVar OperationStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsInitiateMoveFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("regionmove.MoveCollectionsInitiateMoveFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { + osVar, err = client.InitiateMoveResponder(osVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsInitiateMoveFuture", "Result", osVar.Response.Response, "Failure responding to request") + } + } + return +} + +// MoveCollectionsPrepareFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type MoveCollectionsPrepareFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MoveCollectionsPrepareFuture) Result(client MoveCollectionsClient) (osVar OperationStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsPrepareFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("regionmove.MoveCollectionsPrepareFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { + osVar, err = client.PrepareResponder(osVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsPrepareFuture", "Result", osVar.Response.Response, "Failure responding to request") + } + } + return +} + +// MoveCollectionsResolveDependenciesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type MoveCollectionsResolveDependenciesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MoveCollectionsResolveDependenciesFuture) Result(client MoveCollectionsClient) (osVar OperationStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsResolveDependenciesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("regionmove.MoveCollectionsResolveDependenciesFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { + osVar, err = client.ResolveDependenciesResponder(osVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsResolveDependenciesFuture", "Result", osVar.Response.Response, "Failure responding to request") + } + } + return +} + +// MoveErrorInfo the move custom error info. +type MoveErrorInfo struct { + // MoveResources - READ-ONLY; The affected move resources. + MoveResources *[]AffectedMoveResource `json:"moveResources,omitempty"` +} + +// MoveResource defines the move resource. +type MoveResource struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + Properties *MoveResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for MoveResource. +func (mr MoveResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mr.Properties != nil { + objectMap["properties"] = mr.Properties + } + return json.Marshal(objectMap) +} + +// MoveResourceCollection defines the collection of move resources. +type MoveResourceCollection struct { + autorest.Response `json:"-"` + // Value - Gets the list of move resources. + Value *[]MoveResource `json:"value,omitempty"` + // NextLink - Gets the value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MoveResourceCollectionIterator provides access to a complete listing of MoveResource values. +type MoveResourceCollectionIterator struct { + i int + page MoveResourceCollectionPage +} + +// 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 *MoveResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourceCollectionIterator.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 *MoveResourceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MoveResourceCollectionIterator) 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 MoveResourceCollectionIterator) Response() MoveResourceCollection { + 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 MoveResourceCollectionIterator) Value() MoveResource { + if !iter.page.NotDone() { + return MoveResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MoveResourceCollectionIterator type. +func NewMoveResourceCollectionIterator(page MoveResourceCollectionPage) MoveResourceCollectionIterator { + return MoveResourceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrc MoveResourceCollection) IsEmpty() bool { + return mrc.Value == nil || len(*mrc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mrc MoveResourceCollection) hasNextLink() bool { + return mrc.NextLink != nil && len(*mrc.NextLink) != 0 +} + +// moveResourceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrc MoveResourceCollection) moveResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !mrc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrc.NextLink))) +} + +// MoveResourceCollectionPage contains a page of MoveResource values. +type MoveResourceCollectionPage struct { + fn func(context.Context, MoveResourceCollection) (MoveResourceCollection, error) + mrc MoveResourceCollection +} + +// 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 *MoveResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourceCollectionPage.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.mrc) + if err != nil { + return err + } + page.mrc = 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 *MoveResourceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MoveResourceCollectionPage) NotDone() bool { + return !page.mrc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MoveResourceCollectionPage) Response() MoveResourceCollection { + return page.mrc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MoveResourceCollectionPage) Values() []MoveResource { + if page.mrc.IsEmpty() { + return nil + } + return *page.mrc.Value +} + +// Creates a new instance of the MoveResourceCollectionPage type. +func NewMoveResourceCollectionPage(getNextPage func(context.Context, MoveResourceCollection) (MoveResourceCollection, error)) MoveResourceCollectionPage { + return MoveResourceCollectionPage{fn: getNextPage} +} + +// MoveResourceDependency defines the dependency of the move resource. +type MoveResourceDependency struct { + // ID - Gets the source ARM ID of the dependent resource. + ID *string `json:"id,omitempty"` + // ResolutionStatus - Gets the dependency resolution status. + ResolutionStatus *string `json:"resolutionStatus,omitempty"` + // ResolutionType - Possible values include: 'Manual', 'Automatic' + ResolutionType ResolutionType `json:"resolutionType,omitempty"` + // DependencyType - Possible values include: 'RequiredForPrepare', 'RequiredForMove' + DependencyType DependencyType `json:"dependencyType,omitempty"` + ManualResolution *ManualResolutionProperties `json:"manualResolution,omitempty"` + AutomaticResolution *AutomaticResolutionProperties `json:"automaticResolution,omitempty"` + // IsOptional - Gets or sets a value indicating whether the dependency is optional. + IsOptional *string `json:"isOptional,omitempty"` +} + +// MoveResourceDependencyOverride defines the dependency override of the move resource. +type MoveResourceDependencyOverride struct { + // ID - Gets or sets the ARM ID of the dependent resource. + ID *string `json:"id,omitempty"` + // TargetID - Gets or sets the resource ARM id of either the MoveResource or the resource ARM ID of + // the dependent resource. + TargetID *string `json:"targetId,omitempty"` +} + +// MoveResourceError an error response from the azure region move service. +type MoveResourceError struct { + // Properties - The move resource error body. + Properties *MoveResourceErrorBody `json:"properties,omitempty"` +} + +// MoveResourceErrorBody an error response from the Azure Migrate service. +type MoveResourceErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]MoveResourceErrorBody `json:"details,omitempty"` +} + +// MoveResourceFilter move resource filter. +type MoveResourceFilter struct { + Properties *MoveResourceFilterProperties `json:"properties,omitempty"` +} + +// MoveResourceFilterProperties ... +type MoveResourceFilterProperties struct { + // ProvisioningState - The provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// MoveResourceProperties defines the move resource properties. +type MoveResourceProperties struct { + // ProvisioningState - Possible values include: 'Succeeded', 'Updating', 'Creating', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SourceID - Gets or sets the Source ARM Id of the resource. + SourceID *string `json:"sourceId,omitempty"` + // TargetID - READ-ONLY; Gets or sets the Target ARM Id of the resource. + TargetID *string `json:"targetId,omitempty"` + // ExistingTargetID - Gets or sets the existing target ARM Id of the resource. + ExistingTargetID *string `json:"existingTargetId,omitempty"` + // ResourceSettings - Gets or sets the resource settings. + ResourceSettings BasicResourceSettings `json:"resourceSettings,omitempty"` + // SourceResourceSettings - READ-ONLY; Gets or sets the source resource settings. + SourceResourceSettings *MoveResourcePropertiesSourceResourceSettings `json:"sourceResourceSettings,omitempty"` + // MoveStatus - READ-ONLY; Defines the move resource status. + MoveStatus *MoveResourcePropertiesMoveStatus `json:"moveStatus,omitempty"` + // DependsOn - READ-ONLY; Gets or sets the move resource dependencies. + DependsOn *[]MoveResourceDependency `json:"dependsOn,omitempty"` + // DependsOnOverrides - Gets or sets the move resource dependencies overrides. + DependsOnOverrides *[]MoveResourceDependencyOverride `json:"dependsOnOverrides,omitempty"` + // Errors - READ-ONLY; Defines the move resource errors. + Errors *MoveResourcePropertiesErrors `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for MoveResourceProperties. +func (mrp MoveResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrp.ProvisioningState != "" { + objectMap["provisioningState"] = mrp.ProvisioningState + } + if mrp.SourceID != nil { + objectMap["sourceId"] = mrp.SourceID + } + if mrp.ExistingTargetID != nil { + objectMap["existingTargetId"] = mrp.ExistingTargetID + } + objectMap["resourceSettings"] = mrp.ResourceSettings + if mrp.DependsOnOverrides != nil { + objectMap["dependsOnOverrides"] = mrp.DependsOnOverrides + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MoveResourceProperties struct. +func (mrp *MoveResourceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + mrp.ProvisioningState = provisioningState + } + case "sourceId": + if v != nil { + var sourceID string + err = json.Unmarshal(*v, &sourceID) + if err != nil { + return err + } + mrp.SourceID = &sourceID + } + case "targetId": + if v != nil { + var targetID string + err = json.Unmarshal(*v, &targetID) + if err != nil { + return err + } + mrp.TargetID = &targetID + } + case "existingTargetId": + if v != nil { + var existingTargetID string + err = json.Unmarshal(*v, &existingTargetID) + if err != nil { + return err + } + mrp.ExistingTargetID = &existingTargetID + } + case "resourceSettings": + if v != nil { + resourceSettings, err := unmarshalBasicResourceSettings(*v) + if err != nil { + return err + } + mrp.ResourceSettings = resourceSettings + } + case "sourceResourceSettings": + if v != nil { + var sourceResourceSettings MoveResourcePropertiesSourceResourceSettings + err = json.Unmarshal(*v, &sourceResourceSettings) + if err != nil { + return err + } + mrp.SourceResourceSettings = &sourceResourceSettings + } + case "moveStatus": + if v != nil { + var moveStatus MoveResourcePropertiesMoveStatus + err = json.Unmarshal(*v, &moveStatus) + if err != nil { + return err + } + mrp.MoveStatus = &moveStatus + } + case "dependsOn": + if v != nil { + var dependsOn []MoveResourceDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + mrp.DependsOn = &dependsOn + } + case "dependsOnOverrides": + if v != nil { + var dependsOnOverrides []MoveResourceDependencyOverride + err = json.Unmarshal(*v, &dependsOnOverrides) + if err != nil { + return err + } + mrp.DependsOnOverrides = &dependsOnOverrides + } + case "errors": + if v != nil { + var errorsVar MoveResourcePropertiesErrors + err = json.Unmarshal(*v, &errorsVar) + if err != nil { + return err + } + mrp.Errors = &errorsVar + } + } + } + + return nil +} + +// MoveResourcePropertiesErrors defines the move resource errors. +type MoveResourcePropertiesErrors struct { + // Properties - The move resource error body. + Properties *MoveResourceErrorBody `json:"properties,omitempty"` +} + +// MoveResourcePropertiesMoveStatus defines the move resource status. +type MoveResourcePropertiesMoveStatus struct { + // MoveState - Possible values include: 'AssignmentPending', 'PreparePending', 'PrepareInProgress', 'PrepareFailed', 'MovePending', 'MoveInProgress', 'MoveFailed', 'DiscardInProgress', 'DiscardFailed', 'CommitPending', 'CommitInProgress', 'CommitFailed', 'Committed' + MoveState MoveState `json:"moveState,omitempty"` + JobStatus *JobStatus `json:"jobStatus,omitempty"` + Errors *MoveResourceError `json:"errors,omitempty"` + // TargetID - Gets the Target ARM Id of the resource. + TargetID *string `json:"targetId,omitempty"` +} + +// MoveResourcePropertiesSourceResourceSettings gets or sets the source resource settings. +type MoveResourcePropertiesSourceResourceSettings struct { + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) MarshalJSON() ([]byte, error) { + mrpRs.ResourceType = ResourceTypeMoveResourcePropertiesSourceResourceSettings + objectMap := make(map[string]interface{}) + if mrpRs.TargetResourceName != nil { + objectMap["targetResourceName"] = mrpRs.TargetResourceName + } + if mrpRs.ResourceType != "" { + objectMap["resourceType"] = mrpRs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return &mrpRs, true +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for MoveResourcePropertiesSourceResourceSettings. +func (mrpRs MoveResourcePropertiesSourceResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &mrpRs, true +} + +// MoveResourcesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type MoveResourcesCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MoveResourcesCreateFuture) Result(client MoveResourcesClient) (mr MoveResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("regionmove.MoveResourcesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mr.Response.Response, err = future.GetResult(sender); err == nil && mr.Response.Response.StatusCode != http.StatusNoContent { + mr, err = client.CreateResponder(mr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesCreateFuture", "Result", mr.Response.Response, "Failure responding to request") + } + } + return +} + +// MoveResourcesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type MoveResourcesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MoveResourcesDeleteFuture) Result(client MoveResourcesClient) (osVar OperationStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("regionmove.MoveResourcesDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { + osVar, err = client.DeleteResponder(osVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesDeleteFuture", "Result", osVar.Response.Response, "Failure responding to request") + } + } + return +} + +// MoveResourceStatus defines the move resource status. +type MoveResourceStatus struct { + // MoveState - Possible values include: 'AssignmentPending', 'PreparePending', 'PrepareInProgress', 'PrepareFailed', 'MovePending', 'MoveInProgress', 'MoveFailed', 'DiscardInProgress', 'DiscardFailed', 'CommitPending', 'CommitInProgress', 'CommitFailed', 'Committed' + MoveState MoveState `json:"moveState,omitempty"` + JobStatus *JobStatus `json:"jobStatus,omitempty"` + Errors *MoveResourceError `json:"errors,omitempty"` + // TargetID - Gets the Target ARM Id of the resource. + TargetID *string `json:"targetId,omitempty"` +} + +// NetworkInterfaceResourceSettings defines the network interface resource settings. +type NetworkInterfaceResourceSettings struct { + // IPConfigurations - Gets or sets the IP configurations of the NIC. + IPConfigurations *[]NicIPConfigurationResourceSettings `json:"ipConfigurations,omitempty"` + // EnableAcceleratedNetworking - Gets or sets a value indicating whether accelerated networking is enabled. + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) MarshalJSON() ([]byte, error) { + nirs.ResourceType = ResourceTypeMicrosoftNetworknetworkInterfaces + objectMap := make(map[string]interface{}) + if nirs.IPConfigurations != nil { + objectMap["ipConfigurations"] = nirs.IPConfigurations + } + if nirs.EnableAcceleratedNetworking != nil { + objectMap["enableAcceleratedNetworking"] = nirs.EnableAcceleratedNetworking + } + if nirs.TargetResourceName != nil { + objectMap["targetResourceName"] = nirs.TargetResourceName + } + if nirs.ResourceType != "" { + objectMap["resourceType"] = nirs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return &nirs, true +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. +func (nirs NetworkInterfaceResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &nirs, true +} + +// NetworkSecurityGroupResourceSettings defines the NSG resource settings. +type NetworkSecurityGroupResourceSettings struct { + // SecurityRules - Gets or sets Security rules of network security group. + SecurityRules *[]NsgSecurityRule `json:"securityRules,omitempty"` + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) MarshalJSON() ([]byte, error) { + nsgrs.ResourceType = ResourceTypeMicrosoftNetworknetworkSecurityGroups + objectMap := make(map[string]interface{}) + if nsgrs.SecurityRules != nil { + objectMap["securityRules"] = nsgrs.SecurityRules + } + if nsgrs.TargetResourceName != nil { + objectMap["targetResourceName"] = nsgrs.TargetResourceName + } + if nsgrs.ResourceType != "" { + objectMap["resourceType"] = nsgrs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return &nsgrs, true +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. +func (nsgrs NetworkSecurityGroupResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &nsgrs, true +} + +// NicIPConfigurationResourceSettings defines NIC IP configuration properties. +type NicIPConfigurationResourceSettings struct { + // Name - Gets or sets the IP configuration name. + Name *string `json:"name,omitempty"` + // PrivateIPAddress - Gets or sets the private IP address of the network interface IP Configuration. + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + // PrivateIPAllocationMethod - Gets or sets the private IP address allocation method. + PrivateIPAllocationMethod *string `json:"privateIpAllocationMethod,omitempty"` + Subnet *SubnetReference `json:"subnet,omitempty"` + // Primary - Gets or sets a value indicating whether this IP configuration is the primary. + Primary *bool `json:"primary,omitempty"` + // LoadBalancerBackendAddressPools - Gets or sets the references of the load balancer backend address pools. + LoadBalancerBackendAddressPools *[]LoadBalancerBackendAddressPoolReference `json:"loadBalancerBackendAddressPools,omitempty"` +} + +// NsgSecurityRule security Rule data model for Network Security Groups. +type NsgSecurityRule struct { + // Name - Gets or sets the Security rule name. + Name *string `json:"name,omitempty"` + // Access - Gets or sets whether network traffic is allowed or denied. + // Possible values are “Allow” and “Deny”. + Access *string `json:"access,omitempty"` + // Description - Gets or sets a description for this rule. Restricted to 140 chars. + Description *string `json:"description,omitempty"` + // DestinationAddressPrefix - Gets or sets destination address prefix. CIDR or source IP range. + // A “*” can also be used to match all source IPs. Default tags such + // as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + // DestinationPortRange - Gets or sets Destination Port or Range. Integer or range between + // 0 and 65535. A “*” can also be used to match all ports. + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + // Direction - Gets or sets the direction of the rule.InBound or Outbound. The + // direction specifies if rule will be evaluated on incoming or outgoing traffic. + Direction *string `json:"direction,omitempty"` + // Priority - Gets or sets the priority of the rule. The value can be between + // 100 and 4096. The priority number must be unique for each rule in the collection. + // The lower the priority number, the higher the priority of the rule. + Priority *int32 `json:"priority,omitempty"` + // Protocol - Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*). + Protocol *string `json:"protocol,omitempty"` + // SourceAddressPrefix - Gets or sets source address prefix. CIDR or source IP range. A + // “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, + // ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress + // rule, specifies where network traffic originates from. + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + // SourcePortRange - Gets or sets Source Port or Range. Integer or range between 0 and + // 65535. A “*” can also be used to match all ports. + SourcePortRange *string `json:"sourcePortRange,omitempty"` +} + +// OperationErrorAdditionalInfo the operation error info. +type OperationErrorAdditionalInfo struct { + // Type - READ-ONLY; The error type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The operation error info. + Info *MoveErrorInfo `json:"info,omitempty"` +} + +// OperationsDiscovery operations discovery class. +type OperationsDiscovery struct { + // Name - Gets or sets 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 *Display `json:"display,omitempty"` + // Origin - Gets or sets 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 interface{} `json:"properties,omitempty"` +} + +// OperationsDiscoveryCollection collection of ClientDiscovery details. +type OperationsDiscoveryCollection struct { + autorest.Response `json:"-"` + // Value - Gets or sets the ClientDiscovery details. + Value *[]OperationsDiscovery `json:"value,omitempty"` + // NextLink - Gets or sets the value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationStatus operation status REST resource. +type OperationStatus struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Operation name. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; Status of the operation. ARM expects the terminal status to be one of Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + Status *string `json:"status,omitempty"` + // StartTime - READ-ONLY; Start time. + StartTime *string `json:"startTime,omitempty"` + // EndTime - READ-ONLY; End time. + EndTime *string `json:"endTime,omitempty"` + // Error - READ-ONLY; Error stating all error details for the operation. + Error *OperationStatusError `json:"error,omitempty"` + // Properties - READ-ONLY; Custom data. + Properties interface{} `json:"properties,omitempty"` +} + +// OperationStatusError class for operation status errors. +type OperationStatusError struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]OperationStatusError `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The additional info. + AdditionalInfo *[]OperationErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// PrepareRequest defines the request body for initiate prepare operation. +type PrepareRequest struct { + // ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite. + ValidateOnly *bool `json:"validateOnly,omitempty"` + // MoveResources - Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. + MoveResources *[]string `json:"moveResources,omitempty"` + // MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID' + MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"` +} + +// ProxyResourceReference defines reference to a proxy resource. +type ProxyResourceReference struct { + // Name - Gets the name of the proxy resource on the target side. + Name *string `json:"name,omitempty"` + // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. + SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` +} + +// PublicIPAddressResourceSettings defines the public IP address resource settings. +type PublicIPAddressResourceSettings struct { + // DomainNameLabel - Gets or sets the domain name label. + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + // FQDN - Gets or sets the fully qualified domain name. + FQDN *string `json:"fQDN,omitempty"` + // PublicIPAllocationMethod - Gets or sets public IP allocation method. + PublicIPAllocationMethod *string `json:"publicIpAllocationMethod,omitempty"` + // Sku - Gets or sets public IP sku. + Sku *string `json:"sku,omitempty"` + // Zones - Gets or sets public IP zones. + Zones *string `json:"zones,omitempty"` + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) MarshalJSON() ([]byte, error) { + piars.ResourceType = ResourceTypeMicrosoftNetworkpublicIPAddresses + objectMap := make(map[string]interface{}) + if piars.DomainNameLabel != nil { + objectMap["domainNameLabel"] = piars.DomainNameLabel + } + if piars.FQDN != nil { + objectMap["fQDN"] = piars.FQDN + } + if piars.PublicIPAllocationMethod != nil { + objectMap["publicIpAllocationMethod"] = piars.PublicIPAllocationMethod + } + if piars.Sku != nil { + objectMap["sku"] = piars.Sku + } + if piars.Zones != nil { + objectMap["zones"] = piars.Zones + } + if piars.TargetResourceName != nil { + objectMap["targetResourceName"] = piars.TargetResourceName + } + if piars.ResourceType != "" { + objectMap["resourceType"] = piars.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return &piars, true +} + +// AsResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. +func (piars PublicIPAddressResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &piars, true +} + +// ResourceGroupResourceSettings defines the resource group resource settings. +type ResourceGroupResourceSettings struct { + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) MarshalJSON() ([]byte, error) { + rgrs.ResourceType = ResourceTypeResourceGroups + objectMap := make(map[string]interface{}) + if rgrs.TargetResourceName != nil { + objectMap["targetResourceName"] = rgrs.TargetResourceName + } + if rgrs.ResourceType != "" { + objectMap["resourceType"] = rgrs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return &rgrs, true +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. +func (rgrs ResourceGroupResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &rgrs, true +} + +// ResourceMoveRequest defines the request body for resource move operation. +type ResourceMoveRequest struct { + // ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite. + ValidateOnly *bool `json:"validateOnly,omitempty"` + // MoveResources - Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property. + MoveResources *[]string `json:"moveResources,omitempty"` + // MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID' + MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"` +} + +// BasicResourceSettings gets or sets the resource settings. +type BasicResourceSettings interface { + AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) + AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) + AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) + AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) + AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) + AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) + AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) + AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) + AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) + AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) + AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) + AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) + AsResourceSettings() (*ResourceSettings, bool) +} + +// ResourceSettings gets or sets the resource settings. +type ResourceSettings struct { + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +func unmarshalBasicResourceSettings(body []byte) (BasicResourceSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["resourceType"] { + case string(ResourceTypeMoveResourcePropertiesSourceResourceSettings): + var mrpRs MoveResourcePropertiesSourceResourceSettings + err := json.Unmarshal(body, &mrpRs) + return mrpRs, err + case string(ResourceTypeMicrosoftComputevirtualMachines): + var vmrs VirtualMachineResourceSettings + err := json.Unmarshal(body, &vmrs) + return vmrs, err + case string(ResourceTypeMicrosoftComputeavailabilitySets): + var asrs AvailabilitySetResourceSettings + err := json.Unmarshal(body, &asrs) + return asrs, err + case string(ResourceTypeMicrosoftNetworkvirtualNetworks): + var vnrs VirtualNetworkResourceSettings + err := json.Unmarshal(body, &vnrs) + return vnrs, err + case string(ResourceTypeMicrosoftNetworknetworkInterfaces): + var nirs NetworkInterfaceResourceSettings + err := json.Unmarshal(body, &nirs) + return nirs, err + case string(ResourceTypeMicrosoftNetworknetworkSecurityGroups): + var nsgrs NetworkSecurityGroupResourceSettings + err := json.Unmarshal(body, &nsgrs) + return nsgrs, err + case string(ResourceTypeMicrosoftNetworkloadBalancers): + var lbrs LoadBalancerResourceSettings + err := json.Unmarshal(body, &lbrs) + return lbrs, err + case string(ResourceTypeMicrosoftSqlservers): + var ssrs SQLServerResourceSettings + err := json.Unmarshal(body, &ssrs) + return ssrs, err + case string(ResourceTypeMicrosoftSqlserverselasticPools): + var seprs SQLElasticPoolResourceSettings + err := json.Unmarshal(body, &seprs) + return seprs, err + case string(ResourceTypeMicrosoftSqlserversdatabases): + var sdrs SQLDatabaseResourceSettings + err := json.Unmarshal(body, &sdrs) + return sdrs, err + case string(ResourceTypeResourceGroups): + var rgrs ResourceGroupResourceSettings + err := json.Unmarshal(body, &rgrs) + return rgrs, err + case string(ResourceTypeMicrosoftNetworkpublicIPAddresses): + var piars PublicIPAddressResourceSettings + err := json.Unmarshal(body, &piars) + return piars, err + default: + var rs ResourceSettings + err := json.Unmarshal(body, &rs) + return rs, err + } +} +func unmarshalBasicResourceSettingsArray(body []byte) ([]BasicResourceSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rsArray := make([]BasicResourceSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rs, err := unmarshalBasicResourceSettings(*rawMessage) + if err != nil { + return nil, err + } + rsArray[index] = rs + } + return rsArray, nil +} + +// MarshalJSON is the custom marshaler for ResourceSettings. +func (rs ResourceSettings) MarshalJSON() ([]byte, error) { + rs.ResourceType = ResourceTypeResourceSettings + objectMap := make(map[string]interface{}) + if rs.TargetResourceName != nil { + objectMap["targetResourceName"] = rs.TargetResourceName + } + if rs.ResourceType != "" { + objectMap["resourceType"] = rs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return &rs, true +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for ResourceSettings. +func (rs ResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &rs, true +} + +// SQLDatabaseResourceSettings defines the Sql Database resource settings. +type SQLDatabaseResourceSettings struct { + // ZoneRedundant - Possible values include: 'Enable', 'Disable' + ZoneRedundant ZoneRedundant `json:"zoneRedundant,omitempty"` + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) MarshalJSON() ([]byte, error) { + sdrs.ResourceType = ResourceTypeMicrosoftSqlserversdatabases + objectMap := make(map[string]interface{}) + if sdrs.ZoneRedundant != "" { + objectMap["zoneRedundant"] = sdrs.ZoneRedundant + } + if sdrs.TargetResourceName != nil { + objectMap["targetResourceName"] = sdrs.TargetResourceName + } + if sdrs.ResourceType != "" { + objectMap["resourceType"] = sdrs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return &sdrs, true +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. +func (sdrs SQLDatabaseResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &sdrs, true +} + +// SQLElasticPoolResourceSettings defines the Sql ElasticPool resource settings. +type SQLElasticPoolResourceSettings struct { + // ZoneRedundant - Possible values include: 'Enable', 'Disable' + ZoneRedundant ZoneRedundant `json:"zoneRedundant,omitempty"` + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) MarshalJSON() ([]byte, error) { + seprs.ResourceType = ResourceTypeMicrosoftSqlserverselasticPools + objectMap := make(map[string]interface{}) + if seprs.ZoneRedundant != "" { + objectMap["zoneRedundant"] = seprs.ZoneRedundant + } + if seprs.TargetResourceName != nil { + objectMap["targetResourceName"] = seprs.TargetResourceName + } + if seprs.ResourceType != "" { + objectMap["resourceType"] = seprs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return &seprs, true +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. +func (seprs SQLElasticPoolResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &seprs, true +} + +// SQLServerResourceSettings defines the SQL Server resource settings. +type SQLServerResourceSettings struct { + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) MarshalJSON() ([]byte, error) { + ssrs.ResourceType = ResourceTypeMicrosoftSqlservers + objectMap := make(map[string]interface{}) + if ssrs.TargetResourceName != nil { + objectMap["targetResourceName"] = ssrs.TargetResourceName + } + if ssrs.ResourceType != "" { + objectMap["resourceType"] = ssrs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return &ssrs, true +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. +func (ssrs SQLServerResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &ssrs, true +} + +// SubnetReference defines reference to subnet. +type SubnetReference struct { + // Name - Gets the name of the proxy resource on the target side. + Name *string `json:"name,omitempty"` + // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. + SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` +} + +// SubnetResourceSettings defines the virtual network subnets resource settings. +type SubnetResourceSettings struct { + // Name - Gets or sets the Subnet name. + Name *string `json:"name,omitempty"` + // AddressPrefix - Gets or sets address prefix for the subnet. + AddressPrefix *string `json:"addressPrefix,omitempty"` +} + +// UnresolvedDependency unresolved dependency. +type UnresolvedDependency struct { + // Count - Gets or sets the count. + Count *int32 `json:"count,omitempty"` + // ID - Gets or sets the arm id of the dependency. + ID *string `json:"id,omitempty"` +} + +// UnresolvedDependencyCollection unresolved dependency collection. +type UnresolvedDependencyCollection struct { + autorest.Response `json:"-"` + // Value - Gets or sets the list of unresolved dependencies. + Value *[]UnresolvedDependency `json:"value,omitempty"` + // NextLink - Gets or sets the value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// UpdateMoveCollectionRequest defines the request body for updating move collection. +type UpdateMoveCollectionRequest struct { + // Tags - Gets or sets the Resource tags. + Tags map[string]*string `json:"tags"` + Identity *Identity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpdateMoveCollectionRequest. +func (umcr UpdateMoveCollectionRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if umcr.Tags != nil { + objectMap["tags"] = umcr.Tags + } + if umcr.Identity != nil { + objectMap["identity"] = umcr.Identity + } + return json.Marshal(objectMap) +} + +// VirtualMachineResourceSettings gets or sets the virtual machine resource settings. +type VirtualMachineResourceSettings struct { + // TargetAvailabilityZone - Gets or sets the target availability zone. Possible values include: 'One', 'Two', 'Three', 'NA' + TargetAvailabilityZone TargetAvailabilityZone `json:"targetAvailabilityZone,omitempty"` + // TargetVMSize - Gets or sets the target virtual machine size. + TargetVMSize *string `json:"targetVmSize,omitempty"` + // TargetAvailabilitySetID - Gets or sets the target availability set id for virtual machines not in an availability set at source. + TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) MarshalJSON() ([]byte, error) { + vmrs.ResourceType = ResourceTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if vmrs.TargetAvailabilityZone != "" { + objectMap["targetAvailabilityZone"] = vmrs.TargetAvailabilityZone + } + if vmrs.TargetVMSize != nil { + objectMap["targetVmSize"] = vmrs.TargetVMSize + } + if vmrs.TargetAvailabilitySetID != nil { + objectMap["targetAvailabilitySetId"] = vmrs.TargetAvailabilitySetID + } + if vmrs.TargetResourceName != nil { + objectMap["targetResourceName"] = vmrs.TargetResourceName + } + if vmrs.ResourceType != "" { + objectMap["resourceType"] = vmrs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return &vmrs, true +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return nil, false +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. +func (vmrs VirtualMachineResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &vmrs, true +} + +// VirtualNetworkResourceSettings defines the virtual network resource settings. +type VirtualNetworkResourceSettings struct { + // EnableDdosProtection - Gets or sets a value indicating whether gets or sets whether the + // DDOS protection should be switched on. + EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` + // AddressSpace - Gets or sets the address prefixes for the virtual network. + AddressSpace *[]string `json:"addressSpace,omitempty"` + // DNSServers - Gets or sets DHCPOptions that contains an array of DNS servers available to VMs + // deployed in the virtual network. + DNSServers *[]string `json:"dnsServers,omitempty"` + // Subnets - Gets or sets List of subnets in a VirtualNetwork. + Subnets *[]SubnetResourceSettings `json:"subnets,omitempty"` + // TargetResourceName - Gets or sets the target Resource name. + TargetResourceName *string `json:"targetResourceName,omitempty"` + // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMoveResourcePropertiesSourceResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses' + ResourceType ResourceType `json:"resourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) MarshalJSON() ([]byte, error) { + vnrs.ResourceType = ResourceTypeMicrosoftNetworkvirtualNetworks + objectMap := make(map[string]interface{}) + if vnrs.EnableDdosProtection != nil { + objectMap["enableDdosProtection"] = vnrs.EnableDdosProtection + } + if vnrs.AddressSpace != nil { + objectMap["addressSpace"] = vnrs.AddressSpace + } + if vnrs.DNSServers != nil { + objectMap["dnsServers"] = vnrs.DNSServers + } + if vnrs.Subnets != nil { + objectMap["subnets"] = vnrs.Subnets + } + if vnrs.TargetResourceName != nil { + objectMap["targetResourceName"] = vnrs.TargetResourceName + } + if vnrs.ResourceType != "" { + objectMap["resourceType"] = vnrs.ResourceType + } + return json.Marshal(objectMap) +} + +// AsMoveResourcePropertiesSourceResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsMoveResourcePropertiesSourceResourceSettings() (*MoveResourcePropertiesSourceResourceSettings, bool) { + return nil, false +} + +// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { + return nil, false +} + +// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { + return nil, false +} + +// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { + return &vnrs, true +} + +// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { + return nil, false +} + +// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { + return nil, false +} + +// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { + return nil, false +} + +// AsSQLServerResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { + return nil, false +} + +// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { + return nil, false +} + +// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { + return nil, false +} + +// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { + return nil, false +} + +// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { + return nil, false +} + +// AsResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { + return nil, false +} + +// AsBasicResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. +func (vnrs VirtualNetworkResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { + return &vnrs, true +} diff --git a/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/movecollections.go b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/movecollections.go new file mode 100644 index 000000000000..a263b79c865b --- /dev/null +++ b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/movecollections.go @@ -0,0 +1,1028 @@ +package regionmove + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// MoveCollectionsClient is the a first party Azure service orchestrating the move of Azure resources from one Azure +// region to another or between zones within a region. +type MoveCollectionsClient struct { + BaseClient +} + +// NewMoveCollectionsClient creates an instance of the MoveCollectionsClient client. +func NewMoveCollectionsClient(subscriptionID string) MoveCollectionsClient { + return NewMoveCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMoveCollectionsClientWithBaseURI creates an instance of the MoveCollectionsClient 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 NewMoveCollectionsClientWithBaseURI(baseURI string, subscriptionID string) MoveCollectionsClient { + return MoveCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Commit commits the set of resources included in the request body. The commit operation is triggered on the +// moveResources in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource +// moveState do a transition to Committed. To aid the user to prerequisite the operation the client can call operation +// with validateOnly property set to true. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client MoveCollectionsClient) Commit(ctx context.Context, resourceGroupName string, moveCollectionName string, body *CommitRequest) (result MoveCollectionsCommitFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.Commit") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.MoveResources", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("regionmove.MoveCollectionsClient", "Commit", err.Error()) + } + + req, err := client.CommitPreparer(ctx, resourceGroupName, moveCollectionName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Commit", nil, "Failure preparing request") + return + } + + result, err = client.CommitSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Commit", result.Response(), "Failure sending request") + return + } + + return +} + +// CommitPreparer prepares the Commit request. +func (client MoveCollectionsClient) CommitPreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, body *CommitRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + 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.Migrate/moveCollections/{moveCollectionName}/commit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CommitSender sends the Commit request. The method will close the +// http.Response Body if it receives an error. +func (client MoveCollectionsClient) CommitSender(req *http.Request) (future MoveCollectionsCommitFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CommitResponder handles the response to the Commit request. The method always +// closes the http.Response Body. +func (client MoveCollectionsClient) CommitResponder(resp *http.Response) (result OperationStatus, 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 creates or updates a move collection. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client MoveCollectionsClient) Create(ctx context.Context, resourceGroupName string, moveCollectionName string, body *MoveCollection) (result MoveCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.Properties.SourceRegion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.Properties.TargetRegion", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("regionmove.MoveCollectionsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, moveCollectionName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client MoveCollectionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, body *MoveCollection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + 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 MoveCollectionsClient) 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 MoveCollectionsClient) CreateResponder(resp *http.Response) (result MoveCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a move collection. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client MoveCollectionsClient) Delete(ctx context.Context, resourceGroupName string, moveCollectionName string) (result MoveCollectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, moveCollectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client MoveCollectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, moveCollectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}", 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 MoveCollectionsClient) DeleteSender(req *http.Request) (future MoveCollectionsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client MoveCollectionsClient) DeleteResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Discard discards the set of resources included in the request body. The discard operation is triggered on the +// moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource +// moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call +// operation with validateOnly property set to true. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client MoveCollectionsClient) Discard(ctx context.Context, resourceGroupName string, moveCollectionName string, body *DiscardRequest) (result MoveCollectionsDiscardFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.Discard") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.MoveResources", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("regionmove.MoveCollectionsClient", "Discard", err.Error()) + } + + req, err := client.DiscardPreparer(ctx, resourceGroupName, moveCollectionName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Discard", nil, "Failure preparing request") + return + } + + result, err = client.DiscardSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Discard", result.Response(), "Failure sending request") + return + } + + return +} + +// DiscardPreparer prepares the Discard request. +func (client MoveCollectionsClient) DiscardPreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, body *DiscardRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + 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.Migrate/moveCollections/{moveCollectionName}/discard", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscardSender sends the Discard request. The method will close the +// http.Response Body if it receives an error. +func (client MoveCollectionsClient) DiscardSender(req *http.Request) (future MoveCollectionsDiscardFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DiscardResponder handles the response to the Discard request. The method always +// closes the http.Response Body. +func (client MoveCollectionsClient) DiscardResponder(resp *http.Response) (result OperationStatus, 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 move collection. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client MoveCollectionsClient) Get(ctx context.Context, resourceGroupName string, moveCollectionName string) (result MoveCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.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, resourceGroupName, moveCollectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MoveCollectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, moveCollectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}", 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 MoveCollectionsClient) 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 MoveCollectionsClient) GetResponder(resp *http.Response) (result MoveCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// InitiateMove moves the set of resources included in the request body. The move operation is triggered after the +// moveResources are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource +// moveState do a transition to CommitPending. To aid the user to prerequisite the operation the client can call +// operation with validateOnly property set to true. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client MoveCollectionsClient) InitiateMove(ctx context.Context, resourceGroupName string, moveCollectionName string, body *ResourceMoveRequest) (result MoveCollectionsInitiateMoveFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.InitiateMove") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.MoveResources", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("regionmove.MoveCollectionsClient", "InitiateMove", err.Error()) + } + + req, err := client.InitiateMovePreparer(ctx, resourceGroupName, moveCollectionName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "InitiateMove", nil, "Failure preparing request") + return + } + + result, err = client.InitiateMoveSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "InitiateMove", result.Response(), "Failure sending request") + return + } + + return +} + +// InitiateMovePreparer prepares the InitiateMove request. +func (client MoveCollectionsClient) InitiateMovePreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, body *ResourceMoveRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + 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.Migrate/moveCollections/{moveCollectionName}/initiateMove", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InitiateMoveSender sends the InitiateMove request. The method will close the +// http.Response Body if it receives an error. +func (client MoveCollectionsClient) InitiateMoveSender(req *http.Request) (future MoveCollectionsInitiateMoveFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// InitiateMoveResponder handles the response to the InitiateMove request. The method always +// closes the http.Response Body. +func (client MoveCollectionsClient) InitiateMoveResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMoveCollectionsByResourceGroup get all the Move Collections in the resource group. +// Parameters: +// resourceGroupName - the Resource Group Name. +func (client MoveCollectionsClient) ListMoveCollectionsByResourceGroup(ctx context.Context, resourceGroupName string) (result MoveCollectionResultListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.ListMoveCollectionsByResourceGroup") + defer func() { + sc := -1 + if result.mcrl.Response.Response != nil { + sc = result.mcrl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listMoveCollectionsByResourceGroupNextResults + req, err := client.ListMoveCollectionsByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "ListMoveCollectionsByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListMoveCollectionsByResourceGroupSender(req) + if err != nil { + result.mcrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "ListMoveCollectionsByResourceGroup", resp, "Failure sending request") + return + } + + result.mcrl, err = client.ListMoveCollectionsByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "ListMoveCollectionsByResourceGroup", resp, "Failure responding to request") + } + if result.mcrl.hasNextLink() && result.mcrl.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListMoveCollectionsByResourceGroupPreparer prepares the ListMoveCollectionsByResourceGroup request. +func (client MoveCollectionsClient) ListMoveCollectionsByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMoveCollectionsByResourceGroupSender sends the ListMoveCollectionsByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client MoveCollectionsClient) ListMoveCollectionsByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMoveCollectionsByResourceGroupResponder handles the response to the ListMoveCollectionsByResourceGroup request. The method always +// closes the http.Response Body. +func (client MoveCollectionsClient) ListMoveCollectionsByResourceGroupResponder(resp *http.Response) (result MoveCollectionResultList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listMoveCollectionsByResourceGroupNextResults retrieves the next set of results, if any. +func (client MoveCollectionsClient) listMoveCollectionsByResourceGroupNextResults(ctx context.Context, lastResults MoveCollectionResultList) (result MoveCollectionResultList, err error) { + req, err := lastResults.moveCollectionResultListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "listMoveCollectionsByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListMoveCollectionsByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "listMoveCollectionsByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListMoveCollectionsByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "listMoveCollectionsByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListMoveCollectionsByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client MoveCollectionsClient) ListMoveCollectionsByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result MoveCollectionResultListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.ListMoveCollectionsByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListMoveCollectionsByResourceGroup(ctx, resourceGroupName) + return +} + +// ListMoveCollectionsBySubscription get all the Move Collections in the subscription. +func (client MoveCollectionsClient) ListMoveCollectionsBySubscription(ctx context.Context) (result MoveCollectionResultListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.ListMoveCollectionsBySubscription") + defer func() { + sc := -1 + if result.mcrl.Response.Response != nil { + sc = result.mcrl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listMoveCollectionsBySubscriptionNextResults + req, err := client.ListMoveCollectionsBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "ListMoveCollectionsBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListMoveCollectionsBySubscriptionSender(req) + if err != nil { + result.mcrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "ListMoveCollectionsBySubscription", resp, "Failure sending request") + return + } + + result.mcrl, err = client.ListMoveCollectionsBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "ListMoveCollectionsBySubscription", resp, "Failure responding to request") + } + if result.mcrl.hasNextLink() && result.mcrl.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListMoveCollectionsBySubscriptionPreparer prepares the ListMoveCollectionsBySubscription request. +func (client MoveCollectionsClient) ListMoveCollectionsBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/moveCollections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMoveCollectionsBySubscriptionSender sends the ListMoveCollectionsBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client MoveCollectionsClient) ListMoveCollectionsBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMoveCollectionsBySubscriptionResponder handles the response to the ListMoveCollectionsBySubscription request. The method always +// closes the http.Response Body. +func (client MoveCollectionsClient) ListMoveCollectionsBySubscriptionResponder(resp *http.Response) (result MoveCollectionResultList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listMoveCollectionsBySubscriptionNextResults retrieves the next set of results, if any. +func (client MoveCollectionsClient) listMoveCollectionsBySubscriptionNextResults(ctx context.Context, lastResults MoveCollectionResultList) (result MoveCollectionResultList, err error) { + req, err := lastResults.moveCollectionResultListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "listMoveCollectionsBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListMoveCollectionsBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "listMoveCollectionsBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListMoveCollectionsBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "listMoveCollectionsBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListMoveCollectionsBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client MoveCollectionsClient) ListMoveCollectionsBySubscriptionComplete(ctx context.Context) (result MoveCollectionResultListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.ListMoveCollectionsBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListMoveCollectionsBySubscription(ctx) + return +} + +// Prepare initiates prepare for the set of resources included in the request body. The prepare operation is on the +// moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the +// moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can +// call operation with validateOnly property set to true. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client MoveCollectionsClient) Prepare(ctx context.Context, resourceGroupName string, moveCollectionName string, body *PrepareRequest) (result MoveCollectionsPrepareFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.Prepare") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.MoveResources", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("regionmove.MoveCollectionsClient", "Prepare", err.Error()) + } + + req, err := client.PreparePreparer(ctx, resourceGroupName, moveCollectionName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Prepare", nil, "Failure preparing request") + return + } + + result, err = client.PrepareSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Prepare", result.Response(), "Failure sending request") + return + } + + return +} + +// PreparePreparer prepares the Prepare request. +func (client MoveCollectionsClient) PreparePreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, body *PrepareRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + 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.Migrate/moveCollections/{moveCollectionName}/prepare", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PrepareSender sends the Prepare request. The method will close the +// http.Response Body if it receives an error. +func (client MoveCollectionsClient) PrepareSender(req *http.Request) (future MoveCollectionsPrepareFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// PrepareResponder handles the response to the Prepare request. The method always +// closes the http.Response Body. +func (client MoveCollectionsClient) PrepareResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResolveDependencies computes, resolves and validate the dependencies of the moveResources in the move collection. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client MoveCollectionsClient) ResolveDependencies(ctx context.Context, resourceGroupName string, moveCollectionName string) (result MoveCollectionsResolveDependenciesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.ResolveDependencies") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResolveDependenciesPreparer(ctx, resourceGroupName, moveCollectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "ResolveDependencies", nil, "Failure preparing request") + return + } + + result, err = client.ResolveDependenciesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "ResolveDependencies", result.Response(), "Failure sending request") + return + } + + return +} + +// ResolveDependenciesPreparer prepares the ResolveDependencies request. +func (client MoveCollectionsClient) ResolveDependenciesPreparer(ctx context.Context, resourceGroupName string, moveCollectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/resolveDependencies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResolveDependenciesSender sends the ResolveDependencies request. The method will close the +// http.Response Body if it receives an error. +func (client MoveCollectionsClient) ResolveDependenciesSender(req *http.Request) (future MoveCollectionsResolveDependenciesFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ResolveDependenciesResponder handles the response to the ResolveDependencies request. The method always +// closes the http.Response Body. +func (client MoveCollectionsClient) ResolveDependenciesResponder(resp *http.Response) (result OperationStatus, 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 updates a move collection. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client MoveCollectionsClient) Update(ctx context.Context, resourceGroupName string, moveCollectionName string, body *UpdateMoveCollectionRequest) (result MoveCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, moveCollectionName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveCollectionsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client MoveCollectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, body *UpdateMoveCollectionRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + 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.Migrate/moveCollections/{moveCollectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + 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 MoveCollectionsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client MoveCollectionsClient) UpdateResponder(resp *http.Response) (result MoveCollection, 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/preview/regionmove/mgmt/2019-10-01-preview/regionmove/moveresources.go b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/moveresources.go new file mode 100644 index 000000000000..6047413d6f0c --- /dev/null +++ b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/moveresources.go @@ -0,0 +1,416 @@ +package regionmove + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// MoveResourcesClient is the a first party Azure service orchestrating the move of Azure resources from one Azure +// region to another or between zones within a region. +type MoveResourcesClient struct { + BaseClient +} + +// NewMoveResourcesClient creates an instance of the MoveResourcesClient client. +func NewMoveResourcesClient(subscriptionID string) MoveResourcesClient { + return NewMoveResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMoveResourcesClientWithBaseURI creates an instance of the MoveResourcesClient 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 NewMoveResourcesClientWithBaseURI(baseURI string, subscriptionID string) MoveResourcesClient { + return MoveResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates or updates a Move Resource in the move collection. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +// moveResourceName - the Move Resource Name. +func (client MoveResourcesClient) Create(ctx context.Context, resourceGroupName string, moveCollectionName string, moveResourceName string, body *MoveResource) (result MoveResourcesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourcesClient.Create") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.Properties.SourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.Properties.ResourceSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.Properties.ResourceSettings.TargetResourceName", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("regionmove.MoveResourcesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, moveCollectionName, moveResourceName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client MoveResourcesClient) CreatePreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, moveResourceName string, body *MoveResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "moveResourceName": autorest.Encode("path", moveResourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + 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 MoveResourcesClient) CreateSender(req *http.Request) (future MoveResourcesCreateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client MoveResourcesClient) CreateResponder(resp *http.Response) (result MoveResource, 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 deletes a Move Resource from the move collection. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +// moveResourceName - the Move Resource Name. +func (client MoveResourcesClient) Delete(ctx context.Context, resourceGroupName string, moveCollectionName string, moveResourceName string) (result MoveResourcesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourcesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, moveCollectionName, moveResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client MoveResourcesClient) DeletePreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, moveResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "moveResourceName": autorest.Encode("path", moveResourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}", 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 MoveResourcesClient) DeleteSender(req *http.Request) (future MoveResourcesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client MoveResourcesClient) DeleteResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the Move Resource. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +// moveResourceName - the Move Resource Name. +func (client MoveResourcesClient) Get(ctx context.Context, resourceGroupName string, moveCollectionName string, moveResourceName string) (result MoveResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourcesClient.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, resourceGroupName, moveCollectionName, moveResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MoveResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, moveResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "moveResourceName": autorest.Encode("path", moveResourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}", 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 MoveResourcesClient) 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 MoveResourcesClient) GetResponder(resp *http.Response) (result MoveResource, 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 Move Resources in the move collection. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +// filter - the filter to apply on the operation. For example, you can use $filter=Properties/ProvisioningState +// eq 'Succeeded'. +func (client MoveResourcesClient) List(ctx context.Context, resourceGroupName string, moveCollectionName string, filter string) (result MoveResourceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourcesClient.List") + defer func() { + sc := -1 + if result.mrc.Response.Response != nil { + sc = result.mrc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, moveCollectionName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mrc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "List", resp, "Failure sending request") + return + } + + result.mrc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "List", resp, "Failure responding to request") + } + if result.mrc.hasNextLink() && result.mrc.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client MoveResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, moveCollectionName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + 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.Migrate/moveCollections/{moveCollectionName}/moveResources", 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 MoveResourcesClient) 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 MoveResourcesClient) ListResponder(resp *http.Response) (result MoveResourceCollection, 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 MoveResourcesClient) listNextResults(ctx context.Context, lastResults MoveResourceCollection) (result MoveResourceCollection, err error) { + req, err := lastResults.moveResourceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "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, "regionmove.MoveResourcesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.MoveResourcesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client MoveResourcesClient) ListComplete(ctx context.Context, resourceGroupName string, moveCollectionName string, filter string) (result MoveResourceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourcesClient.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, resourceGroupName, moveCollectionName, filter) + return +} diff --git a/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/operationsdiscovery.go b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/operationsdiscovery.go new file mode 100644 index 000000000000..6f29dba0d944 --- /dev/null +++ b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/operationsdiscovery.go @@ -0,0 +1,110 @@ +package regionmove + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// OperationsDiscoveryClient is the a first party Azure service orchestrating the move of Azure resources from one +// Azure region to another or between zones within a region. +type OperationsDiscoveryClient struct { + BaseClient +} + +// NewOperationsDiscoveryClient creates an instance of the OperationsDiscoveryClient client. +func NewOperationsDiscoveryClient(subscriptionID string) OperationsDiscoveryClient { + return NewOperationsDiscoveryClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsDiscoveryClientWithBaseURI creates an instance of the OperationsDiscoveryClient 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 NewOperationsDiscoveryClientWithBaseURI(baseURI string, subscriptionID string) OperationsDiscoveryClient { + return OperationsDiscoveryClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get sends the get request. +func (client OperationsDiscoveryClient) Get(ctx context.Context) (result OperationsDiscoveryCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDiscoveryClient.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, "regionmove.OperationsDiscoveryClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "regionmove.OperationsDiscoveryClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.OperationsDiscoveryClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationsDiscoveryClient) GetPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Migrate/operations"), + 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 OperationsDiscoveryClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OperationsDiscoveryClient) GetResponder(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 +} diff --git a/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/regionmoveapi/interfaces.go b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/regionmoveapi/interfaces.go new file mode 100644 index 000000000000..330a8d5fce06 --- /dev/null +++ b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/regionmoveapi/interfaces.go @@ -0,0 +1,67 @@ +package regionmoveapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/preview/regionmove/mgmt/2019-10-01-preview/regionmove" +) + +// MoveCollectionsClientAPI contains the set of methods on the MoveCollectionsClient type. +type MoveCollectionsClientAPI interface { + Commit(ctx context.Context, resourceGroupName string, moveCollectionName string, body *regionmove.CommitRequest) (result regionmove.MoveCollectionsCommitFuture, err error) + Create(ctx context.Context, resourceGroupName string, moveCollectionName string, body *regionmove.MoveCollection) (result regionmove.MoveCollection, err error) + Delete(ctx context.Context, resourceGroupName string, moveCollectionName string) (result regionmove.MoveCollectionsDeleteFuture, err error) + Discard(ctx context.Context, resourceGroupName string, moveCollectionName string, body *regionmove.DiscardRequest) (result regionmove.MoveCollectionsDiscardFuture, err error) + Get(ctx context.Context, resourceGroupName string, moveCollectionName string) (result regionmove.MoveCollection, err error) + InitiateMove(ctx context.Context, resourceGroupName string, moveCollectionName string, body *regionmove.ResourceMoveRequest) (result regionmove.MoveCollectionsInitiateMoveFuture, err error) + ListMoveCollectionsByResourceGroup(ctx context.Context, resourceGroupName string) (result regionmove.MoveCollectionResultListPage, err error) + ListMoveCollectionsByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result regionmove.MoveCollectionResultListIterator, err error) + ListMoveCollectionsBySubscription(ctx context.Context) (result regionmove.MoveCollectionResultListPage, err error) + ListMoveCollectionsBySubscriptionComplete(ctx context.Context) (result regionmove.MoveCollectionResultListIterator, err error) + Prepare(ctx context.Context, resourceGroupName string, moveCollectionName string, body *regionmove.PrepareRequest) (result regionmove.MoveCollectionsPrepareFuture, err error) + ResolveDependencies(ctx context.Context, resourceGroupName string, moveCollectionName string) (result regionmove.MoveCollectionsResolveDependenciesFuture, err error) + Update(ctx context.Context, resourceGroupName string, moveCollectionName string, body *regionmove.UpdateMoveCollectionRequest) (result regionmove.MoveCollection, err error) +} + +var _ MoveCollectionsClientAPI = (*regionmove.MoveCollectionsClient)(nil) + +// MoveResourcesClientAPI contains the set of methods on the MoveResourcesClient type. +type MoveResourcesClientAPI interface { + Create(ctx context.Context, resourceGroupName string, moveCollectionName string, moveResourceName string, body *regionmove.MoveResource) (result regionmove.MoveResourcesCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, moveCollectionName string, moveResourceName string) (result regionmove.MoveResourcesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, moveCollectionName string, moveResourceName string) (result regionmove.MoveResource, err error) + List(ctx context.Context, resourceGroupName string, moveCollectionName string, filter string) (result regionmove.MoveResourceCollectionPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, moveCollectionName string, filter string) (result regionmove.MoveResourceCollectionIterator, err error) +} + +var _ MoveResourcesClientAPI = (*regionmove.MoveResourcesClient)(nil) + +// UnresolvedDependenciesClientAPI contains the set of methods on the UnresolvedDependenciesClient type. +type UnresolvedDependenciesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, moveCollectionName string) (result regionmove.UnresolvedDependencyCollection, err error) +} + +var _ UnresolvedDependenciesClientAPI = (*regionmove.UnresolvedDependenciesClient)(nil) + +// OperationsDiscoveryClientAPI contains the set of methods on the OperationsDiscoveryClient type. +type OperationsDiscoveryClientAPI interface { + Get(ctx context.Context) (result regionmove.OperationsDiscoveryCollection, err error) +} + +var _ OperationsDiscoveryClientAPI = (*regionmove.OperationsDiscoveryClient)(nil) diff --git a/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/unresolveddependencies.go b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/unresolveddependencies.go new file mode 100644 index 000000000000..2ba5495cbf52 --- /dev/null +++ b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/unresolveddependencies.go @@ -0,0 +1,119 @@ +package regionmove + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// UnresolvedDependenciesClient is the a first party Azure service orchestrating the move of Azure resources from one +// Azure region to another or between zones within a region. +type UnresolvedDependenciesClient struct { + BaseClient +} + +// NewUnresolvedDependenciesClient creates an instance of the UnresolvedDependenciesClient client. +func NewUnresolvedDependenciesClient(subscriptionID string) UnresolvedDependenciesClient { + return NewUnresolvedDependenciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUnresolvedDependenciesClientWithBaseURI creates an instance of the UnresolvedDependenciesClient 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 NewUnresolvedDependenciesClientWithBaseURI(baseURI string, subscriptionID string) UnresolvedDependenciesClient { + return UnresolvedDependenciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a list of unresolved dependencies. +// Parameters: +// resourceGroupName - the Resource Group Name. +// moveCollectionName - the Move Collection Name. +func (client UnresolvedDependenciesClient) Get(ctx context.Context, resourceGroupName string, moveCollectionName string) (result UnresolvedDependencyCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UnresolvedDependenciesClient.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, resourceGroupName, moveCollectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.UnresolvedDependenciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "regionmove.UnresolvedDependenciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "regionmove.UnresolvedDependenciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client UnresolvedDependenciesClient) GetPreparer(ctx context.Context, resourceGroupName string, moveCollectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "moveCollectionName": autorest.Encode("path", moveCollectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/unresolvedDependencies", 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 UnresolvedDependenciesClient) 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 UnresolvedDependenciesClient) GetResponder(resp *http.Response) (result UnresolvedDependencyCollection, 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/preview/regionmove/mgmt/2019-10-01-preview/regionmove/version.go b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/version.go new file mode 100644 index 000000000000..efd5efe5c6b2 --- /dev/null +++ b/services/preview/regionmove/mgmt/2019-10-01-preview/regionmove/version.go @@ -0,0 +1,30 @@ +package regionmove + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " regionmove/2019-10-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +}