1package resourcemover 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/to" 15 "github.com/Azure/go-autorest/tracing" 16 "net/http" 17) 18 19// The package's fully qualified name. 20const fqdn = "github.com/Azure/azure-sdk-for-go/services/resourcemover/mgmt/2021-01-01/resourcemover" 21 22// AffectedMoveResource the RP custom operation error info. 23type AffectedMoveResource struct { 24 // ID - READ-ONLY; The affected move resource id. 25 ID *string `json:"id,omitempty"` 26 // SourceID - READ-ONLY; The affected move resource source id. 27 SourceID *string `json:"sourceId,omitempty"` 28 // MoveResources - READ-ONLY; The affected move resources. 29 MoveResources *[]AffectedMoveResource `json:"moveResources,omitempty"` 30} 31 32// MarshalJSON is the custom marshaler for AffectedMoveResource. 33func (amr AffectedMoveResource) MarshalJSON() ([]byte, error) { 34 objectMap := make(map[string]interface{}) 35 return json.Marshal(objectMap) 36} 37 38// AutomaticResolutionProperties defines the properties for automatic resolution. 39type AutomaticResolutionProperties struct { 40 // MoveResourceID - Gets the MoveResource ARM ID of 41 // the dependent resource if the resolution type is Automatic. 42 MoveResourceID *string `json:"moveResourceId,omitempty"` 43} 44 45// AvailabilitySetResourceSettings gets or sets the availability set resource settings. 46type AvailabilitySetResourceSettings struct { 47 // FaultDomain - Gets or sets the target fault domain. 48 FaultDomain *int32 `json:"faultDomain,omitempty"` 49 // UpdateDomain - Gets or sets the target update domain. 50 UpdateDomain *int32 `json:"updateDomain,omitempty"` 51 // TargetResourceName - Gets or sets the target Resource name. 52 TargetResourceName *string `json:"targetResourceName,omitempty"` 53 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 54 ResourceType ResourceType `json:"resourceType,omitempty"` 55} 56 57// MarshalJSON is the custom marshaler for AvailabilitySetResourceSettings. 58func (asrs AvailabilitySetResourceSettings) MarshalJSON() ([]byte, error) { 59 asrs.ResourceType = ResourceTypeMicrosoftComputeavailabilitySets 60 objectMap := make(map[string]interface{}) 61 if asrs.FaultDomain != nil { 62 objectMap["faultDomain"] = asrs.FaultDomain 63 } 64 if asrs.UpdateDomain != nil { 65 objectMap["updateDomain"] = asrs.UpdateDomain 66 } 67 if asrs.TargetResourceName != nil { 68 objectMap["targetResourceName"] = asrs.TargetResourceName 69 } 70 if asrs.ResourceType != "" { 71 objectMap["resourceType"] = asrs.ResourceType 72 } 73 return json.Marshal(objectMap) 74} 75 76// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 77func (asrs AvailabilitySetResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 78 return nil, false 79} 80 81// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 82func (asrs AvailabilitySetResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 83 return &asrs, true 84} 85 86// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 87func (asrs AvailabilitySetResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 88 return nil, false 89} 90 91// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 92func (asrs AvailabilitySetResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 93 return nil, false 94} 95 96// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 97func (asrs AvailabilitySetResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 98 return nil, false 99} 100 101// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 102func (asrs AvailabilitySetResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 103 return nil, false 104} 105 106// AsSQLServerResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 107func (asrs AvailabilitySetResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 108 return nil, false 109} 110 111// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 112func (asrs AvailabilitySetResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 113 return nil, false 114} 115 116// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 117func (asrs AvailabilitySetResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 118 return nil, false 119} 120 121// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 122func (asrs AvailabilitySetResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 123 return nil, false 124} 125 126// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 127func (asrs AvailabilitySetResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 128 return nil, false 129} 130 131// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 132func (asrs AvailabilitySetResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 133 return nil, false 134} 135 136// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 137func (asrs AvailabilitySetResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 138 return nil, false 139} 140 141// AsResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 142func (asrs AvailabilitySetResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 143 return nil, false 144} 145 146// AsBasicResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings. 147func (asrs AvailabilitySetResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 148 return &asrs, true 149} 150 151// AzureResourceReference defines reference to an Azure resource. 152type AzureResourceReference struct { 153 // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. 154 SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` 155} 156 157// BulkRemoveRequest defines the request body for bulk remove of move resources operation. 158type BulkRemoveRequest struct { 159 // ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite. 160 ValidateOnly *bool `json:"validateOnly,omitempty"` 161 // 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. 162 MoveResources *[]string `json:"moveResources,omitempty"` 163 // MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID' 164 MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"` 165} 166 167// CloudError an error response from the service. 168type CloudError struct { 169 // Error - Cloud error body. 170 Error *CloudErrorBody `json:"error,omitempty"` 171} 172 173// CloudErrorBody an error response from the service. 174type CloudErrorBody struct { 175 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 176 Code *string `json:"code,omitempty"` 177 // Message - A message describing the error, intended to be suitable for display in a user interface. 178 Message *string `json:"message,omitempty"` 179 // Target - The target of the particular error. For example, the name of the property in error. 180 Target *string `json:"target,omitempty"` 181 // Details - A list of additional details about the error. 182 Details *[]CloudErrorBody `json:"details,omitempty"` 183} 184 185// CommitRequest defines the request body for commit operation. 186type CommitRequest struct { 187 // ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite. 188 ValidateOnly *bool `json:"validateOnly,omitempty"` 189 // 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. 190 MoveResources *[]string `json:"moveResources,omitempty"` 191 // MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID' 192 MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"` 193} 194 195// DiscardRequest defines the request body for discard operation. 196type DiscardRequest struct { 197 // ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite. 198 ValidateOnly *bool `json:"validateOnly,omitempty"` 199 // 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. 200 MoveResources *[]string `json:"moveResources,omitempty"` 201 // MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID' 202 MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"` 203} 204 205// DiskEncryptionSetResourceSettings defines the disk encryption set resource settings. 206type DiskEncryptionSetResourceSettings struct { 207 // TargetResourceName - Gets or sets the target Resource name. 208 TargetResourceName *string `json:"targetResourceName,omitempty"` 209 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 210 ResourceType ResourceType `json:"resourceType,omitempty"` 211} 212 213// MarshalJSON is the custom marshaler for DiskEncryptionSetResourceSettings. 214func (desrs DiskEncryptionSetResourceSettings) MarshalJSON() ([]byte, error) { 215 desrs.ResourceType = ResourceTypeMicrosoftComputediskEncryptionSets 216 objectMap := make(map[string]interface{}) 217 if desrs.TargetResourceName != nil { 218 objectMap["targetResourceName"] = desrs.TargetResourceName 219 } 220 if desrs.ResourceType != "" { 221 objectMap["resourceType"] = desrs.ResourceType 222 } 223 return json.Marshal(objectMap) 224} 225 226// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 227func (desrs DiskEncryptionSetResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 228 return nil, false 229} 230 231// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 232func (desrs DiskEncryptionSetResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 233 return nil, false 234} 235 236// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 237func (desrs DiskEncryptionSetResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 238 return nil, false 239} 240 241// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 242func (desrs DiskEncryptionSetResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 243 return nil, false 244} 245 246// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 247func (desrs DiskEncryptionSetResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 248 return nil, false 249} 250 251// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 252func (desrs DiskEncryptionSetResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 253 return nil, false 254} 255 256// AsSQLServerResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 257func (desrs DiskEncryptionSetResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 258 return nil, false 259} 260 261// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 262func (desrs DiskEncryptionSetResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 263 return nil, false 264} 265 266// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 267func (desrs DiskEncryptionSetResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 268 return nil, false 269} 270 271// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 272func (desrs DiskEncryptionSetResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 273 return nil, false 274} 275 276// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 277func (desrs DiskEncryptionSetResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 278 return nil, false 279} 280 281// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 282func (desrs DiskEncryptionSetResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 283 return nil, false 284} 285 286// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 287func (desrs DiskEncryptionSetResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 288 return &desrs, true 289} 290 291// AsResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 292func (desrs DiskEncryptionSetResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 293 return nil, false 294} 295 296// AsBasicResourceSettings is the BasicResourceSettings implementation for DiskEncryptionSetResourceSettings. 297func (desrs DiskEncryptionSetResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 298 return &desrs, true 299} 300 301// Display contains the localized display information for this particular operation / action. These 302// value will be used by several clients for 303// (1) custom role definitions for RBAC; 304// (2) complex query filters for the event service; and 305// (3) audit history / records for management operations. 306type Display struct { 307 // Provider - Gets or sets the provider. 308 // The localized friendly form of the resource provider name – it is expected to also 309 // include the publisher/company responsible. 310 // It should use Title Casing and begin with "Microsoft" for 1st party services. 311 // e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". 312 Provider *string `json:"provider,omitempty"` 313 // Resource - Gets or sets the resource. 314 // The localized friendly form of the resource related to this action/operation – it 315 // should match the public documentation for the resource provider. 316 // It should use Title Casing. 317 // This value should be unique for a particular URL type (e.g. nested types should *not* 318 // reuse their parent’s display.resource field) 319 // e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" 320 // or "Scheduler Jobs". 321 Resource *string `json:"resource,omitempty"` 322 // Operation - Gets or sets the operation. 323 // The localized friendly name for the operation, as it should be shown to the user. 324 // It should be concise (to fit in drop downs) but clear (i.e. self-documenting). 325 // It should use Title Casing. 326 // Prescriptive guidance: Read Create or Update Delete 'ActionName'. 327 Operation *string `json:"operation,omitempty"` 328 // Description - Gets or sets the description. 329 // The localized friendly description for the operation, as it should be shown to the 330 // user. 331 // It should be thorough, yet concise – it will be used in tool tips and detailed views. 332 // Prescriptive guidance for namespace: 333 // Read any 'display.provider' resource 334 // Create or Update any 'display.provider' resource 335 // Delete any 'display.provider' resource 336 // Perform any other action on any 'display.provider' resource 337 // Prescriptive guidance for namespace: 338 // Read any 'display.resource' Create or Update any 'display.resource' Delete any 339 // 'display.resource' 'ActionName' any 'display.resources'. 340 Description *string `json:"description,omitempty"` 341} 342 343// Identity defines the MSI properties of the Move Collection. 344type Identity struct { 345 // Type - Possible values include: 'None', 'SystemAssigned', 'UserAssigned' 346 Type ResourceIdentityType `json:"type,omitempty"` 347 // PrincipalID - Gets or sets the principal id. 348 PrincipalID *string `json:"principalId,omitempty"` 349 // TenantID - Gets or sets the tenant id. 350 TenantID *string `json:"tenantId,omitempty"` 351} 352 353// JobStatus defines the job status. 354type JobStatus struct { 355 // JobName - Possible values include: 'InitialSync' 356 JobName JobName `json:"jobName,omitempty"` 357 // JobProgress - READ-ONLY; Gets or sets the monitoring job percentage. 358 JobProgress *string `json:"jobProgress,omitempty"` 359} 360 361// MarshalJSON is the custom marshaler for JobStatus. 362func (js JobStatus) MarshalJSON() ([]byte, error) { 363 objectMap := make(map[string]interface{}) 364 if js.JobName != "" { 365 objectMap["jobName"] = js.JobName 366 } 367 return json.Marshal(objectMap) 368} 369 370// KeyVaultResourceSettings defines the key vault resource settings. 371type KeyVaultResourceSettings struct { 372 // TargetResourceName - Gets or sets the target Resource name. 373 TargetResourceName *string `json:"targetResourceName,omitempty"` 374 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 375 ResourceType ResourceType `json:"resourceType,omitempty"` 376} 377 378// MarshalJSON is the custom marshaler for KeyVaultResourceSettings. 379func (kvrs KeyVaultResourceSettings) MarshalJSON() ([]byte, error) { 380 kvrs.ResourceType = ResourceTypeMicrosoftKeyVaultvaults 381 objectMap := make(map[string]interface{}) 382 if kvrs.TargetResourceName != nil { 383 objectMap["targetResourceName"] = kvrs.TargetResourceName 384 } 385 if kvrs.ResourceType != "" { 386 objectMap["resourceType"] = kvrs.ResourceType 387 } 388 return json.Marshal(objectMap) 389} 390 391// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 392func (kvrs KeyVaultResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 393 return nil, false 394} 395 396// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 397func (kvrs KeyVaultResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 398 return nil, false 399} 400 401// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 402func (kvrs KeyVaultResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 403 return nil, false 404} 405 406// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 407func (kvrs KeyVaultResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 408 return nil, false 409} 410 411// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 412func (kvrs KeyVaultResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 413 return nil, false 414} 415 416// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 417func (kvrs KeyVaultResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 418 return nil, false 419} 420 421// AsSQLServerResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 422func (kvrs KeyVaultResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 423 return nil, false 424} 425 426// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 427func (kvrs KeyVaultResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 428 return nil, false 429} 430 431// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 432func (kvrs KeyVaultResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 433 return nil, false 434} 435 436// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 437func (kvrs KeyVaultResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 438 return nil, false 439} 440 441// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 442func (kvrs KeyVaultResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 443 return nil, false 444} 445 446// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 447func (kvrs KeyVaultResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 448 return &kvrs, true 449} 450 451// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 452func (kvrs KeyVaultResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 453 return nil, false 454} 455 456// AsResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 457func (kvrs KeyVaultResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 458 return nil, false 459} 460 461// AsBasicResourceSettings is the BasicResourceSettings implementation for KeyVaultResourceSettings. 462func (kvrs KeyVaultResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 463 return &kvrs, true 464} 465 466// LBBackendAddressPoolResourceSettings defines load balancer backend address pool properties. 467type LBBackendAddressPoolResourceSettings struct { 468 // Name - Gets or sets the backend address pool name. 469 Name *string `json:"name,omitempty"` 470} 471 472// LBFrontendIPConfigurationResourceSettings defines load balancer frontend IP configuration properties. 473type LBFrontendIPConfigurationResourceSettings struct { 474 // Name - Gets or sets the frontend IP configuration name. 475 Name *string `json:"name,omitempty"` 476 // PrivateIPAddress - Gets or sets the IP address of the Load Balancer.This is only specified if a specific 477 // private IP address shall be allocated from the subnet specified in subnetRef. 478 PrivateIPAddress *string `json:"privateIpAddress,omitempty"` 479 // PrivateIPAllocationMethod - Gets or sets PrivateIP allocation method (Static/Dynamic). 480 PrivateIPAllocationMethod *string `json:"privateIpAllocationMethod,omitempty"` 481 Subnet *SubnetReference `json:"subnet,omitempty"` 482 // Zones - Gets or sets the csv list of zones. 483 Zones *string `json:"zones,omitempty"` 484} 485 486// LoadBalancerBackendAddressPoolReference defines reference to load balancer backend address pools. 487type LoadBalancerBackendAddressPoolReference struct { 488 // Name - Gets the name of the proxy resource on the target side. 489 Name *string `json:"name,omitempty"` 490 // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. 491 SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` 492} 493 494// LoadBalancerNatRuleReference defines reference to load balancer NAT rules. 495type LoadBalancerNatRuleReference struct { 496 // Name - Gets the name of the proxy resource on the target side. 497 Name *string `json:"name,omitempty"` 498 // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. 499 SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` 500} 501 502// LoadBalancerResourceSettings defines the load balancer resource settings. 503type LoadBalancerResourceSettings struct { 504 // Sku - Gets or sets load balancer sku (Basic/Standard). 505 Sku *string `json:"sku,omitempty"` 506 // FrontendIPConfigurations - Gets or sets the frontend IP configurations of the load balancer. 507 FrontendIPConfigurations *[]LBFrontendIPConfigurationResourceSettings `json:"frontendIPConfigurations,omitempty"` 508 // BackendAddressPools - Gets or sets the backend address pools of the load balancer. 509 BackendAddressPools *[]LBBackendAddressPoolResourceSettings `json:"backendAddressPools,omitempty"` 510 // Zones - Gets or sets the csv list of zones common for all frontend IP configurations. Note this is given 511 // precedence only if frontend IP configurations settings are not present. 512 Zones *string `json:"zones,omitempty"` 513 // TargetResourceName - Gets or sets the target Resource name. 514 TargetResourceName *string `json:"targetResourceName,omitempty"` 515 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 516 ResourceType ResourceType `json:"resourceType,omitempty"` 517} 518 519// MarshalJSON is the custom marshaler for LoadBalancerResourceSettings. 520func (lbrs LoadBalancerResourceSettings) MarshalJSON() ([]byte, error) { 521 lbrs.ResourceType = ResourceTypeMicrosoftNetworkloadBalancers 522 objectMap := make(map[string]interface{}) 523 if lbrs.Sku != nil { 524 objectMap["sku"] = lbrs.Sku 525 } 526 if lbrs.FrontendIPConfigurations != nil { 527 objectMap["frontendIPConfigurations"] = lbrs.FrontendIPConfigurations 528 } 529 if lbrs.BackendAddressPools != nil { 530 objectMap["backendAddressPools"] = lbrs.BackendAddressPools 531 } 532 if lbrs.Zones != nil { 533 objectMap["zones"] = lbrs.Zones 534 } 535 if lbrs.TargetResourceName != nil { 536 objectMap["targetResourceName"] = lbrs.TargetResourceName 537 } 538 if lbrs.ResourceType != "" { 539 objectMap["resourceType"] = lbrs.ResourceType 540 } 541 return json.Marshal(objectMap) 542} 543 544// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 545func (lbrs LoadBalancerResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 546 return nil, false 547} 548 549// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 550func (lbrs LoadBalancerResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 551 return nil, false 552} 553 554// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 555func (lbrs LoadBalancerResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 556 return nil, false 557} 558 559// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 560func (lbrs LoadBalancerResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 561 return nil, false 562} 563 564// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 565func (lbrs LoadBalancerResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 566 return nil, false 567} 568 569// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 570func (lbrs LoadBalancerResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 571 return &lbrs, true 572} 573 574// AsSQLServerResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 575func (lbrs LoadBalancerResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 576 return nil, false 577} 578 579// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 580func (lbrs LoadBalancerResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 581 return nil, false 582} 583 584// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 585func (lbrs LoadBalancerResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 586 return nil, false 587} 588 589// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 590func (lbrs LoadBalancerResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 591 return nil, false 592} 593 594// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 595func (lbrs LoadBalancerResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 596 return nil, false 597} 598 599// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 600func (lbrs LoadBalancerResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 601 return nil, false 602} 603 604// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 605func (lbrs LoadBalancerResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 606 return nil, false 607} 608 609// AsResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 610func (lbrs LoadBalancerResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 611 return nil, false 612} 613 614// AsBasicResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings. 615func (lbrs LoadBalancerResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 616 return &lbrs, true 617} 618 619// ManualResolutionProperties defines the properties for manual resolution. 620type ManualResolutionProperties struct { 621 // TargetID - Gets or sets the target resource ARM ID of the dependent resource if the resource type is Manual. 622 TargetID *string `json:"targetId,omitempty"` 623} 624 625// MoveCollection define the move collection. 626type MoveCollection struct { 627 autorest.Response `json:"-"` 628 // ID - READ-ONLY; Fully qualified resource Id for the resource. 629 ID *string `json:"id,omitempty"` 630 // Name - READ-ONLY; The name of the resource 631 Name *string `json:"name,omitempty"` 632 // Type - READ-ONLY; The type of the resource. 633 Type *string `json:"type,omitempty"` 634 // Etag - READ-ONLY; The etag of the resource. 635 Etag *string `json:"etag,omitempty"` 636 // Tags - Resource tags. 637 Tags map[string]*string `json:"tags"` 638 // Location - The geo-location where the resource lives. 639 Location *string `json:"location,omitempty"` 640 Identity *Identity `json:"identity,omitempty"` 641 Properties *MoveCollectionProperties `json:"properties,omitempty"` 642} 643 644// MarshalJSON is the custom marshaler for MoveCollection. 645func (mc MoveCollection) MarshalJSON() ([]byte, error) { 646 objectMap := make(map[string]interface{}) 647 if mc.Tags != nil { 648 objectMap["tags"] = mc.Tags 649 } 650 if mc.Location != nil { 651 objectMap["location"] = mc.Location 652 } 653 if mc.Identity != nil { 654 objectMap["identity"] = mc.Identity 655 } 656 if mc.Properties != nil { 657 objectMap["properties"] = mc.Properties 658 } 659 return json.Marshal(objectMap) 660} 661 662// MoveCollectionProperties defines the move collection properties. 663type MoveCollectionProperties struct { 664 // SourceRegion - Gets or sets the source region. 665 SourceRegion *string `json:"sourceRegion,omitempty"` 666 // TargetRegion - Gets or sets the target region. 667 TargetRegion *string `json:"targetRegion,omitempty"` 668 // ProvisioningState - Possible values include: 'Succeeded', 'Updating', 'Creating', 'Failed' 669 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 670 // Errors - READ-ONLY; Defines the move collection errors. 671 Errors *MoveCollectionPropertiesErrors `json:"errors,omitempty"` 672} 673 674// MarshalJSON is the custom marshaler for MoveCollectionProperties. 675func (mcp MoveCollectionProperties) MarshalJSON() ([]byte, error) { 676 objectMap := make(map[string]interface{}) 677 if mcp.SourceRegion != nil { 678 objectMap["sourceRegion"] = mcp.SourceRegion 679 } 680 if mcp.TargetRegion != nil { 681 objectMap["targetRegion"] = mcp.TargetRegion 682 } 683 if mcp.ProvisioningState != "" { 684 objectMap["provisioningState"] = mcp.ProvisioningState 685 } 686 return json.Marshal(objectMap) 687} 688 689// MoveCollectionPropertiesErrors defines the move collection errors. 690type MoveCollectionPropertiesErrors struct { 691 // Properties - The move resource error body. 692 Properties *MoveResourceErrorBody `json:"properties,omitempty"` 693} 694 695// MoveCollectionResultList defines the collection of move collections. 696type MoveCollectionResultList struct { 697 autorest.Response `json:"-"` 698 // Value - Gets the list of move collections. 699 Value *[]MoveCollection `json:"value,omitempty"` 700 // NextLink - Gets the value of next link. 701 NextLink *string `json:"nextLink,omitempty"` 702} 703 704// MoveCollectionResultListIterator provides access to a complete listing of MoveCollection values. 705type MoveCollectionResultListIterator struct { 706 i int 707 page MoveCollectionResultListPage 708} 709 710// NextWithContext advances to the next value. If there was an error making 711// the request the iterator does not advance and the error is returned. 712func (iter *MoveCollectionResultListIterator) NextWithContext(ctx context.Context) (err error) { 713 if tracing.IsEnabled() { 714 ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionResultListIterator.NextWithContext") 715 defer func() { 716 sc := -1 717 if iter.Response().Response.Response != nil { 718 sc = iter.Response().Response.Response.StatusCode 719 } 720 tracing.EndSpan(ctx, sc, err) 721 }() 722 } 723 iter.i++ 724 if iter.i < len(iter.page.Values()) { 725 return nil 726 } 727 err = iter.page.NextWithContext(ctx) 728 if err != nil { 729 iter.i-- 730 return err 731 } 732 iter.i = 0 733 return nil 734} 735 736// Next advances to the next value. If there was an error making 737// the request the iterator does not advance and the error is returned. 738// Deprecated: Use NextWithContext() instead. 739func (iter *MoveCollectionResultListIterator) Next() error { 740 return iter.NextWithContext(context.Background()) 741} 742 743// NotDone returns true if the enumeration should be started or is not yet complete. 744func (iter MoveCollectionResultListIterator) NotDone() bool { 745 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 746} 747 748// Response returns the raw server response from the last page request. 749func (iter MoveCollectionResultListIterator) Response() MoveCollectionResultList { 750 return iter.page.Response() 751} 752 753// Value returns the current value or a zero-initialized value if the 754// iterator has advanced beyond the end of the collection. 755func (iter MoveCollectionResultListIterator) Value() MoveCollection { 756 if !iter.page.NotDone() { 757 return MoveCollection{} 758 } 759 return iter.page.Values()[iter.i] 760} 761 762// Creates a new instance of the MoveCollectionResultListIterator type. 763func NewMoveCollectionResultListIterator(page MoveCollectionResultListPage) MoveCollectionResultListIterator { 764 return MoveCollectionResultListIterator{page: page} 765} 766 767// IsEmpty returns true if the ListResult contains no values. 768func (mcrl MoveCollectionResultList) IsEmpty() bool { 769 return mcrl.Value == nil || len(*mcrl.Value) == 0 770} 771 772// hasNextLink returns true if the NextLink is not empty. 773func (mcrl MoveCollectionResultList) hasNextLink() bool { 774 return mcrl.NextLink != nil && len(*mcrl.NextLink) != 0 775} 776 777// moveCollectionResultListPreparer prepares a request to retrieve the next set of results. 778// It returns nil if no more results exist. 779func (mcrl MoveCollectionResultList) moveCollectionResultListPreparer(ctx context.Context) (*http.Request, error) { 780 if !mcrl.hasNextLink() { 781 return nil, nil 782 } 783 return autorest.Prepare((&http.Request{}).WithContext(ctx), 784 autorest.AsJSON(), 785 autorest.AsGet(), 786 autorest.WithBaseURL(to.String(mcrl.NextLink))) 787} 788 789// MoveCollectionResultListPage contains a page of MoveCollection values. 790type MoveCollectionResultListPage struct { 791 fn func(context.Context, MoveCollectionResultList) (MoveCollectionResultList, error) 792 mcrl MoveCollectionResultList 793} 794 795// NextWithContext advances to the next page of values. If there was an error making 796// the request the page does not advance and the error is returned. 797func (page *MoveCollectionResultListPage) NextWithContext(ctx context.Context) (err error) { 798 if tracing.IsEnabled() { 799 ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionResultListPage.NextWithContext") 800 defer func() { 801 sc := -1 802 if page.Response().Response.Response != nil { 803 sc = page.Response().Response.Response.StatusCode 804 } 805 tracing.EndSpan(ctx, sc, err) 806 }() 807 } 808 for { 809 next, err := page.fn(ctx, page.mcrl) 810 if err != nil { 811 return err 812 } 813 page.mcrl = next 814 if !next.hasNextLink() || !next.IsEmpty() { 815 break 816 } 817 } 818 return nil 819} 820 821// Next advances to the next page of values. If there was an error making 822// the request the page does not advance and the error is returned. 823// Deprecated: Use NextWithContext() instead. 824func (page *MoveCollectionResultListPage) Next() error { 825 return page.NextWithContext(context.Background()) 826} 827 828// NotDone returns true if the page enumeration should be started or is not yet complete. 829func (page MoveCollectionResultListPage) NotDone() bool { 830 return !page.mcrl.IsEmpty() 831} 832 833// Response returns the raw server response from the last page request. 834func (page MoveCollectionResultListPage) Response() MoveCollectionResultList { 835 return page.mcrl 836} 837 838// Values returns the slice of values for the current page or nil if there are no values. 839func (page MoveCollectionResultListPage) Values() []MoveCollection { 840 if page.mcrl.IsEmpty() { 841 return nil 842 } 843 return *page.mcrl.Value 844} 845 846// Creates a new instance of the MoveCollectionResultListPage type. 847func NewMoveCollectionResultListPage(cur MoveCollectionResultList, getNextPage func(context.Context, MoveCollectionResultList) (MoveCollectionResultList, error)) MoveCollectionResultListPage { 848 return MoveCollectionResultListPage{ 849 fn: getNextPage, 850 mcrl: cur, 851 } 852} 853 854// MoveCollectionsBulkRemoveFuture an abstraction for monitoring and retrieving the results of a 855// long-running operation. 856type MoveCollectionsBulkRemoveFuture struct { 857 azure.FutureAPI 858 // Result returns the result of the asynchronous operation. 859 // If the operation has not completed it will return an error. 860 Result func(MoveCollectionsClient) (OperationStatus, error) 861} 862 863// UnmarshalJSON is the custom unmarshaller for CreateFuture. 864func (future *MoveCollectionsBulkRemoveFuture) UnmarshalJSON(body []byte) error { 865 var azFuture azure.Future 866 if err := json.Unmarshal(body, &azFuture); err != nil { 867 return err 868 } 869 future.FutureAPI = &azFuture 870 future.Result = future.result 871 return nil 872} 873 874// result is the default implementation for MoveCollectionsBulkRemoveFuture.Result. 875func (future *MoveCollectionsBulkRemoveFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) { 876 var done bool 877 done, err = future.DoneWithContext(context.Background(), client) 878 if err != nil { 879 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsBulkRemoveFuture", "Result", future.Response(), "Polling failure") 880 return 881 } 882 if !done { 883 osVar.Response.Response = future.Response() 884 err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsBulkRemoveFuture") 885 return 886 } 887 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 888 if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { 889 osVar, err = client.BulkRemoveResponder(osVar.Response.Response) 890 if err != nil { 891 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsBulkRemoveFuture", "Result", osVar.Response.Response, "Failure responding to request") 892 } 893 } 894 return 895} 896 897// MoveCollectionsCommitFuture an abstraction for monitoring and retrieving the results of a long-running 898// operation. 899type MoveCollectionsCommitFuture struct { 900 azure.FutureAPI 901 // Result returns the result of the asynchronous operation. 902 // If the operation has not completed it will return an error. 903 Result func(MoveCollectionsClient) (OperationStatus, error) 904} 905 906// UnmarshalJSON is the custom unmarshaller for CreateFuture. 907func (future *MoveCollectionsCommitFuture) UnmarshalJSON(body []byte) error { 908 var azFuture azure.Future 909 if err := json.Unmarshal(body, &azFuture); err != nil { 910 return err 911 } 912 future.FutureAPI = &azFuture 913 future.Result = future.result 914 return nil 915} 916 917// result is the default implementation for MoveCollectionsCommitFuture.Result. 918func (future *MoveCollectionsCommitFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) { 919 var done bool 920 done, err = future.DoneWithContext(context.Background(), client) 921 if err != nil { 922 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsCommitFuture", "Result", future.Response(), "Polling failure") 923 return 924 } 925 if !done { 926 osVar.Response.Response = future.Response() 927 err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsCommitFuture") 928 return 929 } 930 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 931 if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { 932 osVar, err = client.CommitResponder(osVar.Response.Response) 933 if err != nil { 934 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsCommitFuture", "Result", osVar.Response.Response, "Failure responding to request") 935 } 936 } 937 return 938} 939 940// MoveCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 941// operation. 942type MoveCollectionsDeleteFuture struct { 943 azure.FutureAPI 944 // Result returns the result of the asynchronous operation. 945 // If the operation has not completed it will return an error. 946 Result func(MoveCollectionsClient) (OperationStatus, error) 947} 948 949// UnmarshalJSON is the custom unmarshaller for CreateFuture. 950func (future *MoveCollectionsDeleteFuture) UnmarshalJSON(body []byte) error { 951 var azFuture azure.Future 952 if err := json.Unmarshal(body, &azFuture); err != nil { 953 return err 954 } 955 future.FutureAPI = &azFuture 956 future.Result = future.result 957 return nil 958} 959 960// result is the default implementation for MoveCollectionsDeleteFuture.Result. 961func (future *MoveCollectionsDeleteFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) { 962 var done bool 963 done, err = future.DoneWithContext(context.Background(), client) 964 if err != nil { 965 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") 966 return 967 } 968 if !done { 969 osVar.Response.Response = future.Response() 970 err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsDeleteFuture") 971 return 972 } 973 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 974 if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { 975 osVar, err = client.DeleteResponder(osVar.Response.Response) 976 if err != nil { 977 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsDeleteFuture", "Result", osVar.Response.Response, "Failure responding to request") 978 } 979 } 980 return 981} 982 983// MoveCollectionsDiscardFuture an abstraction for monitoring and retrieving the results of a long-running 984// operation. 985type MoveCollectionsDiscardFuture struct { 986 azure.FutureAPI 987 // Result returns the result of the asynchronous operation. 988 // If the operation has not completed it will return an error. 989 Result func(MoveCollectionsClient) (OperationStatus, error) 990} 991 992// UnmarshalJSON is the custom unmarshaller for CreateFuture. 993func (future *MoveCollectionsDiscardFuture) UnmarshalJSON(body []byte) error { 994 var azFuture azure.Future 995 if err := json.Unmarshal(body, &azFuture); err != nil { 996 return err 997 } 998 future.FutureAPI = &azFuture 999 future.Result = future.result 1000 return nil 1001} 1002 1003// result is the default implementation for MoveCollectionsDiscardFuture.Result. 1004func (future *MoveCollectionsDiscardFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) { 1005 var done bool 1006 done, err = future.DoneWithContext(context.Background(), client) 1007 if err != nil { 1008 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsDiscardFuture", "Result", future.Response(), "Polling failure") 1009 return 1010 } 1011 if !done { 1012 osVar.Response.Response = future.Response() 1013 err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsDiscardFuture") 1014 return 1015 } 1016 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1017 if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { 1018 osVar, err = client.DiscardResponder(osVar.Response.Response) 1019 if err != nil { 1020 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsDiscardFuture", "Result", osVar.Response.Response, "Failure responding to request") 1021 } 1022 } 1023 return 1024} 1025 1026// MoveCollectionsInitiateMoveFuture an abstraction for monitoring and retrieving the results of a 1027// long-running operation. 1028type MoveCollectionsInitiateMoveFuture struct { 1029 azure.FutureAPI 1030 // Result returns the result of the asynchronous operation. 1031 // If the operation has not completed it will return an error. 1032 Result func(MoveCollectionsClient) (OperationStatus, error) 1033} 1034 1035// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1036func (future *MoveCollectionsInitiateMoveFuture) UnmarshalJSON(body []byte) error { 1037 var azFuture azure.Future 1038 if err := json.Unmarshal(body, &azFuture); err != nil { 1039 return err 1040 } 1041 future.FutureAPI = &azFuture 1042 future.Result = future.result 1043 return nil 1044} 1045 1046// result is the default implementation for MoveCollectionsInitiateMoveFuture.Result. 1047func (future *MoveCollectionsInitiateMoveFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) { 1048 var done bool 1049 done, err = future.DoneWithContext(context.Background(), client) 1050 if err != nil { 1051 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsInitiateMoveFuture", "Result", future.Response(), "Polling failure") 1052 return 1053 } 1054 if !done { 1055 osVar.Response.Response = future.Response() 1056 err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsInitiateMoveFuture") 1057 return 1058 } 1059 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1060 if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { 1061 osVar, err = client.InitiateMoveResponder(osVar.Response.Response) 1062 if err != nil { 1063 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsInitiateMoveFuture", "Result", osVar.Response.Response, "Failure responding to request") 1064 } 1065 } 1066 return 1067} 1068 1069// MoveCollectionsPrepareFuture an abstraction for monitoring and retrieving the results of a long-running 1070// operation. 1071type MoveCollectionsPrepareFuture struct { 1072 azure.FutureAPI 1073 // Result returns the result of the asynchronous operation. 1074 // If the operation has not completed it will return an error. 1075 Result func(MoveCollectionsClient) (OperationStatus, error) 1076} 1077 1078// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1079func (future *MoveCollectionsPrepareFuture) UnmarshalJSON(body []byte) error { 1080 var azFuture azure.Future 1081 if err := json.Unmarshal(body, &azFuture); err != nil { 1082 return err 1083 } 1084 future.FutureAPI = &azFuture 1085 future.Result = future.result 1086 return nil 1087} 1088 1089// result is the default implementation for MoveCollectionsPrepareFuture.Result. 1090func (future *MoveCollectionsPrepareFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) { 1091 var done bool 1092 done, err = future.DoneWithContext(context.Background(), client) 1093 if err != nil { 1094 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsPrepareFuture", "Result", future.Response(), "Polling failure") 1095 return 1096 } 1097 if !done { 1098 osVar.Response.Response = future.Response() 1099 err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsPrepareFuture") 1100 return 1101 } 1102 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1103 if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { 1104 osVar, err = client.PrepareResponder(osVar.Response.Response) 1105 if err != nil { 1106 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsPrepareFuture", "Result", osVar.Response.Response, "Failure responding to request") 1107 } 1108 } 1109 return 1110} 1111 1112// MoveCollectionsResolveDependenciesFuture an abstraction for monitoring and retrieving the results of a 1113// long-running operation. 1114type MoveCollectionsResolveDependenciesFuture struct { 1115 azure.FutureAPI 1116 // Result returns the result of the asynchronous operation. 1117 // If the operation has not completed it will return an error. 1118 Result func(MoveCollectionsClient) (OperationStatus, error) 1119} 1120 1121// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1122func (future *MoveCollectionsResolveDependenciesFuture) UnmarshalJSON(body []byte) error { 1123 var azFuture azure.Future 1124 if err := json.Unmarshal(body, &azFuture); err != nil { 1125 return err 1126 } 1127 future.FutureAPI = &azFuture 1128 future.Result = future.result 1129 return nil 1130} 1131 1132// result is the default implementation for MoveCollectionsResolveDependenciesFuture.Result. 1133func (future *MoveCollectionsResolveDependenciesFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) { 1134 var done bool 1135 done, err = future.DoneWithContext(context.Background(), client) 1136 if err != nil { 1137 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsResolveDependenciesFuture", "Result", future.Response(), "Polling failure") 1138 return 1139 } 1140 if !done { 1141 osVar.Response.Response = future.Response() 1142 err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsResolveDependenciesFuture") 1143 return 1144 } 1145 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1146 if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { 1147 osVar, err = client.ResolveDependenciesResponder(osVar.Response.Response) 1148 if err != nil { 1149 err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsResolveDependenciesFuture", "Result", osVar.Response.Response, "Failure responding to request") 1150 } 1151 } 1152 return 1153} 1154 1155// MoveErrorInfo the move custom error info. 1156type MoveErrorInfo struct { 1157 // MoveResources - READ-ONLY; The affected move resources. 1158 MoveResources *[]AffectedMoveResource `json:"moveResources,omitempty"` 1159} 1160 1161// MarshalJSON is the custom marshaler for MoveErrorInfo. 1162func (mei MoveErrorInfo) MarshalJSON() ([]byte, error) { 1163 objectMap := make(map[string]interface{}) 1164 return json.Marshal(objectMap) 1165} 1166 1167// MoveResource defines the move resource. 1168type MoveResource struct { 1169 autorest.Response `json:"-"` 1170 // ID - READ-ONLY; Fully qualified resource Id for the resource. 1171 ID *string `json:"id,omitempty"` 1172 // Name - READ-ONLY; The name of the resource 1173 Name *string `json:"name,omitempty"` 1174 // Type - READ-ONLY; The type of the resource. 1175 Type *string `json:"type,omitempty"` 1176 Properties *MoveResourceProperties `json:"properties,omitempty"` 1177} 1178 1179// MarshalJSON is the custom marshaler for MoveResource. 1180func (mr MoveResource) MarshalJSON() ([]byte, error) { 1181 objectMap := make(map[string]interface{}) 1182 if mr.Properties != nil { 1183 objectMap["properties"] = mr.Properties 1184 } 1185 return json.Marshal(objectMap) 1186} 1187 1188// MoveResourceCollection defines the collection of move resources. 1189type MoveResourceCollection struct { 1190 autorest.Response `json:"-"` 1191 // Value - Gets the list of move resources. 1192 Value *[]MoveResource `json:"value,omitempty"` 1193 // NextLink - Gets the value of next link. 1194 NextLink *string `json:"nextLink,omitempty"` 1195 // SummaryCollection - Gets or sets the list of summary items and the field on which summary is done. 1196 SummaryCollection *SummaryCollection `json:"summaryCollection,omitempty"` 1197 // TotalCount - READ-ONLY; Gets the total count. 1198 TotalCount *int64 `json:"totalCount,omitempty"` 1199} 1200 1201// MarshalJSON is the custom marshaler for MoveResourceCollection. 1202func (mrc MoveResourceCollection) MarshalJSON() ([]byte, error) { 1203 objectMap := make(map[string]interface{}) 1204 if mrc.Value != nil { 1205 objectMap["value"] = mrc.Value 1206 } 1207 if mrc.NextLink != nil { 1208 objectMap["nextLink"] = mrc.NextLink 1209 } 1210 if mrc.SummaryCollection != nil { 1211 objectMap["summaryCollection"] = mrc.SummaryCollection 1212 } 1213 return json.Marshal(objectMap) 1214} 1215 1216// MoveResourceCollectionIterator provides access to a complete listing of MoveResource values. 1217type MoveResourceCollectionIterator struct { 1218 i int 1219 page MoveResourceCollectionPage 1220} 1221 1222// NextWithContext advances to the next value. If there was an error making 1223// the request the iterator does not advance and the error is returned. 1224func (iter *MoveResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1225 if tracing.IsEnabled() { 1226 ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourceCollectionIterator.NextWithContext") 1227 defer func() { 1228 sc := -1 1229 if iter.Response().Response.Response != nil { 1230 sc = iter.Response().Response.Response.StatusCode 1231 } 1232 tracing.EndSpan(ctx, sc, err) 1233 }() 1234 } 1235 iter.i++ 1236 if iter.i < len(iter.page.Values()) { 1237 return nil 1238 } 1239 err = iter.page.NextWithContext(ctx) 1240 if err != nil { 1241 iter.i-- 1242 return err 1243 } 1244 iter.i = 0 1245 return nil 1246} 1247 1248// Next advances to the next value. If there was an error making 1249// the request the iterator does not advance and the error is returned. 1250// Deprecated: Use NextWithContext() instead. 1251func (iter *MoveResourceCollectionIterator) Next() error { 1252 return iter.NextWithContext(context.Background()) 1253} 1254 1255// NotDone returns true if the enumeration should be started or is not yet complete. 1256func (iter MoveResourceCollectionIterator) NotDone() bool { 1257 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1258} 1259 1260// Response returns the raw server response from the last page request. 1261func (iter MoveResourceCollectionIterator) Response() MoveResourceCollection { 1262 return iter.page.Response() 1263} 1264 1265// Value returns the current value or a zero-initialized value if the 1266// iterator has advanced beyond the end of the collection. 1267func (iter MoveResourceCollectionIterator) Value() MoveResource { 1268 if !iter.page.NotDone() { 1269 return MoveResource{} 1270 } 1271 return iter.page.Values()[iter.i] 1272} 1273 1274// Creates a new instance of the MoveResourceCollectionIterator type. 1275func NewMoveResourceCollectionIterator(page MoveResourceCollectionPage) MoveResourceCollectionIterator { 1276 return MoveResourceCollectionIterator{page: page} 1277} 1278 1279// IsEmpty returns true if the ListResult contains no values. 1280func (mrc MoveResourceCollection) IsEmpty() bool { 1281 return mrc.Value == nil || len(*mrc.Value) == 0 1282} 1283 1284// hasNextLink returns true if the NextLink is not empty. 1285func (mrc MoveResourceCollection) hasNextLink() bool { 1286 return mrc.NextLink != nil && len(*mrc.NextLink) != 0 1287} 1288 1289// moveResourceCollectionPreparer prepares a request to retrieve the next set of results. 1290// It returns nil if no more results exist. 1291func (mrc MoveResourceCollection) moveResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 1292 if !mrc.hasNextLink() { 1293 return nil, nil 1294 } 1295 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1296 autorest.AsJSON(), 1297 autorest.AsGet(), 1298 autorest.WithBaseURL(to.String(mrc.NextLink))) 1299} 1300 1301// MoveResourceCollectionPage contains a page of MoveResource values. 1302type MoveResourceCollectionPage struct { 1303 fn func(context.Context, MoveResourceCollection) (MoveResourceCollection, error) 1304 mrc MoveResourceCollection 1305} 1306 1307// NextWithContext advances to the next page of values. If there was an error making 1308// the request the page does not advance and the error is returned. 1309func (page *MoveResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 1310 if tracing.IsEnabled() { 1311 ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourceCollectionPage.NextWithContext") 1312 defer func() { 1313 sc := -1 1314 if page.Response().Response.Response != nil { 1315 sc = page.Response().Response.Response.StatusCode 1316 } 1317 tracing.EndSpan(ctx, sc, err) 1318 }() 1319 } 1320 for { 1321 next, err := page.fn(ctx, page.mrc) 1322 if err != nil { 1323 return err 1324 } 1325 page.mrc = next 1326 if !next.hasNextLink() || !next.IsEmpty() { 1327 break 1328 } 1329 } 1330 return nil 1331} 1332 1333// Next advances to the next page of values. If there was an error making 1334// the request the page does not advance and the error is returned. 1335// Deprecated: Use NextWithContext() instead. 1336func (page *MoveResourceCollectionPage) Next() error { 1337 return page.NextWithContext(context.Background()) 1338} 1339 1340// NotDone returns true if the page enumeration should be started or is not yet complete. 1341func (page MoveResourceCollectionPage) NotDone() bool { 1342 return !page.mrc.IsEmpty() 1343} 1344 1345// Response returns the raw server response from the last page request. 1346func (page MoveResourceCollectionPage) Response() MoveResourceCollection { 1347 return page.mrc 1348} 1349 1350// Values returns the slice of values for the current page or nil if there are no values. 1351func (page MoveResourceCollectionPage) Values() []MoveResource { 1352 if page.mrc.IsEmpty() { 1353 return nil 1354 } 1355 return *page.mrc.Value 1356} 1357 1358// Creates a new instance of the MoveResourceCollectionPage type. 1359func NewMoveResourceCollectionPage(cur MoveResourceCollection, getNextPage func(context.Context, MoveResourceCollection) (MoveResourceCollection, error)) MoveResourceCollectionPage { 1360 return MoveResourceCollectionPage{ 1361 fn: getNextPage, 1362 mrc: cur, 1363 } 1364} 1365 1366// MoveResourceDependency defines the dependency of the move resource. 1367type MoveResourceDependency struct { 1368 // ID - Gets the source ARM ID of the dependent resource. 1369 ID *string `json:"id,omitempty"` 1370 // ResolutionStatus - Gets the dependency resolution status. 1371 ResolutionStatus *string `json:"resolutionStatus,omitempty"` 1372 // ResolutionType - Possible values include: 'Manual', 'Automatic' 1373 ResolutionType ResolutionType `json:"resolutionType,omitempty"` 1374 // DependencyType - Possible values include: 'RequiredForPrepare', 'RequiredForMove' 1375 DependencyType DependencyType `json:"dependencyType,omitempty"` 1376 ManualResolution *ManualResolutionProperties `json:"manualResolution,omitempty"` 1377 AutomaticResolution *AutomaticResolutionProperties `json:"automaticResolution,omitempty"` 1378 // IsOptional - Gets or sets a value indicating whether the dependency is optional. 1379 IsOptional *string `json:"isOptional,omitempty"` 1380} 1381 1382// MoveResourceDependencyOverride defines the dependency override of the move resource. 1383type MoveResourceDependencyOverride struct { 1384 // ID - Gets or sets the ARM ID of the dependent resource. 1385 ID *string `json:"id,omitempty"` 1386 // TargetID - Gets or sets the resource ARM id of either the MoveResource or the resource ARM ID of 1387 // the dependent resource. 1388 TargetID *string `json:"targetId,omitempty"` 1389} 1390 1391// MoveResourceError an error response from the azure resource mover service. 1392type MoveResourceError struct { 1393 // Properties - The move resource error body. 1394 Properties *MoveResourceErrorBody `json:"properties,omitempty"` 1395} 1396 1397// MoveResourceErrorBody an error response from the Azure Migrate service. 1398type MoveResourceErrorBody struct { 1399 // Code - READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 1400 Code *string `json:"code,omitempty"` 1401 // Message - READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. 1402 Message *string `json:"message,omitempty"` 1403 // Target - READ-ONLY; The target of the particular error. For example, the name of the property in error. 1404 Target *string `json:"target,omitempty"` 1405 // Details - READ-ONLY; A list of additional details about the error. 1406 Details *[]MoveResourceErrorBody `json:"details,omitempty"` 1407} 1408 1409// MarshalJSON is the custom marshaler for MoveResourceErrorBody. 1410func (mreb MoveResourceErrorBody) MarshalJSON() ([]byte, error) { 1411 objectMap := make(map[string]interface{}) 1412 return json.Marshal(objectMap) 1413} 1414 1415// MoveResourceFilter move resource filter. 1416type MoveResourceFilter struct { 1417 Properties *MoveResourceFilterProperties `json:"properties,omitempty"` 1418} 1419 1420// MoveResourceFilterProperties ... 1421type MoveResourceFilterProperties struct { 1422 // ProvisioningState - The provisioning state. 1423 ProvisioningState *string `json:"provisioningState,omitempty"` 1424} 1425 1426// MoveResourceProperties defines the move resource properties. 1427type MoveResourceProperties struct { 1428 // ProvisioningState - Possible values include: 'Succeeded', 'Updating', 'Creating', 'Failed' 1429 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1430 // SourceID - Gets or sets the Source ARM Id of the resource. 1431 SourceID *string `json:"sourceId,omitempty"` 1432 // TargetID - READ-ONLY; Gets or sets the Target ARM Id of the resource. 1433 TargetID *string `json:"targetId,omitempty"` 1434 // ExistingTargetID - Gets or sets the existing target ARM Id of the resource. 1435 ExistingTargetID *string `json:"existingTargetId,omitempty"` 1436 // ResourceSettings - Gets or sets the resource settings. 1437 ResourceSettings BasicResourceSettings `json:"resourceSettings,omitempty"` 1438 // SourceResourceSettings - READ-ONLY; Gets or sets the source resource settings. 1439 SourceResourceSettings BasicResourceSettings `json:"sourceResourceSettings,omitempty"` 1440 // MoveStatus - READ-ONLY; Defines the move resource status. 1441 MoveStatus *MoveResourcePropertiesMoveStatus `json:"moveStatus,omitempty"` 1442 // DependsOn - READ-ONLY; Gets or sets the move resource dependencies. 1443 DependsOn *[]MoveResourceDependency `json:"dependsOn,omitempty"` 1444 // DependsOnOverrides - Gets or sets the move resource dependencies overrides. 1445 DependsOnOverrides *[]MoveResourceDependencyOverride `json:"dependsOnOverrides,omitempty"` 1446 // IsResolveRequired - READ-ONLY; Gets a value indicating whether the resolve action is required over the move collection. 1447 IsResolveRequired *bool `json:"isResolveRequired,omitempty"` 1448 // Errors - READ-ONLY; Defines the move resource errors. 1449 Errors *MoveResourcePropertiesErrors `json:"errors,omitempty"` 1450} 1451 1452// MarshalJSON is the custom marshaler for MoveResourceProperties. 1453func (mrp MoveResourceProperties) MarshalJSON() ([]byte, error) { 1454 objectMap := make(map[string]interface{}) 1455 if mrp.ProvisioningState != "" { 1456 objectMap["provisioningState"] = mrp.ProvisioningState 1457 } 1458 if mrp.SourceID != nil { 1459 objectMap["sourceId"] = mrp.SourceID 1460 } 1461 if mrp.ExistingTargetID != nil { 1462 objectMap["existingTargetId"] = mrp.ExistingTargetID 1463 } 1464 objectMap["resourceSettings"] = mrp.ResourceSettings 1465 if mrp.DependsOnOverrides != nil { 1466 objectMap["dependsOnOverrides"] = mrp.DependsOnOverrides 1467 } 1468 return json.Marshal(objectMap) 1469} 1470 1471// UnmarshalJSON is the custom unmarshaler for MoveResourceProperties struct. 1472func (mrp *MoveResourceProperties) UnmarshalJSON(body []byte) error { 1473 var m map[string]*json.RawMessage 1474 err := json.Unmarshal(body, &m) 1475 if err != nil { 1476 return err 1477 } 1478 for k, v := range m { 1479 switch k { 1480 case "provisioningState": 1481 if v != nil { 1482 var provisioningState ProvisioningState 1483 err = json.Unmarshal(*v, &provisioningState) 1484 if err != nil { 1485 return err 1486 } 1487 mrp.ProvisioningState = provisioningState 1488 } 1489 case "sourceId": 1490 if v != nil { 1491 var sourceID string 1492 err = json.Unmarshal(*v, &sourceID) 1493 if err != nil { 1494 return err 1495 } 1496 mrp.SourceID = &sourceID 1497 } 1498 case "targetId": 1499 if v != nil { 1500 var targetID string 1501 err = json.Unmarshal(*v, &targetID) 1502 if err != nil { 1503 return err 1504 } 1505 mrp.TargetID = &targetID 1506 } 1507 case "existingTargetId": 1508 if v != nil { 1509 var existingTargetID string 1510 err = json.Unmarshal(*v, &existingTargetID) 1511 if err != nil { 1512 return err 1513 } 1514 mrp.ExistingTargetID = &existingTargetID 1515 } 1516 case "resourceSettings": 1517 if v != nil { 1518 resourceSettings, err := unmarshalBasicResourceSettings(*v) 1519 if err != nil { 1520 return err 1521 } 1522 mrp.ResourceSettings = resourceSettings 1523 } 1524 case "sourceResourceSettings": 1525 if v != nil { 1526 sourceResourceSettings, err := unmarshalBasicResourceSettings(*v) 1527 if err != nil { 1528 return err 1529 } 1530 mrp.SourceResourceSettings = sourceResourceSettings 1531 } 1532 case "moveStatus": 1533 if v != nil { 1534 var moveStatus MoveResourcePropertiesMoveStatus 1535 err = json.Unmarshal(*v, &moveStatus) 1536 if err != nil { 1537 return err 1538 } 1539 mrp.MoveStatus = &moveStatus 1540 } 1541 case "dependsOn": 1542 if v != nil { 1543 var dependsOn []MoveResourceDependency 1544 err = json.Unmarshal(*v, &dependsOn) 1545 if err != nil { 1546 return err 1547 } 1548 mrp.DependsOn = &dependsOn 1549 } 1550 case "dependsOnOverrides": 1551 if v != nil { 1552 var dependsOnOverrides []MoveResourceDependencyOverride 1553 err = json.Unmarshal(*v, &dependsOnOverrides) 1554 if err != nil { 1555 return err 1556 } 1557 mrp.DependsOnOverrides = &dependsOnOverrides 1558 } 1559 case "isResolveRequired": 1560 if v != nil { 1561 var isResolveRequired bool 1562 err = json.Unmarshal(*v, &isResolveRequired) 1563 if err != nil { 1564 return err 1565 } 1566 mrp.IsResolveRequired = &isResolveRequired 1567 } 1568 case "errors": 1569 if v != nil { 1570 var errorsVar MoveResourcePropertiesErrors 1571 err = json.Unmarshal(*v, &errorsVar) 1572 if err != nil { 1573 return err 1574 } 1575 mrp.Errors = &errorsVar 1576 } 1577 } 1578 } 1579 1580 return nil 1581} 1582 1583// MoveResourcePropertiesErrors defines the move resource errors. 1584type MoveResourcePropertiesErrors struct { 1585 // Properties - The move resource error body. 1586 Properties *MoveResourceErrorBody `json:"properties,omitempty"` 1587} 1588 1589// MoveResourcePropertiesMoveStatus defines the move resource status. 1590type MoveResourcePropertiesMoveStatus struct { 1591 // MoveState - Possible values include: 'AssignmentPending', 'PreparePending', 'PrepareInProgress', 'PrepareFailed', 'MovePending', 'MoveInProgress', 'MoveFailed', 'DiscardInProgress', 'DiscardFailed', 'CommitPending', 'CommitInProgress', 'CommitFailed', 'Committed', 'DeleteSourcePending', 'ResourceMoveCompleted' 1592 MoveState MoveState `json:"moveState,omitempty"` 1593 JobStatus *JobStatus `json:"jobStatus,omitempty"` 1594 Errors *MoveResourceError `json:"errors,omitempty"` 1595} 1596 1597// MoveResourcesCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1598// operation. 1599type MoveResourcesCreateFuture struct { 1600 azure.FutureAPI 1601 // Result returns the result of the asynchronous operation. 1602 // If the operation has not completed it will return an error. 1603 Result func(MoveResourcesClient) (MoveResource, error) 1604} 1605 1606// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1607func (future *MoveResourcesCreateFuture) UnmarshalJSON(body []byte) error { 1608 var azFuture azure.Future 1609 if err := json.Unmarshal(body, &azFuture); err != nil { 1610 return err 1611 } 1612 future.FutureAPI = &azFuture 1613 future.Result = future.result 1614 return nil 1615} 1616 1617// result is the default implementation for MoveResourcesCreateFuture.Result. 1618func (future *MoveResourcesCreateFuture) result(client MoveResourcesClient) (mr MoveResource, err error) { 1619 var done bool 1620 done, err = future.DoneWithContext(context.Background(), client) 1621 if err != nil { 1622 err = autorest.NewErrorWithError(err, "resourcemover.MoveResourcesCreateFuture", "Result", future.Response(), "Polling failure") 1623 return 1624 } 1625 if !done { 1626 mr.Response.Response = future.Response() 1627 err = azure.NewAsyncOpIncompleteError("resourcemover.MoveResourcesCreateFuture") 1628 return 1629 } 1630 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1631 if mr.Response.Response, err = future.GetResult(sender); err == nil && mr.Response.Response.StatusCode != http.StatusNoContent { 1632 mr, err = client.CreateResponder(mr.Response.Response) 1633 if err != nil { 1634 err = autorest.NewErrorWithError(err, "resourcemover.MoveResourcesCreateFuture", "Result", mr.Response.Response, "Failure responding to request") 1635 } 1636 } 1637 return 1638} 1639 1640// MoveResourcesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1641// operation. 1642type MoveResourcesDeleteFuture struct { 1643 azure.FutureAPI 1644 // Result returns the result of the asynchronous operation. 1645 // If the operation has not completed it will return an error. 1646 Result func(MoveResourcesClient) (OperationStatus, error) 1647} 1648 1649// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1650func (future *MoveResourcesDeleteFuture) UnmarshalJSON(body []byte) error { 1651 var azFuture azure.Future 1652 if err := json.Unmarshal(body, &azFuture); err != nil { 1653 return err 1654 } 1655 future.FutureAPI = &azFuture 1656 future.Result = future.result 1657 return nil 1658} 1659 1660// result is the default implementation for MoveResourcesDeleteFuture.Result. 1661func (future *MoveResourcesDeleteFuture) result(client MoveResourcesClient) (osVar OperationStatus, err error) { 1662 var done bool 1663 done, err = future.DoneWithContext(context.Background(), client) 1664 if err != nil { 1665 err = autorest.NewErrorWithError(err, "resourcemover.MoveResourcesDeleteFuture", "Result", future.Response(), "Polling failure") 1666 return 1667 } 1668 if !done { 1669 osVar.Response.Response = future.Response() 1670 err = azure.NewAsyncOpIncompleteError("resourcemover.MoveResourcesDeleteFuture") 1671 return 1672 } 1673 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1674 if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent { 1675 osVar, err = client.DeleteResponder(osVar.Response.Response) 1676 if err != nil { 1677 err = autorest.NewErrorWithError(err, "resourcemover.MoveResourcesDeleteFuture", "Result", osVar.Response.Response, "Failure responding to request") 1678 } 1679 } 1680 return 1681} 1682 1683// MoveResourceStatus defines the move resource status. 1684type MoveResourceStatus struct { 1685 // MoveState - Possible values include: 'AssignmentPending', 'PreparePending', 'PrepareInProgress', 'PrepareFailed', 'MovePending', 'MoveInProgress', 'MoveFailed', 'DiscardInProgress', 'DiscardFailed', 'CommitPending', 'CommitInProgress', 'CommitFailed', 'Committed', 'DeleteSourcePending', 'ResourceMoveCompleted' 1686 MoveState MoveState `json:"moveState,omitempty"` 1687 JobStatus *JobStatus `json:"jobStatus,omitempty"` 1688 Errors *MoveResourceError `json:"errors,omitempty"` 1689} 1690 1691// NetworkInterfaceResourceSettings defines the network interface resource settings. 1692type NetworkInterfaceResourceSettings struct { 1693 // IPConfigurations - Gets or sets the IP configurations of the NIC. 1694 IPConfigurations *[]NicIPConfigurationResourceSettings `json:"ipConfigurations,omitempty"` 1695 // EnableAcceleratedNetworking - Gets or sets a value indicating whether accelerated networking is enabled. 1696 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 1697 // TargetResourceName - Gets or sets the target Resource name. 1698 TargetResourceName *string `json:"targetResourceName,omitempty"` 1699 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 1700 ResourceType ResourceType `json:"resourceType,omitempty"` 1701} 1702 1703// MarshalJSON is the custom marshaler for NetworkInterfaceResourceSettings. 1704func (nirs NetworkInterfaceResourceSettings) MarshalJSON() ([]byte, error) { 1705 nirs.ResourceType = ResourceTypeMicrosoftNetworknetworkInterfaces 1706 objectMap := make(map[string]interface{}) 1707 if nirs.IPConfigurations != nil { 1708 objectMap["ipConfigurations"] = nirs.IPConfigurations 1709 } 1710 if nirs.EnableAcceleratedNetworking != nil { 1711 objectMap["enableAcceleratedNetworking"] = nirs.EnableAcceleratedNetworking 1712 } 1713 if nirs.TargetResourceName != nil { 1714 objectMap["targetResourceName"] = nirs.TargetResourceName 1715 } 1716 if nirs.ResourceType != "" { 1717 objectMap["resourceType"] = nirs.ResourceType 1718 } 1719 return json.Marshal(objectMap) 1720} 1721 1722// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1723func (nirs NetworkInterfaceResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 1724 return nil, false 1725} 1726 1727// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1728func (nirs NetworkInterfaceResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 1729 return nil, false 1730} 1731 1732// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1733func (nirs NetworkInterfaceResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 1734 return nil, false 1735} 1736 1737// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1738func (nirs NetworkInterfaceResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 1739 return &nirs, true 1740} 1741 1742// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1743func (nirs NetworkInterfaceResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 1744 return nil, false 1745} 1746 1747// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1748func (nirs NetworkInterfaceResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 1749 return nil, false 1750} 1751 1752// AsSQLServerResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1753func (nirs NetworkInterfaceResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 1754 return nil, false 1755} 1756 1757// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1758func (nirs NetworkInterfaceResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 1759 return nil, false 1760} 1761 1762// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1763func (nirs NetworkInterfaceResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 1764 return nil, false 1765} 1766 1767// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1768func (nirs NetworkInterfaceResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 1769 return nil, false 1770} 1771 1772// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1773func (nirs NetworkInterfaceResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 1774 return nil, false 1775} 1776 1777// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1778func (nirs NetworkInterfaceResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 1779 return nil, false 1780} 1781 1782// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1783func (nirs NetworkInterfaceResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 1784 return nil, false 1785} 1786 1787// AsResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1788func (nirs NetworkInterfaceResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 1789 return nil, false 1790} 1791 1792// AsBasicResourceSettings is the BasicResourceSettings implementation for NetworkInterfaceResourceSettings. 1793func (nirs NetworkInterfaceResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 1794 return &nirs, true 1795} 1796 1797// NetworkSecurityGroupResourceSettings defines the NSG resource settings. 1798type NetworkSecurityGroupResourceSettings struct { 1799 // SecurityRules - Gets or sets Security rules of network security group. 1800 SecurityRules *[]NsgSecurityRule `json:"securityRules,omitempty"` 1801 // TargetResourceName - Gets or sets the target Resource name. 1802 TargetResourceName *string `json:"targetResourceName,omitempty"` 1803 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 1804 ResourceType ResourceType `json:"resourceType,omitempty"` 1805} 1806 1807// MarshalJSON is the custom marshaler for NetworkSecurityGroupResourceSettings. 1808func (nsgrs NetworkSecurityGroupResourceSettings) MarshalJSON() ([]byte, error) { 1809 nsgrs.ResourceType = ResourceTypeMicrosoftNetworknetworkSecurityGroups 1810 objectMap := make(map[string]interface{}) 1811 if nsgrs.SecurityRules != nil { 1812 objectMap["securityRules"] = nsgrs.SecurityRules 1813 } 1814 if nsgrs.TargetResourceName != nil { 1815 objectMap["targetResourceName"] = nsgrs.TargetResourceName 1816 } 1817 if nsgrs.ResourceType != "" { 1818 objectMap["resourceType"] = nsgrs.ResourceType 1819 } 1820 return json.Marshal(objectMap) 1821} 1822 1823// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1824func (nsgrs NetworkSecurityGroupResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 1825 return nil, false 1826} 1827 1828// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1829func (nsgrs NetworkSecurityGroupResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 1830 return nil, false 1831} 1832 1833// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1834func (nsgrs NetworkSecurityGroupResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 1835 return nil, false 1836} 1837 1838// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1839func (nsgrs NetworkSecurityGroupResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 1840 return nil, false 1841} 1842 1843// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1844func (nsgrs NetworkSecurityGroupResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 1845 return &nsgrs, true 1846} 1847 1848// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1849func (nsgrs NetworkSecurityGroupResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 1850 return nil, false 1851} 1852 1853// AsSQLServerResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1854func (nsgrs NetworkSecurityGroupResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 1855 return nil, false 1856} 1857 1858// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1859func (nsgrs NetworkSecurityGroupResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 1860 return nil, false 1861} 1862 1863// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1864func (nsgrs NetworkSecurityGroupResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 1865 return nil, false 1866} 1867 1868// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1869func (nsgrs NetworkSecurityGroupResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 1870 return nil, false 1871} 1872 1873// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1874func (nsgrs NetworkSecurityGroupResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 1875 return nil, false 1876} 1877 1878// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1879func (nsgrs NetworkSecurityGroupResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 1880 return nil, false 1881} 1882 1883// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1884func (nsgrs NetworkSecurityGroupResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 1885 return nil, false 1886} 1887 1888// AsResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1889func (nsgrs NetworkSecurityGroupResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 1890 return nil, false 1891} 1892 1893// AsBasicResourceSettings is the BasicResourceSettings implementation for NetworkSecurityGroupResourceSettings. 1894func (nsgrs NetworkSecurityGroupResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 1895 return &nsgrs, true 1896} 1897 1898// NicIPConfigurationResourceSettings defines NIC IP configuration properties. 1899type NicIPConfigurationResourceSettings struct { 1900 // Name - Gets or sets the IP configuration name. 1901 Name *string `json:"name,omitempty"` 1902 // PrivateIPAddress - Gets or sets the private IP address of the network interface IP Configuration. 1903 PrivateIPAddress *string `json:"privateIpAddress,omitempty"` 1904 // PrivateIPAllocationMethod - Gets or sets the private IP address allocation method. 1905 PrivateIPAllocationMethod *string `json:"privateIpAllocationMethod,omitempty"` 1906 Subnet *SubnetReference `json:"subnet,omitempty"` 1907 // Primary - Gets or sets a value indicating whether this IP configuration is the primary. 1908 Primary *bool `json:"primary,omitempty"` 1909 // LoadBalancerBackendAddressPools - Gets or sets the references of the load balancer backend address pools. 1910 LoadBalancerBackendAddressPools *[]LoadBalancerBackendAddressPoolReference `json:"loadBalancerBackendAddressPools,omitempty"` 1911 // LoadBalancerNatRules - Gets or sets the references of the load balancer NAT rules. 1912 LoadBalancerNatRules *[]LoadBalancerNatRuleReference `json:"loadBalancerNatRules,omitempty"` 1913 PublicIP *PublicIPReference `json:"publicIp,omitempty"` 1914} 1915 1916// NsgReference defines reference to NSG. 1917type NsgReference struct { 1918 // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. 1919 SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` 1920} 1921 1922// NsgSecurityRule security Rule data model for Network Security Groups. 1923type NsgSecurityRule struct { 1924 // Name - Gets or sets the Security rule name. 1925 Name *string `json:"name,omitempty"` 1926 // Access - Gets or sets whether network traffic is allowed or denied. 1927 // Possible values are “Allow” and “Deny”. 1928 Access *string `json:"access,omitempty"` 1929 // Description - Gets or sets a description for this rule. Restricted to 140 chars. 1930 Description *string `json:"description,omitempty"` 1931 // DestinationAddressPrefix - Gets or sets destination address prefix. CIDR or source IP range. 1932 // A “*” can also be used to match all source IPs. Default tags such 1933 // as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. 1934 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` 1935 // DestinationPortRange - Gets or sets Destination Port or Range. Integer or range between 1936 // 0 and 65535. A “*” can also be used to match all ports. 1937 DestinationPortRange *string `json:"destinationPortRange,omitempty"` 1938 // Direction - Gets or sets the direction of the rule.InBound or Outbound. The 1939 // direction specifies if rule will be evaluated on incoming or outgoing traffic. 1940 Direction *string `json:"direction,omitempty"` 1941 // Priority - Gets or sets the priority of the rule. The value can be between 1942 // 100 and 4096. The priority number must be unique for each rule in the collection. 1943 // The lower the priority number, the higher the priority of the rule. 1944 Priority *int32 `json:"priority,omitempty"` 1945 // Protocol - Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*). 1946 Protocol *string `json:"protocol,omitempty"` 1947 // SourceAddressPrefix - Gets or sets source address prefix. CIDR or source IP range. A 1948 // “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, 1949 // ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress 1950 // rule, specifies where network traffic originates from. 1951 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` 1952 // SourcePortRange - Gets or sets Source Port or Range. Integer or range between 0 and 1953 // 65535. A “*” can also be used to match all ports. 1954 SourcePortRange *string `json:"sourcePortRange,omitempty"` 1955} 1956 1957// OperationErrorAdditionalInfo the operation error info. 1958type OperationErrorAdditionalInfo struct { 1959 // Type - READ-ONLY; The error type. 1960 Type *string `json:"type,omitempty"` 1961 // Info - READ-ONLY; The operation error info. 1962 Info *MoveErrorInfo `json:"info,omitempty"` 1963} 1964 1965// MarshalJSON is the custom marshaler for OperationErrorAdditionalInfo. 1966func (oeai OperationErrorAdditionalInfo) MarshalJSON() ([]byte, error) { 1967 objectMap := make(map[string]interface{}) 1968 return json.Marshal(objectMap) 1969} 1970 1971// OperationsDiscovery operations discovery class. 1972type OperationsDiscovery struct { 1973 // Name - Gets or sets Name of the API. 1974 // The name of the operation being performed on this particular object. It should 1975 // match the action name that appears in RBAC / the event service. 1976 // Examples of operations include: 1977 // * Microsoft.Compute/virtualMachine/capture/action 1978 // * Microsoft.Compute/virtualMachine/restart/action 1979 // * Microsoft.Compute/virtualMachine/write 1980 // * Microsoft.Compute/virtualMachine/read 1981 // * Microsoft.Compute/virtualMachine/delete 1982 // Each action should include, in order: 1983 // (1) Resource Provider Namespace 1984 // (2) Type hierarchy for which the action applies (e.g. server/databases for a SQL 1985 // Azure database) 1986 // (3) Read, Write, Action or Delete indicating which type applies. If it is a PUT/PATCH 1987 // on a collection or named value, Write should be used. 1988 // If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it 1989 // is a POST, Action should be used. 1990 // As a note: all resource providers would need to include the "{Resource Provider 1991 // Namespace}/register/action" operation in their response. 1992 // This API is used to register for their service, and should include details about the 1993 // operation (e.g. a localized name for the resource provider + any special 1994 // considerations like PII release). 1995 Name *string `json:"name,omitempty"` 1996 // IsDataAction - Indicates whether the operation is a data action 1997 IsDataAction *bool `json:"isDataAction,omitempty"` 1998 Display *Display `json:"display,omitempty"` 1999 // Origin - Gets or sets Origin. 2000 // The intended executor of the operation; governs the display of the operation in the 2001 // RBAC UX and the audit logs UX. 2002 // Default value is "user,system". 2003 Origin *string `json:"origin,omitempty"` 2004 Properties interface{} `json:"properties,omitempty"` 2005} 2006 2007// OperationsDiscoveryCollection collection of ClientDiscovery details. 2008type OperationsDiscoveryCollection struct { 2009 autorest.Response `json:"-"` 2010 // Value - Gets or sets the ClientDiscovery details. 2011 Value *[]OperationsDiscovery `json:"value,omitempty"` 2012 // NextLink - Gets or sets the value of next link. 2013 NextLink *string `json:"nextLink,omitempty"` 2014} 2015 2016// OperationStatus operation status REST resource. 2017type OperationStatus struct { 2018 autorest.Response `json:"-"` 2019 // ID - READ-ONLY; Resource Id. 2020 ID *string `json:"id,omitempty"` 2021 // Name - READ-ONLY; Operation name. 2022 Name *string `json:"name,omitempty"` 2023 // 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. 2024 Status *string `json:"status,omitempty"` 2025 // StartTime - READ-ONLY; Start time. 2026 StartTime *string `json:"startTime,omitempty"` 2027 // EndTime - READ-ONLY; End time. 2028 EndTime *string `json:"endTime,omitempty"` 2029 // Error - READ-ONLY; Error stating all error details for the operation. 2030 Error *OperationStatusError `json:"error,omitempty"` 2031 // Properties - READ-ONLY; Custom data. 2032 Properties interface{} `json:"properties,omitempty"` 2033} 2034 2035// MarshalJSON is the custom marshaler for OperationStatus. 2036func (osVar OperationStatus) MarshalJSON() ([]byte, error) { 2037 objectMap := make(map[string]interface{}) 2038 return json.Marshal(objectMap) 2039} 2040 2041// OperationStatusError class for operation status errors. 2042type OperationStatusError struct { 2043 // Code - READ-ONLY; The error code. 2044 Code *string `json:"code,omitempty"` 2045 // Message - READ-ONLY; The error message. 2046 Message *string `json:"message,omitempty"` 2047 // Details - READ-ONLY; The error details. 2048 Details *[]OperationStatusError `json:"details,omitempty"` 2049 // AdditionalInfo - READ-ONLY; The additional info. 2050 AdditionalInfo *[]OperationErrorAdditionalInfo `json:"additionalInfo,omitempty"` 2051} 2052 2053// MarshalJSON is the custom marshaler for OperationStatusError. 2054func (ose OperationStatusError) MarshalJSON() ([]byte, error) { 2055 objectMap := make(map[string]interface{}) 2056 return json.Marshal(objectMap) 2057} 2058 2059// PrepareRequest defines the request body for initiate prepare operation. 2060type PrepareRequest struct { 2061 // ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite. 2062 ValidateOnly *bool `json:"validateOnly,omitempty"` 2063 // 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. 2064 MoveResources *[]string `json:"moveResources,omitempty"` 2065 // MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID' 2066 MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"` 2067} 2068 2069// ProxyResourceReference defines reference to a proxy resource. 2070type ProxyResourceReference struct { 2071 // Name - Gets the name of the proxy resource on the target side. 2072 Name *string `json:"name,omitempty"` 2073 // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. 2074 SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` 2075} 2076 2077// PublicIPAddressResourceSettings defines the public IP address resource settings. 2078type PublicIPAddressResourceSettings struct { 2079 // DomainNameLabel - Gets or sets the domain name label. 2080 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 2081 // Fqdn - Gets or sets the fully qualified domain name. 2082 Fqdn *string `json:"fqdn,omitempty"` 2083 // PublicIPAllocationMethod - Gets or sets public IP allocation method. 2084 PublicIPAllocationMethod *string `json:"publicIpAllocationMethod,omitempty"` 2085 // Sku - Gets or sets public IP sku. 2086 Sku *string `json:"sku,omitempty"` 2087 // Zones - Gets or sets public IP zones. 2088 Zones *string `json:"zones,omitempty"` 2089 // TargetResourceName - Gets or sets the target Resource name. 2090 TargetResourceName *string `json:"targetResourceName,omitempty"` 2091 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 2092 ResourceType ResourceType `json:"resourceType,omitempty"` 2093} 2094 2095// MarshalJSON is the custom marshaler for PublicIPAddressResourceSettings. 2096func (piars PublicIPAddressResourceSettings) MarshalJSON() ([]byte, error) { 2097 piars.ResourceType = ResourceTypeMicrosoftNetworkpublicIPAddresses 2098 objectMap := make(map[string]interface{}) 2099 if piars.DomainNameLabel != nil { 2100 objectMap["domainNameLabel"] = piars.DomainNameLabel 2101 } 2102 if piars.Fqdn != nil { 2103 objectMap["fqdn"] = piars.Fqdn 2104 } 2105 if piars.PublicIPAllocationMethod != nil { 2106 objectMap["publicIpAllocationMethod"] = piars.PublicIPAllocationMethod 2107 } 2108 if piars.Sku != nil { 2109 objectMap["sku"] = piars.Sku 2110 } 2111 if piars.Zones != nil { 2112 objectMap["zones"] = piars.Zones 2113 } 2114 if piars.TargetResourceName != nil { 2115 objectMap["targetResourceName"] = piars.TargetResourceName 2116 } 2117 if piars.ResourceType != "" { 2118 objectMap["resourceType"] = piars.ResourceType 2119 } 2120 return json.Marshal(objectMap) 2121} 2122 2123// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2124func (piars PublicIPAddressResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 2125 return nil, false 2126} 2127 2128// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2129func (piars PublicIPAddressResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 2130 return nil, false 2131} 2132 2133// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2134func (piars PublicIPAddressResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 2135 return nil, false 2136} 2137 2138// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2139func (piars PublicIPAddressResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 2140 return nil, false 2141} 2142 2143// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2144func (piars PublicIPAddressResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 2145 return nil, false 2146} 2147 2148// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2149func (piars PublicIPAddressResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 2150 return nil, false 2151} 2152 2153// AsSQLServerResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2154func (piars PublicIPAddressResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 2155 return nil, false 2156} 2157 2158// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2159func (piars PublicIPAddressResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 2160 return nil, false 2161} 2162 2163// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2164func (piars PublicIPAddressResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 2165 return nil, false 2166} 2167 2168// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2169func (piars PublicIPAddressResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 2170 return nil, false 2171} 2172 2173// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2174func (piars PublicIPAddressResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 2175 return &piars, true 2176} 2177 2178// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2179func (piars PublicIPAddressResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 2180 return nil, false 2181} 2182 2183// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2184func (piars PublicIPAddressResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 2185 return nil, false 2186} 2187 2188// AsResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2189func (piars PublicIPAddressResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 2190 return nil, false 2191} 2192 2193// AsBasicResourceSettings is the BasicResourceSettings implementation for PublicIPAddressResourceSettings. 2194func (piars PublicIPAddressResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 2195 return &piars, true 2196} 2197 2198// PublicIPReference defines reference to a public IP. 2199type PublicIPReference struct { 2200 // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. 2201 SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` 2202} 2203 2204// RequiredForResourcesCollection required for resources collection. 2205type RequiredForResourcesCollection struct { 2206 autorest.Response `json:"-"` 2207 // SourceIds - Gets or sets the list of source Ids for which the input resource is required. 2208 SourceIds *[]string `json:"sourceIds,omitempty"` 2209} 2210 2211// ResourceGroupResourceSettings defines the resource group resource settings. 2212type ResourceGroupResourceSettings struct { 2213 // TargetResourceName - Gets or sets the target Resource name. 2214 TargetResourceName *string `json:"targetResourceName,omitempty"` 2215 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 2216 ResourceType ResourceType `json:"resourceType,omitempty"` 2217} 2218 2219// MarshalJSON is the custom marshaler for ResourceGroupResourceSettings. 2220func (rgrs ResourceGroupResourceSettings) MarshalJSON() ([]byte, error) { 2221 rgrs.ResourceType = ResourceTypeResourceGroups 2222 objectMap := make(map[string]interface{}) 2223 if rgrs.TargetResourceName != nil { 2224 objectMap["targetResourceName"] = rgrs.TargetResourceName 2225 } 2226 if rgrs.ResourceType != "" { 2227 objectMap["resourceType"] = rgrs.ResourceType 2228 } 2229 return json.Marshal(objectMap) 2230} 2231 2232// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2233func (rgrs ResourceGroupResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 2234 return nil, false 2235} 2236 2237// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2238func (rgrs ResourceGroupResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 2239 return nil, false 2240} 2241 2242// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2243func (rgrs ResourceGroupResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 2244 return nil, false 2245} 2246 2247// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2248func (rgrs ResourceGroupResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 2249 return nil, false 2250} 2251 2252// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2253func (rgrs ResourceGroupResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 2254 return nil, false 2255} 2256 2257// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2258func (rgrs ResourceGroupResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 2259 return nil, false 2260} 2261 2262// AsSQLServerResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2263func (rgrs ResourceGroupResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 2264 return nil, false 2265} 2266 2267// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2268func (rgrs ResourceGroupResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 2269 return nil, false 2270} 2271 2272// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2273func (rgrs ResourceGroupResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 2274 return nil, false 2275} 2276 2277// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2278func (rgrs ResourceGroupResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 2279 return &rgrs, true 2280} 2281 2282// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2283func (rgrs ResourceGroupResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 2284 return nil, false 2285} 2286 2287// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2288func (rgrs ResourceGroupResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 2289 return nil, false 2290} 2291 2292// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2293func (rgrs ResourceGroupResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 2294 return nil, false 2295} 2296 2297// AsResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2298func (rgrs ResourceGroupResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 2299 return nil, false 2300} 2301 2302// AsBasicResourceSettings is the BasicResourceSettings implementation for ResourceGroupResourceSettings. 2303func (rgrs ResourceGroupResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 2304 return &rgrs, true 2305} 2306 2307// ResourceMoveRequestType defines the request body for resource move operation. 2308type ResourceMoveRequestType struct { 2309 // ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite. 2310 ValidateOnly *bool `json:"validateOnly,omitempty"` 2311 // 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. 2312 MoveResources *[]string `json:"moveResources,omitempty"` 2313 // MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID' 2314 MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"` 2315} 2316 2317// BasicResourceSettings gets or sets the resource settings. 2318type BasicResourceSettings interface { 2319 AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) 2320 AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) 2321 AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) 2322 AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) 2323 AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) 2324 AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) 2325 AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) 2326 AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) 2327 AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) 2328 AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) 2329 AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) 2330 AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) 2331 AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) 2332 AsResourceSettings() (*ResourceSettings, bool) 2333} 2334 2335// ResourceSettings gets or sets the resource settings. 2336type ResourceSettings struct { 2337 // TargetResourceName - Gets or sets the target Resource name. 2338 TargetResourceName *string `json:"targetResourceName,omitempty"` 2339 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 2340 ResourceType ResourceType `json:"resourceType,omitempty"` 2341} 2342 2343func unmarshalBasicResourceSettings(body []byte) (BasicResourceSettings, error) { 2344 var m map[string]interface{} 2345 err := json.Unmarshal(body, &m) 2346 if err != nil { 2347 return nil, err 2348 } 2349 2350 switch m["resourceType"] { 2351 case string(ResourceTypeMicrosoftComputevirtualMachines): 2352 var vmrs VirtualMachineResourceSettings 2353 err := json.Unmarshal(body, &vmrs) 2354 return vmrs, err 2355 case string(ResourceTypeMicrosoftComputeavailabilitySets): 2356 var asrs AvailabilitySetResourceSettings 2357 err := json.Unmarshal(body, &asrs) 2358 return asrs, err 2359 case string(ResourceTypeMicrosoftNetworkvirtualNetworks): 2360 var vnrs VirtualNetworkResourceSettings 2361 err := json.Unmarshal(body, &vnrs) 2362 return vnrs, err 2363 case string(ResourceTypeMicrosoftNetworknetworkInterfaces): 2364 var nirs NetworkInterfaceResourceSettings 2365 err := json.Unmarshal(body, &nirs) 2366 return nirs, err 2367 case string(ResourceTypeMicrosoftNetworknetworkSecurityGroups): 2368 var nsgrs NetworkSecurityGroupResourceSettings 2369 err := json.Unmarshal(body, &nsgrs) 2370 return nsgrs, err 2371 case string(ResourceTypeMicrosoftNetworkloadBalancers): 2372 var lbrs LoadBalancerResourceSettings 2373 err := json.Unmarshal(body, &lbrs) 2374 return lbrs, err 2375 case string(ResourceTypeMicrosoftSqlservers): 2376 var ssrs SQLServerResourceSettings 2377 err := json.Unmarshal(body, &ssrs) 2378 return ssrs, err 2379 case string(ResourceTypeMicrosoftSqlserverselasticPools): 2380 var seprs SQLElasticPoolResourceSettings 2381 err := json.Unmarshal(body, &seprs) 2382 return seprs, err 2383 case string(ResourceTypeMicrosoftSqlserversdatabases): 2384 var sdrs SQLDatabaseResourceSettings 2385 err := json.Unmarshal(body, &sdrs) 2386 return sdrs, err 2387 case string(ResourceTypeResourceGroups): 2388 var rgrs ResourceGroupResourceSettings 2389 err := json.Unmarshal(body, &rgrs) 2390 return rgrs, err 2391 case string(ResourceTypeMicrosoftNetworkpublicIPAddresses): 2392 var piars PublicIPAddressResourceSettings 2393 err := json.Unmarshal(body, &piars) 2394 return piars, err 2395 case string(ResourceTypeMicrosoftKeyVaultvaults): 2396 var kvrs KeyVaultResourceSettings 2397 err := json.Unmarshal(body, &kvrs) 2398 return kvrs, err 2399 case string(ResourceTypeMicrosoftComputediskEncryptionSets): 2400 var desrs DiskEncryptionSetResourceSettings 2401 err := json.Unmarshal(body, &desrs) 2402 return desrs, err 2403 default: 2404 var rs ResourceSettings 2405 err := json.Unmarshal(body, &rs) 2406 return rs, err 2407 } 2408} 2409func unmarshalBasicResourceSettingsArray(body []byte) ([]BasicResourceSettings, error) { 2410 var rawMessages []*json.RawMessage 2411 err := json.Unmarshal(body, &rawMessages) 2412 if err != nil { 2413 return nil, err 2414 } 2415 2416 rsArray := make([]BasicResourceSettings, len(rawMessages)) 2417 2418 for index, rawMessage := range rawMessages { 2419 rs, err := unmarshalBasicResourceSettings(*rawMessage) 2420 if err != nil { 2421 return nil, err 2422 } 2423 rsArray[index] = rs 2424 } 2425 return rsArray, nil 2426} 2427 2428// MarshalJSON is the custom marshaler for ResourceSettings. 2429func (rs ResourceSettings) MarshalJSON() ([]byte, error) { 2430 rs.ResourceType = ResourceTypeResourceSettings 2431 objectMap := make(map[string]interface{}) 2432 if rs.TargetResourceName != nil { 2433 objectMap["targetResourceName"] = rs.TargetResourceName 2434 } 2435 if rs.ResourceType != "" { 2436 objectMap["resourceType"] = rs.ResourceType 2437 } 2438 return json.Marshal(objectMap) 2439} 2440 2441// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2442func (rs ResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 2443 return nil, false 2444} 2445 2446// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2447func (rs ResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 2448 return nil, false 2449} 2450 2451// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2452func (rs ResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 2453 return nil, false 2454} 2455 2456// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2457func (rs ResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 2458 return nil, false 2459} 2460 2461// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2462func (rs ResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 2463 return nil, false 2464} 2465 2466// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2467func (rs ResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 2468 return nil, false 2469} 2470 2471// AsSQLServerResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2472func (rs ResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 2473 return nil, false 2474} 2475 2476// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2477func (rs ResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 2478 return nil, false 2479} 2480 2481// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2482func (rs ResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 2483 return nil, false 2484} 2485 2486// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2487func (rs ResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 2488 return nil, false 2489} 2490 2491// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2492func (rs ResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 2493 return nil, false 2494} 2495 2496// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2497func (rs ResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 2498 return nil, false 2499} 2500 2501// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2502func (rs ResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 2503 return nil, false 2504} 2505 2506// AsResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2507func (rs ResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 2508 return &rs, true 2509} 2510 2511// AsBasicResourceSettings is the BasicResourceSettings implementation for ResourceSettings. 2512func (rs ResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 2513 return &rs, true 2514} 2515 2516// SQLDatabaseResourceSettings defines the Sql Database resource settings. 2517type SQLDatabaseResourceSettings struct { 2518 // ZoneRedundant - Possible values include: 'Enable', 'Disable' 2519 ZoneRedundant ZoneRedundant `json:"zoneRedundant,omitempty"` 2520 // TargetResourceName - Gets or sets the target Resource name. 2521 TargetResourceName *string `json:"targetResourceName,omitempty"` 2522 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 2523 ResourceType ResourceType `json:"resourceType,omitempty"` 2524} 2525 2526// MarshalJSON is the custom marshaler for SQLDatabaseResourceSettings. 2527func (sdrs SQLDatabaseResourceSettings) MarshalJSON() ([]byte, error) { 2528 sdrs.ResourceType = ResourceTypeMicrosoftSqlserversdatabases 2529 objectMap := make(map[string]interface{}) 2530 if sdrs.ZoneRedundant != "" { 2531 objectMap["zoneRedundant"] = sdrs.ZoneRedundant 2532 } 2533 if sdrs.TargetResourceName != nil { 2534 objectMap["targetResourceName"] = sdrs.TargetResourceName 2535 } 2536 if sdrs.ResourceType != "" { 2537 objectMap["resourceType"] = sdrs.ResourceType 2538 } 2539 return json.Marshal(objectMap) 2540} 2541 2542// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2543func (sdrs SQLDatabaseResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 2544 return nil, false 2545} 2546 2547// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2548func (sdrs SQLDatabaseResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 2549 return nil, false 2550} 2551 2552// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2553func (sdrs SQLDatabaseResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 2554 return nil, false 2555} 2556 2557// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2558func (sdrs SQLDatabaseResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 2559 return nil, false 2560} 2561 2562// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2563func (sdrs SQLDatabaseResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 2564 return nil, false 2565} 2566 2567// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2568func (sdrs SQLDatabaseResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 2569 return nil, false 2570} 2571 2572// AsSQLServerResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2573func (sdrs SQLDatabaseResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 2574 return nil, false 2575} 2576 2577// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2578func (sdrs SQLDatabaseResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 2579 return nil, false 2580} 2581 2582// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2583func (sdrs SQLDatabaseResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 2584 return &sdrs, true 2585} 2586 2587// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2588func (sdrs SQLDatabaseResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 2589 return nil, false 2590} 2591 2592// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2593func (sdrs SQLDatabaseResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 2594 return nil, false 2595} 2596 2597// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2598func (sdrs SQLDatabaseResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 2599 return nil, false 2600} 2601 2602// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2603func (sdrs SQLDatabaseResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 2604 return nil, false 2605} 2606 2607// AsResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2608func (sdrs SQLDatabaseResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 2609 return nil, false 2610} 2611 2612// AsBasicResourceSettings is the BasicResourceSettings implementation for SQLDatabaseResourceSettings. 2613func (sdrs SQLDatabaseResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 2614 return &sdrs, true 2615} 2616 2617// SQLElasticPoolResourceSettings defines the Sql ElasticPool resource settings. 2618type SQLElasticPoolResourceSettings struct { 2619 // ZoneRedundant - Possible values include: 'Enable', 'Disable' 2620 ZoneRedundant ZoneRedundant `json:"zoneRedundant,omitempty"` 2621 // TargetResourceName - Gets or sets the target Resource name. 2622 TargetResourceName *string `json:"targetResourceName,omitempty"` 2623 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 2624 ResourceType ResourceType `json:"resourceType,omitempty"` 2625} 2626 2627// MarshalJSON is the custom marshaler for SQLElasticPoolResourceSettings. 2628func (seprs SQLElasticPoolResourceSettings) MarshalJSON() ([]byte, error) { 2629 seprs.ResourceType = ResourceTypeMicrosoftSqlserverselasticPools 2630 objectMap := make(map[string]interface{}) 2631 if seprs.ZoneRedundant != "" { 2632 objectMap["zoneRedundant"] = seprs.ZoneRedundant 2633 } 2634 if seprs.TargetResourceName != nil { 2635 objectMap["targetResourceName"] = seprs.TargetResourceName 2636 } 2637 if seprs.ResourceType != "" { 2638 objectMap["resourceType"] = seprs.ResourceType 2639 } 2640 return json.Marshal(objectMap) 2641} 2642 2643// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2644func (seprs SQLElasticPoolResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 2645 return nil, false 2646} 2647 2648// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2649func (seprs SQLElasticPoolResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 2650 return nil, false 2651} 2652 2653// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2654func (seprs SQLElasticPoolResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 2655 return nil, false 2656} 2657 2658// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2659func (seprs SQLElasticPoolResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 2660 return nil, false 2661} 2662 2663// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2664func (seprs SQLElasticPoolResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 2665 return nil, false 2666} 2667 2668// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2669func (seprs SQLElasticPoolResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 2670 return nil, false 2671} 2672 2673// AsSQLServerResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2674func (seprs SQLElasticPoolResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 2675 return nil, false 2676} 2677 2678// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2679func (seprs SQLElasticPoolResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 2680 return &seprs, true 2681} 2682 2683// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2684func (seprs SQLElasticPoolResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 2685 return nil, false 2686} 2687 2688// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2689func (seprs SQLElasticPoolResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 2690 return nil, false 2691} 2692 2693// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2694func (seprs SQLElasticPoolResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 2695 return nil, false 2696} 2697 2698// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2699func (seprs SQLElasticPoolResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 2700 return nil, false 2701} 2702 2703// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2704func (seprs SQLElasticPoolResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 2705 return nil, false 2706} 2707 2708// AsResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2709func (seprs SQLElasticPoolResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 2710 return nil, false 2711} 2712 2713// AsBasicResourceSettings is the BasicResourceSettings implementation for SQLElasticPoolResourceSettings. 2714func (seprs SQLElasticPoolResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 2715 return &seprs, true 2716} 2717 2718// SQLServerResourceSettings defines the SQL Server resource settings. 2719type SQLServerResourceSettings struct { 2720 // TargetResourceName - Gets or sets the target Resource name. 2721 TargetResourceName *string `json:"targetResourceName,omitempty"` 2722 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 2723 ResourceType ResourceType `json:"resourceType,omitempty"` 2724} 2725 2726// MarshalJSON is the custom marshaler for SQLServerResourceSettings. 2727func (ssrs SQLServerResourceSettings) MarshalJSON() ([]byte, error) { 2728 ssrs.ResourceType = ResourceTypeMicrosoftSqlservers 2729 objectMap := make(map[string]interface{}) 2730 if ssrs.TargetResourceName != nil { 2731 objectMap["targetResourceName"] = ssrs.TargetResourceName 2732 } 2733 if ssrs.ResourceType != "" { 2734 objectMap["resourceType"] = ssrs.ResourceType 2735 } 2736 return json.Marshal(objectMap) 2737} 2738 2739// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2740func (ssrs SQLServerResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 2741 return nil, false 2742} 2743 2744// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2745func (ssrs SQLServerResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 2746 return nil, false 2747} 2748 2749// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2750func (ssrs SQLServerResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 2751 return nil, false 2752} 2753 2754// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2755func (ssrs SQLServerResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 2756 return nil, false 2757} 2758 2759// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2760func (ssrs SQLServerResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 2761 return nil, false 2762} 2763 2764// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2765func (ssrs SQLServerResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 2766 return nil, false 2767} 2768 2769// AsSQLServerResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2770func (ssrs SQLServerResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 2771 return &ssrs, true 2772} 2773 2774// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2775func (ssrs SQLServerResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 2776 return nil, false 2777} 2778 2779// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2780func (ssrs SQLServerResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 2781 return nil, false 2782} 2783 2784// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2785func (ssrs SQLServerResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 2786 return nil, false 2787} 2788 2789// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2790func (ssrs SQLServerResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 2791 return nil, false 2792} 2793 2794// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2795func (ssrs SQLServerResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 2796 return nil, false 2797} 2798 2799// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2800func (ssrs SQLServerResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 2801 return nil, false 2802} 2803 2804// AsResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2805func (ssrs SQLServerResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 2806 return nil, false 2807} 2808 2809// AsBasicResourceSettings is the BasicResourceSettings implementation for SQLServerResourceSettings. 2810func (ssrs SQLServerResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 2811 return &ssrs, true 2812} 2813 2814// SubnetReference defines reference to subnet. 2815type SubnetReference struct { 2816 // Name - Gets the name of the proxy resource on the target side. 2817 Name *string `json:"name,omitempty"` 2818 // SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced. 2819 SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"` 2820} 2821 2822// SubnetResourceSettings defines the virtual network subnets resource settings. 2823type SubnetResourceSettings struct { 2824 // Name - Gets or sets the Subnet name. 2825 Name *string `json:"name,omitempty"` 2826 // AddressPrefix - Gets or sets address prefix for the subnet. 2827 AddressPrefix *string `json:"addressPrefix,omitempty"` 2828 NetworkSecurityGroup *NsgReference `json:"networkSecurityGroup,omitempty"` 2829} 2830 2831// Summary summary item. 2832type Summary struct { 2833 // Count - Gets the count. 2834 Count *int32 `json:"count,omitempty"` 2835 // Item - Gets the item. 2836 Item *string `json:"item,omitempty"` 2837} 2838 2839// SummaryCollection summary Collection. 2840type SummaryCollection struct { 2841 // FieldName - Gets or sets the field name on which summary is done. 2842 FieldName *string `json:"fieldName,omitempty"` 2843 // Summary - Gets or sets the list of summary items. 2844 Summary *[]Summary `json:"summary,omitempty"` 2845} 2846 2847// UnresolvedDependenciesFilter unresolved dependencies contract. 2848type UnresolvedDependenciesFilter struct { 2849 Properties *UnresolvedDependenciesFilterProperties `json:"properties,omitempty"` 2850} 2851 2852// UnresolvedDependenciesFilterProperties ... 2853type UnresolvedDependenciesFilterProperties struct { 2854 // Count - The count of the resource. 2855 Count *int32 `json:"count,omitempty"` 2856} 2857 2858// UnresolvedDependency unresolved dependency. 2859type UnresolvedDependency struct { 2860 // Count - Gets or sets the count. 2861 Count *int32 `json:"count,omitempty"` 2862 // ID - Gets or sets the arm id of the dependency. 2863 ID *string `json:"id,omitempty"` 2864} 2865 2866// UnresolvedDependencyCollection unresolved dependency collection. 2867type UnresolvedDependencyCollection struct { 2868 autorest.Response `json:"-"` 2869 // Value - Gets or sets the list of unresolved dependencies. 2870 Value *[]UnresolvedDependency `json:"value,omitempty"` 2871 // NextLink - Gets or sets the value of next link. 2872 NextLink *string `json:"nextLink,omitempty"` 2873 // SummaryCollection - READ-ONLY; Gets or sets the list of summary items and the field on which summary is done. 2874 SummaryCollection *SummaryCollection `json:"summaryCollection,omitempty"` 2875 // TotalCount - READ-ONLY; Gets the total count. 2876 TotalCount *int64 `json:"totalCount,omitempty"` 2877} 2878 2879// MarshalJSON is the custom marshaler for UnresolvedDependencyCollection. 2880func (udc UnresolvedDependencyCollection) MarshalJSON() ([]byte, error) { 2881 objectMap := make(map[string]interface{}) 2882 if udc.Value != nil { 2883 objectMap["value"] = udc.Value 2884 } 2885 if udc.NextLink != nil { 2886 objectMap["nextLink"] = udc.NextLink 2887 } 2888 return json.Marshal(objectMap) 2889} 2890 2891// UnresolvedDependencyCollectionIterator provides access to a complete listing of UnresolvedDependency 2892// values. 2893type UnresolvedDependencyCollectionIterator struct { 2894 i int 2895 page UnresolvedDependencyCollectionPage 2896} 2897 2898// NextWithContext advances to the next value. If there was an error making 2899// the request the iterator does not advance and the error is returned. 2900func (iter *UnresolvedDependencyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2901 if tracing.IsEnabled() { 2902 ctx = tracing.StartSpan(ctx, fqdn+"/UnresolvedDependencyCollectionIterator.NextWithContext") 2903 defer func() { 2904 sc := -1 2905 if iter.Response().Response.Response != nil { 2906 sc = iter.Response().Response.Response.StatusCode 2907 } 2908 tracing.EndSpan(ctx, sc, err) 2909 }() 2910 } 2911 iter.i++ 2912 if iter.i < len(iter.page.Values()) { 2913 return nil 2914 } 2915 err = iter.page.NextWithContext(ctx) 2916 if err != nil { 2917 iter.i-- 2918 return err 2919 } 2920 iter.i = 0 2921 return nil 2922} 2923 2924// Next advances to the next value. If there was an error making 2925// the request the iterator does not advance and the error is returned. 2926// Deprecated: Use NextWithContext() instead. 2927func (iter *UnresolvedDependencyCollectionIterator) Next() error { 2928 return iter.NextWithContext(context.Background()) 2929} 2930 2931// NotDone returns true if the enumeration should be started or is not yet complete. 2932func (iter UnresolvedDependencyCollectionIterator) NotDone() bool { 2933 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2934} 2935 2936// Response returns the raw server response from the last page request. 2937func (iter UnresolvedDependencyCollectionIterator) Response() UnresolvedDependencyCollection { 2938 return iter.page.Response() 2939} 2940 2941// Value returns the current value or a zero-initialized value if the 2942// iterator has advanced beyond the end of the collection. 2943func (iter UnresolvedDependencyCollectionIterator) Value() UnresolvedDependency { 2944 if !iter.page.NotDone() { 2945 return UnresolvedDependency{} 2946 } 2947 return iter.page.Values()[iter.i] 2948} 2949 2950// Creates a new instance of the UnresolvedDependencyCollectionIterator type. 2951func NewUnresolvedDependencyCollectionIterator(page UnresolvedDependencyCollectionPage) UnresolvedDependencyCollectionIterator { 2952 return UnresolvedDependencyCollectionIterator{page: page} 2953} 2954 2955// IsEmpty returns true if the ListResult contains no values. 2956func (udc UnresolvedDependencyCollection) IsEmpty() bool { 2957 return udc.Value == nil || len(*udc.Value) == 0 2958} 2959 2960// hasNextLink returns true if the NextLink is not empty. 2961func (udc UnresolvedDependencyCollection) hasNextLink() bool { 2962 return udc.NextLink != nil && len(*udc.NextLink) != 0 2963} 2964 2965// unresolvedDependencyCollectionPreparer prepares a request to retrieve the next set of results. 2966// It returns nil if no more results exist. 2967func (udc UnresolvedDependencyCollection) unresolvedDependencyCollectionPreparer(ctx context.Context) (*http.Request, error) { 2968 if !udc.hasNextLink() { 2969 return nil, nil 2970 } 2971 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2972 autorest.AsJSON(), 2973 autorest.AsGet(), 2974 autorest.WithBaseURL(to.String(udc.NextLink))) 2975} 2976 2977// UnresolvedDependencyCollectionPage contains a page of UnresolvedDependency values. 2978type UnresolvedDependencyCollectionPage struct { 2979 fn func(context.Context, UnresolvedDependencyCollection) (UnresolvedDependencyCollection, error) 2980 udc UnresolvedDependencyCollection 2981} 2982 2983// NextWithContext advances to the next page of values. If there was an error making 2984// the request the page does not advance and the error is returned. 2985func (page *UnresolvedDependencyCollectionPage) NextWithContext(ctx context.Context) (err error) { 2986 if tracing.IsEnabled() { 2987 ctx = tracing.StartSpan(ctx, fqdn+"/UnresolvedDependencyCollectionPage.NextWithContext") 2988 defer func() { 2989 sc := -1 2990 if page.Response().Response.Response != nil { 2991 sc = page.Response().Response.Response.StatusCode 2992 } 2993 tracing.EndSpan(ctx, sc, err) 2994 }() 2995 } 2996 for { 2997 next, err := page.fn(ctx, page.udc) 2998 if err != nil { 2999 return err 3000 } 3001 page.udc = next 3002 if !next.hasNextLink() || !next.IsEmpty() { 3003 break 3004 } 3005 } 3006 return nil 3007} 3008 3009// Next advances to the next page of values. If there was an error making 3010// the request the page does not advance and the error is returned. 3011// Deprecated: Use NextWithContext() instead. 3012func (page *UnresolvedDependencyCollectionPage) Next() error { 3013 return page.NextWithContext(context.Background()) 3014} 3015 3016// NotDone returns true if the page enumeration should be started or is not yet complete. 3017func (page UnresolvedDependencyCollectionPage) NotDone() bool { 3018 return !page.udc.IsEmpty() 3019} 3020 3021// Response returns the raw server response from the last page request. 3022func (page UnresolvedDependencyCollectionPage) Response() UnresolvedDependencyCollection { 3023 return page.udc 3024} 3025 3026// Values returns the slice of values for the current page or nil if there are no values. 3027func (page UnresolvedDependencyCollectionPage) Values() []UnresolvedDependency { 3028 if page.udc.IsEmpty() { 3029 return nil 3030 } 3031 return *page.udc.Value 3032} 3033 3034// Creates a new instance of the UnresolvedDependencyCollectionPage type. 3035func NewUnresolvedDependencyCollectionPage(cur UnresolvedDependencyCollection, getNextPage func(context.Context, UnresolvedDependencyCollection) (UnresolvedDependencyCollection, error)) UnresolvedDependencyCollectionPage { 3036 return UnresolvedDependencyCollectionPage{ 3037 fn: getNextPage, 3038 udc: cur, 3039 } 3040} 3041 3042// UpdateMoveCollectionRequest defines the request body for updating move collection. 3043type UpdateMoveCollectionRequest struct { 3044 // Tags - Gets or sets the Resource tags. 3045 Tags map[string]*string `json:"tags"` 3046 Identity *Identity `json:"identity,omitempty"` 3047} 3048 3049// MarshalJSON is the custom marshaler for UpdateMoveCollectionRequest. 3050func (umcr UpdateMoveCollectionRequest) MarshalJSON() ([]byte, error) { 3051 objectMap := make(map[string]interface{}) 3052 if umcr.Tags != nil { 3053 objectMap["tags"] = umcr.Tags 3054 } 3055 if umcr.Identity != nil { 3056 objectMap["identity"] = umcr.Identity 3057 } 3058 return json.Marshal(objectMap) 3059} 3060 3061// VirtualMachineResourceSettings gets or sets the virtual machine resource settings. 3062type VirtualMachineResourceSettings struct { 3063 // TargetAvailabilityZone - Gets or sets the target availability zone. Possible values include: 'One', 'Two', 'Three', 'NA' 3064 TargetAvailabilityZone TargetAvailabilityZone `json:"targetAvailabilityZone,omitempty"` 3065 // TargetVMSize - Gets or sets the target virtual machine size. 3066 TargetVMSize *string `json:"targetVmSize,omitempty"` 3067 // TargetAvailabilitySetID - Gets or sets the target availability set id for virtual machines not in an availability set at source. 3068 TargetAvailabilitySetID *string `json:"targetAvailabilitySetId,omitempty"` 3069 // TargetResourceName - Gets or sets the target Resource name. 3070 TargetResourceName *string `json:"targetResourceName,omitempty"` 3071 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 3072 ResourceType ResourceType `json:"resourceType,omitempty"` 3073} 3074 3075// MarshalJSON is the custom marshaler for VirtualMachineResourceSettings. 3076func (vmrs VirtualMachineResourceSettings) MarshalJSON() ([]byte, error) { 3077 vmrs.ResourceType = ResourceTypeMicrosoftComputevirtualMachines 3078 objectMap := make(map[string]interface{}) 3079 if vmrs.TargetAvailabilityZone != "" { 3080 objectMap["targetAvailabilityZone"] = vmrs.TargetAvailabilityZone 3081 } 3082 if vmrs.TargetVMSize != nil { 3083 objectMap["targetVmSize"] = vmrs.TargetVMSize 3084 } 3085 if vmrs.TargetAvailabilitySetID != nil { 3086 objectMap["targetAvailabilitySetId"] = vmrs.TargetAvailabilitySetID 3087 } 3088 if vmrs.TargetResourceName != nil { 3089 objectMap["targetResourceName"] = vmrs.TargetResourceName 3090 } 3091 if vmrs.ResourceType != "" { 3092 objectMap["resourceType"] = vmrs.ResourceType 3093 } 3094 return json.Marshal(objectMap) 3095} 3096 3097// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3098func (vmrs VirtualMachineResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 3099 return &vmrs, true 3100} 3101 3102// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3103func (vmrs VirtualMachineResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 3104 return nil, false 3105} 3106 3107// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3108func (vmrs VirtualMachineResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 3109 return nil, false 3110} 3111 3112// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3113func (vmrs VirtualMachineResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 3114 return nil, false 3115} 3116 3117// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3118func (vmrs VirtualMachineResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 3119 return nil, false 3120} 3121 3122// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3123func (vmrs VirtualMachineResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 3124 return nil, false 3125} 3126 3127// AsSQLServerResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3128func (vmrs VirtualMachineResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 3129 return nil, false 3130} 3131 3132// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3133func (vmrs VirtualMachineResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 3134 return nil, false 3135} 3136 3137// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3138func (vmrs VirtualMachineResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 3139 return nil, false 3140} 3141 3142// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3143func (vmrs VirtualMachineResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 3144 return nil, false 3145} 3146 3147// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3148func (vmrs VirtualMachineResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 3149 return nil, false 3150} 3151 3152// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3153func (vmrs VirtualMachineResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 3154 return nil, false 3155} 3156 3157// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3158func (vmrs VirtualMachineResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 3159 return nil, false 3160} 3161 3162// AsResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3163func (vmrs VirtualMachineResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 3164 return nil, false 3165} 3166 3167// AsBasicResourceSettings is the BasicResourceSettings implementation for VirtualMachineResourceSettings. 3168func (vmrs VirtualMachineResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 3169 return &vmrs, true 3170} 3171 3172// VirtualNetworkResourceSettings defines the virtual network resource settings. 3173type VirtualNetworkResourceSettings struct { 3174 // EnableDdosProtection - Gets or sets a value indicating whether gets or sets whether the 3175 // DDOS protection should be switched on. 3176 EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` 3177 // AddressSpace - Gets or sets the address prefixes for the virtual network. 3178 AddressSpace *[]string `json:"addressSpace,omitempty"` 3179 // DNSServers - Gets or sets DHCPOptions that contains an array of DNS servers available to VMs 3180 // deployed in the virtual network. 3181 DNSServers *[]string `json:"dnsServers,omitempty"` 3182 // Subnets - Gets or sets List of subnets in a VirtualNetwork. 3183 Subnets *[]SubnetResourceSettings `json:"subnets,omitempty"` 3184 // TargetResourceName - Gets or sets the target Resource name. 3185 TargetResourceName *string `json:"targetResourceName,omitempty"` 3186 // ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses', 'ResourceTypeMicrosoftKeyVaultvaults', 'ResourceTypeMicrosoftComputediskEncryptionSets' 3187 ResourceType ResourceType `json:"resourceType,omitempty"` 3188} 3189 3190// MarshalJSON is the custom marshaler for VirtualNetworkResourceSettings. 3191func (vnrs VirtualNetworkResourceSettings) MarshalJSON() ([]byte, error) { 3192 vnrs.ResourceType = ResourceTypeMicrosoftNetworkvirtualNetworks 3193 objectMap := make(map[string]interface{}) 3194 if vnrs.EnableDdosProtection != nil { 3195 objectMap["enableDdosProtection"] = vnrs.EnableDdosProtection 3196 } 3197 if vnrs.AddressSpace != nil { 3198 objectMap["addressSpace"] = vnrs.AddressSpace 3199 } 3200 if vnrs.DNSServers != nil { 3201 objectMap["dnsServers"] = vnrs.DNSServers 3202 } 3203 if vnrs.Subnets != nil { 3204 objectMap["subnets"] = vnrs.Subnets 3205 } 3206 if vnrs.TargetResourceName != nil { 3207 objectMap["targetResourceName"] = vnrs.TargetResourceName 3208 } 3209 if vnrs.ResourceType != "" { 3210 objectMap["resourceType"] = vnrs.ResourceType 3211 } 3212 return json.Marshal(objectMap) 3213} 3214 3215// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3216func (vnrs VirtualNetworkResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) { 3217 return nil, false 3218} 3219 3220// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3221func (vnrs VirtualNetworkResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) { 3222 return nil, false 3223} 3224 3225// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3226func (vnrs VirtualNetworkResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) { 3227 return &vnrs, true 3228} 3229 3230// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3231func (vnrs VirtualNetworkResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) { 3232 return nil, false 3233} 3234 3235// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3236func (vnrs VirtualNetworkResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) { 3237 return nil, false 3238} 3239 3240// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3241func (vnrs VirtualNetworkResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) { 3242 return nil, false 3243} 3244 3245// AsSQLServerResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3246func (vnrs VirtualNetworkResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) { 3247 return nil, false 3248} 3249 3250// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3251func (vnrs VirtualNetworkResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) { 3252 return nil, false 3253} 3254 3255// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3256func (vnrs VirtualNetworkResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) { 3257 return nil, false 3258} 3259 3260// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3261func (vnrs VirtualNetworkResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) { 3262 return nil, false 3263} 3264 3265// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3266func (vnrs VirtualNetworkResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) { 3267 return nil, false 3268} 3269 3270// AsKeyVaultResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3271func (vnrs VirtualNetworkResourceSettings) AsKeyVaultResourceSettings() (*KeyVaultResourceSettings, bool) { 3272 return nil, false 3273} 3274 3275// AsDiskEncryptionSetResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3276func (vnrs VirtualNetworkResourceSettings) AsDiskEncryptionSetResourceSettings() (*DiskEncryptionSetResourceSettings, bool) { 3277 return nil, false 3278} 3279 3280// AsResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3281func (vnrs VirtualNetworkResourceSettings) AsResourceSettings() (*ResourceSettings, bool) { 3282 return nil, false 3283} 3284 3285// AsBasicResourceSettings is the BasicResourceSettings implementation for VirtualNetworkResourceSettings. 3286func (vnrs VirtualNetworkResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) { 3287 return &vnrs, true 3288} 3289