forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
2738 lines (2426 loc) · 123 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package resourcemover
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/resourcemover/mgmt/2019-10-01-preview/resourcemover"
// AffectedMoveResource the RP custom operation error info.
type AffectedMoveResource struct {
// ID - READ-ONLY; The affected move resource id.
ID *string `json:"id,omitempty"`
// SourceID - READ-ONLY; The affected move resource source id.
SourceID *string `json:"sourceId,omitempty"`
// MoveResources - READ-ONLY; The affected move resources.
MoveResources *[]AffectedMoveResource `json:"moveResources,omitempty"`
}
// MarshalJSON is the custom marshaler for AffectedMoveResource.
func (amr AffectedMoveResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// AutomaticResolutionProperties defines the properties for automatic resolution.
type AutomaticResolutionProperties struct {
// MoveResourceID - Gets the MoveResource ARM ID of
// the dependent resource if the resolution type is Automatic.
MoveResourceID *string `json:"moveResourceId,omitempty"`
}
// AvailabilitySetResourceSettings gets or sets the availability set resource settings.
type AvailabilitySetResourceSettings struct {
// FaultDomain - Gets or sets the target fault domain.
FaultDomain *int32 `json:"faultDomain,omitempty"`
// UpdateDomain - Gets or sets the target update domain.
UpdateDomain *int32 `json:"updateDomain,omitempty"`
// TargetResourceName - Gets or sets the target Resource name.
TargetResourceName *string `json:"targetResourceName,omitempty"`
// ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses'
ResourceType ResourceType `json:"resourceType,omitempty"`
}
// MarshalJSON is the custom marshaler for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) MarshalJSON() ([]byte, error) {
asrs.ResourceType = ResourceTypeMicrosoftComputeavailabilitySets
objectMap := make(map[string]interface{})
if asrs.FaultDomain != nil {
objectMap["faultDomain"] = asrs.FaultDomain
}
if asrs.UpdateDomain != nil {
objectMap["updateDomain"] = asrs.UpdateDomain
}
if asrs.TargetResourceName != nil {
objectMap["targetResourceName"] = asrs.TargetResourceName
}
if asrs.ResourceType != "" {
objectMap["resourceType"] = asrs.ResourceType
}
return json.Marshal(objectMap)
}
// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) {
return nil, false
}
// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) {
return &asrs, true
}
// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) {
return nil, false
}
// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) {
return nil, false
}
// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) {
return nil, false
}
// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) {
return nil, false
}
// AsSQLServerResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) {
return nil, false
}
// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) {
return nil, false
}
// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) {
return nil, false
}
// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) {
return nil, false
}
// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) {
return nil, false
}
// AsResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsResourceSettings() (*ResourceSettings, bool) {
return nil, false
}
// AsBasicResourceSettings is the BasicResourceSettings implementation for AvailabilitySetResourceSettings.
func (asrs AvailabilitySetResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) {
return &asrs, true
}
// AzureResourceReference defines reference to an Azure resource.
type AzureResourceReference struct {
// SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced.
SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"`
}
// BulkRemoveRequest defines the request body for bulk remove of move resources operation.
type BulkRemoveRequest struct {
// ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite.
ValidateOnly *bool `json:"validateOnly,omitempty"`
// MoveResources - Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property.
MoveResources *[]string `json:"moveResources,omitempty"`
// MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID'
MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"`
}
// CloudError an error response from the service.
type CloudError struct {
// Error - Cloud error body.
Error *CloudErrorBody `json:"error,omitempty"`
}
// CloudErrorBody an error response from the service.
type CloudErrorBody struct {
// Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
Code *string `json:"code,omitempty"`
// Message - A message describing the error, intended to be suitable for display in a user interface.
Message *string `json:"message,omitempty"`
// Target - The target of the particular error. For example, the name of the property in error.
Target *string `json:"target,omitempty"`
// Details - A list of additional details about the error.
Details *[]CloudErrorBody `json:"details,omitempty"`
}
// CommitRequest defines the request body for commit operation.
type CommitRequest struct {
// ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite.
ValidateOnly *bool `json:"validateOnly,omitempty"`
// MoveResources - Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property.
MoveResources *[]string `json:"moveResources,omitempty"`
// MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID'
MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"`
}
// DiscardRequest defines the request body for discard operation.
type DiscardRequest struct {
// ValidateOnly - Gets or sets a value indicating whether the operation needs to only run pre-requisite.
ValidateOnly *bool `json:"validateOnly,omitempty"`
// MoveResources - Gets or sets the list of resource Id's, by default it accepts move resource id's unless the input type is switched via moveResourceInputType property.
MoveResources *[]string `json:"moveResources,omitempty"`
// MoveResourceInputType - Possible values include: 'MoveResourceID', 'MoveResourceSourceID'
MoveResourceInputType MoveResourceInputType `json:"moveResourceInputType,omitempty"`
}
// Display contains the localized display information for this particular operation / action. These
// value will be used by several clients for
// (1) custom role definitions for RBAC;
// (2) complex query filters for the event service; and
// (3) audit history / records for management operations.
type Display struct {
// Provider - Gets or sets the provider.
// The localized friendly form of the resource provider name – it is expected to also
// include the publisher/company responsible.
// It should use Title Casing and begin with "Microsoft" for 1st party services.
// e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.".
Provider *string `json:"provider,omitempty"`
// Resource - Gets or sets the resource.
// The localized friendly form of the resource related to this action/operation – it
// should match the public documentation for the resource provider.
// It should use Title Casing.
// This value should be unique for a particular URL type (e.g. nested types should *not*
// reuse their parent’s display.resource field)
// e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes"
// or "Scheduler Jobs".
Resource *string `json:"resource,omitempty"`
// Operation - Gets or sets the operation.
// The localized friendly name for the operation, as it should be shown to the user.
// It should be concise (to fit in drop downs) but clear (i.e. self-documenting).
// It should use Title Casing.
// Prescriptive guidance: Read Create or Update Delete 'ActionName'.
Operation *string `json:"operation,omitempty"`
// Description - Gets or sets the description.
// The localized friendly description for the operation, as it should be shown to the
// user.
// It should be thorough, yet concise – it will be used in tool tips and detailed views.
// Prescriptive guidance for namespace:
// Read any 'display.provider' resource
// Create or Update any 'display.provider' resource
// Delete any 'display.provider' resource
// Perform any other action on any 'display.provider' resource
// Prescriptive guidance for namespace:
// Read any 'display.resource' Create or Update any 'display.resource' Delete any
// 'display.resource' 'ActionName' any 'display.resources'.
Description *string `json:"description,omitempty"`
}
// Identity defines the MSI properties of the Move Collection.
type Identity struct {
// Type - Possible values include: 'None', 'SystemAssigned', 'UserAssigned'
Type ResourceIdentityType `json:"type,omitempty"`
// PrincipalID - Gets or sets the principal id.
PrincipalID *string `json:"principalId,omitempty"`
// TenantID - Gets or sets the tenant id.
TenantID *string `json:"tenantId,omitempty"`
}
// JobStatus defines the job status.
type JobStatus struct {
// JobName - Possible values include: 'InitialSync'
JobName JobName `json:"jobName,omitempty"`
// JobProgress - READ-ONLY; Gets or sets the monitoring job percentage.
JobProgress *string `json:"jobProgress,omitempty"`
}
// MarshalJSON is the custom marshaler for JobStatus.
func (js JobStatus) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if js.JobName != "" {
objectMap["jobName"] = js.JobName
}
return json.Marshal(objectMap)
}
// LBBackendAddressPoolResourceSettings defines load balancer backend address pool properties.
type LBBackendAddressPoolResourceSettings struct {
// Name - Gets or sets the backend address pool name.
Name *string `json:"name,omitempty"`
}
// LBFrontendIPConfigurationResourceSettings defines load balancer frontend IP configuration properties.
type LBFrontendIPConfigurationResourceSettings struct {
// Name - Gets or sets the frontend IP configuration name.
Name *string `json:"name,omitempty"`
// PrivateIPAddress - Gets or sets the IP address of the Load Balancer.This is only specified if a specific
// private IP address shall be allocated from the subnet specified in subnetRef.
PrivateIPAddress *string `json:"privateIpAddress,omitempty"`
// PrivateIPAllocationMethod - Gets or sets PrivateIP allocation method (Static/Dynamic).
PrivateIPAllocationMethod *string `json:"privateIpAllocationMethod,omitempty"`
Subnet *SubnetReference `json:"subnet,omitempty"`
// Zones - Gets or sets the csv list of zones.
Zones *string `json:"zones,omitempty"`
}
// LoadBalancerBackendAddressPoolReference defines reference to load balancer backend address pools.
type LoadBalancerBackendAddressPoolReference struct {
// Name - Gets the name of the proxy resource on the target side.
Name *string `json:"name,omitempty"`
// SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced.
SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"`
}
// LoadBalancerNatRuleReference defines reference to load balancer NAT rules.
type LoadBalancerNatRuleReference struct {
// Name - Gets the name of the proxy resource on the target side.
Name *string `json:"name,omitempty"`
// SourceArmResourceID - Gets the ARM resource ID of the tracked resource being referenced.
SourceArmResourceID *string `json:"sourceArmResourceId,omitempty"`
}
// LoadBalancerResourceSettings defines the load balancer resource settings.
type LoadBalancerResourceSettings struct {
// Sku - Gets or sets load balancer sku (Basic/Standard).
Sku *string `json:"sku,omitempty"`
// FrontendIPConfigurations - Gets or sets the frontend IP configurations of the load balancer.
FrontendIPConfigurations *[]LBFrontendIPConfigurationResourceSettings `json:"frontendIPConfigurations,omitempty"`
// BackendAddressPools - Gets or sets the backend address pools of the load balancer.
BackendAddressPools *[]LBBackendAddressPoolResourceSettings `json:"backendAddressPools,omitempty"`
// Zones - Gets or sets the csv list of zones common for all frontend IP configurations. Note this is given
// precedence only if frontend IP configurations settings are not present.
Zones *string `json:"zones,omitempty"`
// TargetResourceName - Gets or sets the target Resource name.
TargetResourceName *string `json:"targetResourceName,omitempty"`
// ResourceType - Possible values include: 'ResourceTypeResourceSettings', 'ResourceTypeMicrosoftComputevirtualMachines', 'ResourceTypeMicrosoftComputeavailabilitySets', 'ResourceTypeMicrosoftNetworkvirtualNetworks', 'ResourceTypeMicrosoftNetworknetworkInterfaces', 'ResourceTypeMicrosoftNetworknetworkSecurityGroups', 'ResourceTypeMicrosoftNetworkloadBalancers', 'ResourceTypeMicrosoftSqlservers', 'ResourceTypeMicrosoftSqlserverselasticPools', 'ResourceTypeMicrosoftSqlserversdatabases', 'ResourceTypeResourceGroups', 'ResourceTypeMicrosoftNetworkpublicIPAddresses'
ResourceType ResourceType `json:"resourceType,omitempty"`
}
// MarshalJSON is the custom marshaler for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) MarshalJSON() ([]byte, error) {
lbrs.ResourceType = ResourceTypeMicrosoftNetworkloadBalancers
objectMap := make(map[string]interface{})
if lbrs.Sku != nil {
objectMap["sku"] = lbrs.Sku
}
if lbrs.FrontendIPConfigurations != nil {
objectMap["frontendIPConfigurations"] = lbrs.FrontendIPConfigurations
}
if lbrs.BackendAddressPools != nil {
objectMap["backendAddressPools"] = lbrs.BackendAddressPools
}
if lbrs.Zones != nil {
objectMap["zones"] = lbrs.Zones
}
if lbrs.TargetResourceName != nil {
objectMap["targetResourceName"] = lbrs.TargetResourceName
}
if lbrs.ResourceType != "" {
objectMap["resourceType"] = lbrs.ResourceType
}
return json.Marshal(objectMap)
}
// AsVirtualMachineResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsVirtualMachineResourceSettings() (*VirtualMachineResourceSettings, bool) {
return nil, false
}
// AsAvailabilitySetResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsAvailabilitySetResourceSettings() (*AvailabilitySetResourceSettings, bool) {
return nil, false
}
// AsVirtualNetworkResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsVirtualNetworkResourceSettings() (*VirtualNetworkResourceSettings, bool) {
return nil, false
}
// AsNetworkInterfaceResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsNetworkInterfaceResourceSettings() (*NetworkInterfaceResourceSettings, bool) {
return nil, false
}
// AsNetworkSecurityGroupResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsNetworkSecurityGroupResourceSettings() (*NetworkSecurityGroupResourceSettings, bool) {
return nil, false
}
// AsLoadBalancerResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsLoadBalancerResourceSettings() (*LoadBalancerResourceSettings, bool) {
return &lbrs, true
}
// AsSQLServerResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsSQLServerResourceSettings() (*SQLServerResourceSettings, bool) {
return nil, false
}
// AsSQLElasticPoolResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsSQLElasticPoolResourceSettings() (*SQLElasticPoolResourceSettings, bool) {
return nil, false
}
// AsSQLDatabaseResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsSQLDatabaseResourceSettings() (*SQLDatabaseResourceSettings, bool) {
return nil, false
}
// AsResourceGroupResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsResourceGroupResourceSettings() (*ResourceGroupResourceSettings, bool) {
return nil, false
}
// AsPublicIPAddressResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsPublicIPAddressResourceSettings() (*PublicIPAddressResourceSettings, bool) {
return nil, false
}
// AsResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsResourceSettings() (*ResourceSettings, bool) {
return nil, false
}
// AsBasicResourceSettings is the BasicResourceSettings implementation for LoadBalancerResourceSettings.
func (lbrs LoadBalancerResourceSettings) AsBasicResourceSettings() (BasicResourceSettings, bool) {
return &lbrs, true
}
// ManualResolutionProperties defines the properties for manual resolution.
type ManualResolutionProperties struct {
// TargetID - Gets or sets the target resource ARM ID of the dependent resource if the resource type is Manual.
TargetID *string `json:"targetId,omitempty"`
}
// MoveCollection define the move collection.
type MoveCollection struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; Fully qualified resource Id for the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// Location - The geo-location where the resource lives.
Location *string `json:"location,omitempty"`
Identity *Identity `json:"identity,omitempty"`
Properties *MoveCollectionProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for MoveCollection.
func (mc MoveCollection) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if mc.Tags != nil {
objectMap["tags"] = mc.Tags
}
if mc.Location != nil {
objectMap["location"] = mc.Location
}
if mc.Identity != nil {
objectMap["identity"] = mc.Identity
}
if mc.Properties != nil {
objectMap["properties"] = mc.Properties
}
return json.Marshal(objectMap)
}
// MoveCollectionProperties defines the move collection properties.
type MoveCollectionProperties struct {
// SourceRegion - Gets or sets the source region.
SourceRegion *string `json:"sourceRegion,omitempty"`
// TargetRegion - Gets or sets the target region.
TargetRegion *string `json:"targetRegion,omitempty"`
// ProvisioningState - Possible values include: 'Succeeded', 'Updating', 'Creating', 'Failed'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
}
// MoveCollectionResultList defines the collection of move collections.
type MoveCollectionResultList struct {
autorest.Response `json:"-"`
// Value - Gets the list of move collections.
Value *[]MoveCollection `json:"value,omitempty"`
// NextLink - Gets the value of next link.
NextLink *string `json:"nextLink,omitempty"`
}
// MoveCollectionResultListIterator provides access to a complete listing of MoveCollection values.
type MoveCollectionResultListIterator struct {
i int
page MoveCollectionResultListPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *MoveCollectionResultListIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionResultListIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *MoveCollectionResultListIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter MoveCollectionResultListIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter MoveCollectionResultListIterator) Response() MoveCollectionResultList {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter MoveCollectionResultListIterator) Value() MoveCollection {
if !iter.page.NotDone() {
return MoveCollection{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the MoveCollectionResultListIterator type.
func NewMoveCollectionResultListIterator(page MoveCollectionResultListPage) MoveCollectionResultListIterator {
return MoveCollectionResultListIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (mcrl MoveCollectionResultList) IsEmpty() bool {
return mcrl.Value == nil || len(*mcrl.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (mcrl MoveCollectionResultList) hasNextLink() bool {
return mcrl.NextLink != nil && len(*mcrl.NextLink) != 0
}
// moveCollectionResultListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (mcrl MoveCollectionResultList) moveCollectionResultListPreparer(ctx context.Context) (*http.Request, error) {
if !mcrl.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(mcrl.NextLink)))
}
// MoveCollectionResultListPage contains a page of MoveCollection values.
type MoveCollectionResultListPage struct {
fn func(context.Context, MoveCollectionResultList) (MoveCollectionResultList, error)
mcrl MoveCollectionResultList
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *MoveCollectionResultListPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/MoveCollectionResultListPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.mcrl)
if err != nil {
return err
}
page.mcrl = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *MoveCollectionResultListPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page MoveCollectionResultListPage) NotDone() bool {
return !page.mcrl.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page MoveCollectionResultListPage) Response() MoveCollectionResultList {
return page.mcrl
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page MoveCollectionResultListPage) Values() []MoveCollection {
if page.mcrl.IsEmpty() {
return nil
}
return *page.mcrl.Value
}
// Creates a new instance of the MoveCollectionResultListPage type.
func NewMoveCollectionResultListPage(cur MoveCollectionResultList, getNextPage func(context.Context, MoveCollectionResultList) (MoveCollectionResultList, error)) MoveCollectionResultListPage {
return MoveCollectionResultListPage{
fn: getNextPage,
mcrl: cur,
}
}
// MoveCollectionsBulkRemoveFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type MoveCollectionsBulkRemoveFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(MoveCollectionsClient) (OperationStatus, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *MoveCollectionsBulkRemoveFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for MoveCollectionsBulkRemoveFuture.Result.
func (future *MoveCollectionsBulkRemoveFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsBulkRemoveFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
osVar.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsBulkRemoveFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent {
osVar, err = client.BulkRemoveResponder(osVar.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsBulkRemoveFuture", "Result", osVar.Response.Response, "Failure responding to request")
}
}
return
}
// MoveCollectionsCommitFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type MoveCollectionsCommitFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(MoveCollectionsClient) (OperationStatus, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *MoveCollectionsCommitFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for MoveCollectionsCommitFuture.Result.
func (future *MoveCollectionsCommitFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsCommitFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
osVar.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsCommitFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent {
osVar, err = client.CommitResponder(osVar.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsCommitFuture", "Result", osVar.Response.Response, "Failure responding to request")
}
}
return
}
// MoveCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type MoveCollectionsDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(MoveCollectionsClient) (OperationStatus, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *MoveCollectionsDeleteFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for MoveCollectionsDeleteFuture.Result.
func (future *MoveCollectionsDeleteFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
osVar.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsDeleteFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent {
osVar, err = client.DeleteResponder(osVar.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsDeleteFuture", "Result", osVar.Response.Response, "Failure responding to request")
}
}
return
}
// MoveCollectionsDiscardFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type MoveCollectionsDiscardFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(MoveCollectionsClient) (OperationStatus, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *MoveCollectionsDiscardFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for MoveCollectionsDiscardFuture.Result.
func (future *MoveCollectionsDiscardFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsDiscardFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
osVar.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsDiscardFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent {
osVar, err = client.DiscardResponder(osVar.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsDiscardFuture", "Result", osVar.Response.Response, "Failure responding to request")
}
}
return
}
// MoveCollectionsInitiateMoveFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type MoveCollectionsInitiateMoveFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(MoveCollectionsClient) (OperationStatus, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *MoveCollectionsInitiateMoveFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for MoveCollectionsInitiateMoveFuture.Result.
func (future *MoveCollectionsInitiateMoveFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsInitiateMoveFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
osVar.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsInitiateMoveFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent {
osVar, err = client.InitiateMoveResponder(osVar.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsInitiateMoveFuture", "Result", osVar.Response.Response, "Failure responding to request")
}
}
return
}
// MoveCollectionsPrepareFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type MoveCollectionsPrepareFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(MoveCollectionsClient) (OperationStatus, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *MoveCollectionsPrepareFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for MoveCollectionsPrepareFuture.Result.
func (future *MoveCollectionsPrepareFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsPrepareFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
osVar.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsPrepareFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent {
osVar, err = client.PrepareResponder(osVar.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsPrepareFuture", "Result", osVar.Response.Response, "Failure responding to request")
}
}
return
}
// MoveCollectionsResolveDependenciesFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type MoveCollectionsResolveDependenciesFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(MoveCollectionsClient) (OperationStatus, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *MoveCollectionsResolveDependenciesFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for MoveCollectionsResolveDependenciesFuture.Result.
func (future *MoveCollectionsResolveDependenciesFuture) result(client MoveCollectionsClient) (osVar OperationStatus, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsResolveDependenciesFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
osVar.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("resourcemover.MoveCollectionsResolveDependenciesFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent {
osVar, err = client.ResolveDependenciesResponder(osVar.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "resourcemover.MoveCollectionsResolveDependenciesFuture", "Result", osVar.Response.Response, "Failure responding to request")
}
}
return
}
// MoveErrorInfo the move custom error info.
type MoveErrorInfo struct {
// MoveResources - READ-ONLY; The affected move resources.
MoveResources *[]AffectedMoveResource `json:"moveResources,omitempty"`
}
// MarshalJSON is the custom marshaler for MoveErrorInfo.
func (mei MoveErrorInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// MoveResource defines the move resource.
type MoveResource struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; Fully qualified resource Id for the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
Properties *MoveResourceProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for MoveResource.
func (mr MoveResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if mr.Properties != nil {
objectMap["properties"] = mr.Properties
}
return json.Marshal(objectMap)
}
// MoveResourceCollection defines the collection of move resources.
type MoveResourceCollection struct {
autorest.Response `json:"-"`
// Value - Gets the list of move resources.
Value *[]MoveResource `json:"value,omitempty"`
// NextLink - Gets the value of next link.
NextLink *string `json:"nextLink,omitempty"`
// Summary - Gets or the list of summary items.
Summary *[]SummaryItem `json:"summary,omitempty"`
}
// MoveResourceCollectionIterator provides access to a complete listing of MoveResource values.
type MoveResourceCollectionIterator struct {
i int
page MoveResourceCollectionPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *MoveResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/MoveResourceCollectionIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *MoveResourceCollectionIterator) Next() error {
return iter.NextWithContext(context.Background())
}