1 package dtl
2
3
4
5
6
7
8
9 import (
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/date"
15 "github.com/Azure/go-autorest/autorest/to"
16 "github.com/Azure/go-autorest/tracing"
17 "net/http"
18 )
19
20
21 const fqdn = "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl"
22
23
24
25 type ApplicableSchedule struct {
26 autorest.Response `json:"-"`
27
28 *ApplicableScheduleProperties `json:"properties,omitempty"`
29
30 ID *string `json:"id,omitempty"`
31
32 Name *string `json:"name,omitempty"`
33
34 Type *string `json:"type,omitempty"`
35
36 Location *string `json:"location,omitempty"`
37
38 Tags map[string]*string `json:"tags"`
39 }
40
41
42 func (as ApplicableSchedule) MarshalJSON() ([]byte, error) {
43 objectMap := make(map[string]interface{})
44 if as.ApplicableScheduleProperties != nil {
45 objectMap["properties"] = as.ApplicableScheduleProperties
46 }
47 if as.Location != nil {
48 objectMap["location"] = as.Location
49 }
50 if as.Tags != nil {
51 objectMap["tags"] = as.Tags
52 }
53 return json.Marshal(objectMap)
54 }
55
56
57 func (as *ApplicableSchedule) UnmarshalJSON(body []byte) error {
58 var m map[string]*json.RawMessage
59 err := json.Unmarshal(body, &m)
60 if err != nil {
61 return err
62 }
63 for k, v := range m {
64 switch k {
65 case "properties":
66 if v != nil {
67 var applicableScheduleProperties ApplicableScheduleProperties
68 err = json.Unmarshal(*v, &applicableScheduleProperties)
69 if err != nil {
70 return err
71 }
72 as.ApplicableScheduleProperties = &applicableScheduleProperties
73 }
74 case "id":
75 if v != nil {
76 var ID string
77 err = json.Unmarshal(*v, &ID)
78 if err != nil {
79 return err
80 }
81 as.ID = &ID
82 }
83 case "name":
84 if v != nil {
85 var name string
86 err = json.Unmarshal(*v, &name)
87 if err != nil {
88 return err
89 }
90 as.Name = &name
91 }
92 case "type":
93 if v != nil {
94 var typeVar string
95 err = json.Unmarshal(*v, &typeVar)
96 if err != nil {
97 return err
98 }
99 as.Type = &typeVar
100 }
101 case "location":
102 if v != nil {
103 var location string
104 err = json.Unmarshal(*v, &location)
105 if err != nil {
106 return err
107 }
108 as.Location = &location
109 }
110 case "tags":
111 if v != nil {
112 var tags map[string]*string
113 err = json.Unmarshal(*v, &tags)
114 if err != nil {
115 return err
116 }
117 as.Tags = tags
118 }
119 }
120 }
121
122 return nil
123 }
124
125
126
127 type ApplicableScheduleFragment struct {
128
129 *ApplicableSchedulePropertiesFragment `json:"properties,omitempty"`
130
131 Tags map[string]*string `json:"tags"`
132 }
133
134
135 func (asf ApplicableScheduleFragment) MarshalJSON() ([]byte, error) {
136 objectMap := make(map[string]interface{})
137 if asf.ApplicableSchedulePropertiesFragment != nil {
138 objectMap["properties"] = asf.ApplicableSchedulePropertiesFragment
139 }
140 if asf.Tags != nil {
141 objectMap["tags"] = asf.Tags
142 }
143 return json.Marshal(objectMap)
144 }
145
146
147 func (asf *ApplicableScheduleFragment) UnmarshalJSON(body []byte) error {
148 var m map[string]*json.RawMessage
149 err := json.Unmarshal(body, &m)
150 if err != nil {
151 return err
152 }
153 for k, v := range m {
154 switch k {
155 case "properties":
156 if v != nil {
157 var applicableSchedulePropertiesFragment ApplicableSchedulePropertiesFragment
158 err = json.Unmarshal(*v, &applicableSchedulePropertiesFragment)
159 if err != nil {
160 return err
161 }
162 asf.ApplicableSchedulePropertiesFragment = &applicableSchedulePropertiesFragment
163 }
164 case "tags":
165 if v != nil {
166 var tags map[string]*string
167 err = json.Unmarshal(*v, &tags)
168 if err != nil {
169 return err
170 }
171 asf.Tags = tags
172 }
173 }
174 }
175
176 return nil
177 }
178
179
180 type ApplicableScheduleProperties struct {
181
182 LabVmsShutdown *Schedule `json:"labVmsShutdown,omitempty"`
183
184 LabVmsStartup *Schedule `json:"labVmsStartup,omitempty"`
185 }
186
187
188 type ApplicableSchedulePropertiesFragment struct {
189
190 LabVmsShutdown *ScheduleFragment `json:"labVmsShutdown,omitempty"`
191
192 LabVmsStartup *ScheduleFragment `json:"labVmsStartup,omitempty"`
193 }
194
195
196 type ApplyArtifactsRequest struct {
197
198 Artifacts *[]ArtifactInstallProperties `json:"artifacts,omitempty"`
199 }
200
201
202 type ArmTemplate struct {
203 autorest.Response `json:"-"`
204
205 *ArmTemplateProperties `json:"properties,omitempty"`
206
207 ID *string `json:"id,omitempty"`
208
209 Name *string `json:"name,omitempty"`
210
211 Type *string `json:"type,omitempty"`
212
213 Location *string `json:"location,omitempty"`
214
215 Tags map[string]*string `json:"tags"`
216 }
217
218
219 func (at ArmTemplate) MarshalJSON() ([]byte, error) {
220 objectMap := make(map[string]interface{})
221 if at.ArmTemplateProperties != nil {
222 objectMap["properties"] = at.ArmTemplateProperties
223 }
224 if at.Location != nil {
225 objectMap["location"] = at.Location
226 }
227 if at.Tags != nil {
228 objectMap["tags"] = at.Tags
229 }
230 return json.Marshal(objectMap)
231 }
232
233
234 func (at *ArmTemplate) UnmarshalJSON(body []byte) error {
235 var m map[string]*json.RawMessage
236 err := json.Unmarshal(body, &m)
237 if err != nil {
238 return err
239 }
240 for k, v := range m {
241 switch k {
242 case "properties":
243 if v != nil {
244 var armTemplateProperties ArmTemplateProperties
245 err = json.Unmarshal(*v, &armTemplateProperties)
246 if err != nil {
247 return err
248 }
249 at.ArmTemplateProperties = &armTemplateProperties
250 }
251 case "id":
252 if v != nil {
253 var ID string
254 err = json.Unmarshal(*v, &ID)
255 if err != nil {
256 return err
257 }
258 at.ID = &ID
259 }
260 case "name":
261 if v != nil {
262 var name string
263 err = json.Unmarshal(*v, &name)
264 if err != nil {
265 return err
266 }
267 at.Name = &name
268 }
269 case "type":
270 if v != nil {
271 var typeVar string
272 err = json.Unmarshal(*v, &typeVar)
273 if err != nil {
274 return err
275 }
276 at.Type = &typeVar
277 }
278 case "location":
279 if v != nil {
280 var location string
281 err = json.Unmarshal(*v, &location)
282 if err != nil {
283 return err
284 }
285 at.Location = &location
286 }
287 case "tags":
288 if v != nil {
289 var tags map[string]*string
290 err = json.Unmarshal(*v, &tags)
291 if err != nil {
292 return err
293 }
294 at.Tags = tags
295 }
296 }
297 }
298
299 return nil
300 }
301
302
303 type ArmTemplateInfo struct {
304 autorest.Response `json:"-"`
305
306 Template interface{} `json:"template,omitempty"`
307
308 Parameters interface{} `json:"parameters,omitempty"`
309 }
310
311
312 type ArmTemplateList struct {
313 autorest.Response `json:"-"`
314
315 Value *[]ArmTemplate `json:"value,omitempty"`
316
317 NextLink *string `json:"nextLink,omitempty"`
318 }
319
320
321 type ArmTemplateListIterator struct {
322 i int
323 page ArmTemplateListPage
324 }
325
326
327
328 func (iter *ArmTemplateListIterator) NextWithContext(ctx context.Context) (err error) {
329 if tracing.IsEnabled() {
330 ctx = tracing.StartSpan(ctx, fqdn+"/ArmTemplateListIterator.NextWithContext")
331 defer func() {
332 sc := -1
333 if iter.Response().Response.Response != nil {
334 sc = iter.Response().Response.Response.StatusCode
335 }
336 tracing.EndSpan(ctx, sc, err)
337 }()
338 }
339 iter.i++
340 if iter.i < len(iter.page.Values()) {
341 return nil
342 }
343 err = iter.page.NextWithContext(ctx)
344 if err != nil {
345 iter.i--
346 return err
347 }
348 iter.i = 0
349 return nil
350 }
351
352
353
354
355 func (iter *ArmTemplateListIterator) Next() error {
356 return iter.NextWithContext(context.Background())
357 }
358
359
360 func (iter ArmTemplateListIterator) NotDone() bool {
361 return iter.page.NotDone() && iter.i < len(iter.page.Values())
362 }
363
364
365 func (iter ArmTemplateListIterator) Response() ArmTemplateList {
366 return iter.page.Response()
367 }
368
369
370
371 func (iter ArmTemplateListIterator) Value() ArmTemplate {
372 if !iter.page.NotDone() {
373 return ArmTemplate{}
374 }
375 return iter.page.Values()[iter.i]
376 }
377
378
379 func NewArmTemplateListIterator(page ArmTemplateListPage) ArmTemplateListIterator {
380 return ArmTemplateListIterator{page: page}
381 }
382
383
384 func (atl ArmTemplateList) IsEmpty() bool {
385 return atl.Value == nil || len(*atl.Value) == 0
386 }
387
388
389 func (atl ArmTemplateList) hasNextLink() bool {
390 return atl.NextLink != nil && len(*atl.NextLink) != 0
391 }
392
393
394
395 func (atl ArmTemplateList) armTemplateListPreparer(ctx context.Context) (*http.Request, error) {
396 if !atl.hasNextLink() {
397 return nil, nil
398 }
399 return autorest.Prepare((&http.Request{}).WithContext(ctx),
400 autorest.AsJSON(),
401 autorest.AsGet(),
402 autorest.WithBaseURL(to.String(atl.NextLink)))
403 }
404
405
406 type ArmTemplateListPage struct {
407 fn func(context.Context, ArmTemplateList) (ArmTemplateList, error)
408 atl ArmTemplateList
409 }
410
411
412
413 func (page *ArmTemplateListPage) NextWithContext(ctx context.Context) (err error) {
414 if tracing.IsEnabled() {
415 ctx = tracing.StartSpan(ctx, fqdn+"/ArmTemplateListPage.NextWithContext")
416 defer func() {
417 sc := -1
418 if page.Response().Response.Response != nil {
419 sc = page.Response().Response.Response.StatusCode
420 }
421 tracing.EndSpan(ctx, sc, err)
422 }()
423 }
424 for {
425 next, err := page.fn(ctx, page.atl)
426 if err != nil {
427 return err
428 }
429 page.atl = next
430 if !next.hasNextLink() || !next.IsEmpty() {
431 break
432 }
433 }
434 return nil
435 }
436
437
438
439
440 func (page *ArmTemplateListPage) Next() error {
441 return page.NextWithContext(context.Background())
442 }
443
444
445 func (page ArmTemplateListPage) NotDone() bool {
446 return !page.atl.IsEmpty()
447 }
448
449
450 func (page ArmTemplateListPage) Response() ArmTemplateList {
451 return page.atl
452 }
453
454
455 func (page ArmTemplateListPage) Values() []ArmTemplate {
456 if page.atl.IsEmpty() {
457 return nil
458 }
459 return *page.atl.Value
460 }
461
462
463 func NewArmTemplateListPage(cur ArmTemplateList, getNextPage func(context.Context, ArmTemplateList) (ArmTemplateList, error)) ArmTemplateListPage {
464 return ArmTemplateListPage{
465 fn: getNextPage,
466 atl: cur,
467 }
468 }
469
470
471 type ArmTemplateParameterProperties struct {
472
473 Name *string `json:"name,omitempty"`
474
475 Value *string `json:"value,omitempty"`
476 }
477
478
479 type ArmTemplateParameterPropertiesFragment struct {
480
481 Name *string `json:"name,omitempty"`
482
483 Value *string `json:"value,omitempty"`
484 }
485
486
487 type ArmTemplateProperties struct {
488
489 DisplayName *string `json:"displayName,omitempty"`
490
491 Description *string `json:"description,omitempty"`
492
493 Publisher *string `json:"publisher,omitempty"`
494
495 Icon *string `json:"icon,omitempty"`
496
497 Contents interface{} `json:"contents,omitempty"`
498
499 CreatedDate *date.Time `json:"createdDate,omitempty"`
500
501 ParametersValueFilesInfo *[]ParametersValueFileInfo `json:"parametersValueFilesInfo,omitempty"`
502
503 Enabled *bool `json:"enabled,omitempty"`
504 }
505
506
507 func (atp ArmTemplateProperties) MarshalJSON() ([]byte, error) {
508 objectMap := make(map[string]interface{})
509 return json.Marshal(objectMap)
510 }
511
512
513 type Artifact struct {
514 autorest.Response `json:"-"`
515
516 *ArtifactProperties `json:"properties,omitempty"`
517
518 ID *string `json:"id,omitempty"`
519
520 Name *string `json:"name,omitempty"`
521
522 Type *string `json:"type,omitempty"`
523
524 Location *string `json:"location,omitempty"`
525
526 Tags map[string]*string `json:"tags"`
527 }
528
529
530 func (a Artifact) MarshalJSON() ([]byte, error) {
531 objectMap := make(map[string]interface{})
532 if a.ArtifactProperties != nil {
533 objectMap["properties"] = a.ArtifactProperties
534 }
535 if a.Location != nil {
536 objectMap["location"] = a.Location
537 }
538 if a.Tags != nil {
539 objectMap["tags"] = a.Tags
540 }
541 return json.Marshal(objectMap)
542 }
543
544
545 func (a *Artifact) UnmarshalJSON(body []byte) error {
546 var m map[string]*json.RawMessage
547 err := json.Unmarshal(body, &m)
548 if err != nil {
549 return err
550 }
551 for k, v := range m {
552 switch k {
553 case "properties":
554 if v != nil {
555 var artifactProperties ArtifactProperties
556 err = json.Unmarshal(*v, &artifactProperties)
557 if err != nil {
558 return err
559 }
560 a.ArtifactProperties = &artifactProperties
561 }
562 case "id":
563 if v != nil {
564 var ID string
565 err = json.Unmarshal(*v, &ID)
566 if err != nil {
567 return err
568 }
569 a.ID = &ID
570 }
571 case "name":
572 if v != nil {
573 var name string
574 err = json.Unmarshal(*v, &name)
575 if err != nil {
576 return err
577 }
578 a.Name = &name
579 }
580 case "type":
581 if v != nil {
582 var typeVar string
583 err = json.Unmarshal(*v, &typeVar)
584 if err != nil {
585 return err
586 }
587 a.Type = &typeVar
588 }
589 case "location":
590 if v != nil {
591 var location string
592 err = json.Unmarshal(*v, &location)
593 if err != nil {
594 return err
595 }
596 a.Location = &location
597 }
598 case "tags":
599 if v != nil {
600 var tags map[string]*string
601 err = json.Unmarshal(*v, &tags)
602 if err != nil {
603 return err
604 }
605 a.Tags = tags
606 }
607 }
608 }
609
610 return nil
611 }
612
613
614 type ArtifactDeploymentStatusProperties struct {
615
616 DeploymentStatus *string `json:"deploymentStatus,omitempty"`
617
618 ArtifactsApplied *int32 `json:"artifactsApplied,omitempty"`
619
620 TotalArtifacts *int32 `json:"totalArtifacts,omitempty"`
621 }
622
623
624 type ArtifactDeploymentStatusPropertiesFragment struct {
625
626 DeploymentStatus *string `json:"deploymentStatus,omitempty"`
627
628 ArtifactsApplied *int32 `json:"artifactsApplied,omitempty"`
629
630 TotalArtifacts *int32 `json:"totalArtifacts,omitempty"`
631 }
632
633
634 type ArtifactInstallProperties struct {
635
636 ArtifactID *string `json:"artifactId,omitempty"`
637
638 ArtifactTitle *string `json:"artifactTitle,omitempty"`
639
640 Parameters *[]ArtifactParameterProperties `json:"parameters,omitempty"`
641
642 Status *string `json:"status,omitempty"`
643
644 DeploymentStatusMessage *string `json:"deploymentStatusMessage,omitempty"`
645
646 VMExtensionStatusMessage *string `json:"vmExtensionStatusMessage,omitempty"`
647
648 InstallTime *date.Time `json:"installTime,omitempty"`
649 }
650
651
652 type ArtifactInstallPropertiesFragment struct {
653
654 ArtifactID *string `json:"artifactId,omitempty"`
655
656 ArtifactTitle *string `json:"artifactTitle,omitempty"`
657
658 Parameters *[]ArtifactParameterPropertiesFragment `json:"parameters,omitempty"`
659
660 Status *string `json:"status,omitempty"`
661
662 DeploymentStatusMessage *string `json:"deploymentStatusMessage,omitempty"`
663
664 VMExtensionStatusMessage *string `json:"vmExtensionStatusMessage,omitempty"`
665
666 InstallTime *date.Time `json:"installTime,omitempty"`
667 }
668
669
670 type ArtifactList struct {
671 autorest.Response `json:"-"`
672
673 Value *[]Artifact `json:"value,omitempty"`
674
675 NextLink *string `json:"nextLink,omitempty"`
676 }
677
678
679 type ArtifactListIterator struct {
680 i int
681 page ArtifactListPage
682 }
683
684
685
686 func (iter *ArtifactListIterator) NextWithContext(ctx context.Context) (err error) {
687 if tracing.IsEnabled() {
688 ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactListIterator.NextWithContext")
689 defer func() {
690 sc := -1
691 if iter.Response().Response.Response != nil {
692 sc = iter.Response().Response.Response.StatusCode
693 }
694 tracing.EndSpan(ctx, sc, err)
695 }()
696 }
697 iter.i++
698 if iter.i < len(iter.page.Values()) {
699 return nil
700 }
701 err = iter.page.NextWithContext(ctx)
702 if err != nil {
703 iter.i--
704 return err
705 }
706 iter.i = 0
707 return nil
708 }
709
710
711
712
713 func (iter *ArtifactListIterator) Next() error {
714 return iter.NextWithContext(context.Background())
715 }
716
717
718 func (iter ArtifactListIterator) NotDone() bool {
719 return iter.page.NotDone() && iter.i < len(iter.page.Values())
720 }
721
722
723 func (iter ArtifactListIterator) Response() ArtifactList {
724 return iter.page.Response()
725 }
726
727
728
729 func (iter ArtifactListIterator) Value() Artifact {
730 if !iter.page.NotDone() {
731 return Artifact{}
732 }
733 return iter.page.Values()[iter.i]
734 }
735
736
737 func NewArtifactListIterator(page ArtifactListPage) ArtifactListIterator {
738 return ArtifactListIterator{page: page}
739 }
740
741
742 func (al ArtifactList) IsEmpty() bool {
743 return al.Value == nil || len(*al.Value) == 0
744 }
745
746
747 func (al ArtifactList) hasNextLink() bool {
748 return al.NextLink != nil && len(*al.NextLink) != 0
749 }
750
751
752
753 func (al ArtifactList) artifactListPreparer(ctx context.Context) (*http.Request, error) {
754 if !al.hasNextLink() {
755 return nil, nil
756 }
757 return autorest.Prepare((&http.Request{}).WithContext(ctx),
758 autorest.AsJSON(),
759 autorest.AsGet(),
760 autorest.WithBaseURL(to.String(al.NextLink)))
761 }
762
763
764 type ArtifactListPage struct {
765 fn func(context.Context, ArtifactList) (ArtifactList, error)
766 al ArtifactList
767 }
768
769
770
771 func (page *ArtifactListPage) NextWithContext(ctx context.Context) (err error) {
772 if tracing.IsEnabled() {
773 ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactListPage.NextWithContext")
774 defer func() {
775 sc := -1
776 if page.Response().Response.Response != nil {
777 sc = page.Response().Response.Response.StatusCode
778 }
779 tracing.EndSpan(ctx, sc, err)
780 }()
781 }
782 for {
783 next, err := page.fn(ctx, page.al)
784 if err != nil {
785 return err
786 }
787 page.al = next
788 if !next.hasNextLink() || !next.IsEmpty() {
789 break
790 }
791 }
792 return nil
793 }
794
795
796
797
798 func (page *ArtifactListPage) Next() error {
799 return page.NextWithContext(context.Background())
800 }
801
802
803 func (page ArtifactListPage) NotDone() bool {
804 return !page.al.IsEmpty()
805 }
806
807
808 func (page ArtifactListPage) Response() ArtifactList {
809 return page.al
810 }
811
812
813 func (page ArtifactListPage) Values() []Artifact {
814 if page.al.IsEmpty() {
815 return nil
816 }
817 return *page.al.Value
818 }
819
820
821 func NewArtifactListPage(cur ArtifactList, getNextPage func(context.Context, ArtifactList) (ArtifactList, error)) ArtifactListPage {
822 return ArtifactListPage{
823 fn: getNextPage,
824 al: cur,
825 }
826 }
827
828
829 type ArtifactParameterProperties struct {
830
831 Name *string `json:"name,omitempty"`
832
833 Value *string `json:"value,omitempty"`
834 }
835
836
837 type ArtifactParameterPropertiesFragment struct {
838
839 Name *string `json:"name,omitempty"`
840
841 Value *string `json:"value,omitempty"`
842 }
843
844
845 type ArtifactProperties struct {
846
847 Title *string `json:"title,omitempty"`
848
849 Description *string `json:"description,omitempty"`
850
851 Publisher *string `json:"publisher,omitempty"`
852
853 FilePath *string `json:"filePath,omitempty"`
854
855 Icon *string `json:"icon,omitempty"`
856
857 TargetOsType *string `json:"targetOsType,omitempty"`
858
859 Parameters interface{} `json:"parameters,omitempty"`
860
861 CreatedDate *date.Time `json:"createdDate,omitempty"`
862 }
863
864
865 func (ap ArtifactProperties) MarshalJSON() ([]byte, error) {
866 objectMap := make(map[string]interface{})
867 return json.Marshal(objectMap)
868 }
869
870
871 type ArtifactSource struct {
872 autorest.Response `json:"-"`
873
874 *ArtifactSourceProperties `json:"properties,omitempty"`
875
876 ID *string `json:"id,omitempty"`
877
878 Name *string `json:"name,omitempty"`
879
880 Type *string `json:"type,omitempty"`
881
882 Location *string `json:"location,omitempty"`
883
884 Tags map[string]*string `json:"tags"`
885 }
886
887
888 func (as ArtifactSource) MarshalJSON() ([]byte, error) {
889 objectMap := make(map[string]interface{})
890 if as.ArtifactSourceProperties != nil {
891 objectMap["properties"] = as.ArtifactSourceProperties
892 }
893 if as.Location != nil {
894 objectMap["location"] = as.Location
895 }
896 if as.Tags != nil {
897 objectMap["tags"] = as.Tags
898 }
899 return json.Marshal(objectMap)
900 }
901
902
903 func (as *ArtifactSource) UnmarshalJSON(body []byte) error {
904 var m map[string]*json.RawMessage
905 err := json.Unmarshal(body, &m)
906 if err != nil {
907 return err
908 }
909 for k, v := range m {
910 switch k {
911 case "properties":
912 if v != nil {
913 var artifactSourceProperties ArtifactSourceProperties
914 err = json.Unmarshal(*v, &artifactSourceProperties)
915 if err != nil {
916 return err
917 }
918 as.ArtifactSourceProperties = &artifactSourceProperties
919 }
920 case "id":
921 if v != nil {
922 var ID string
923 err = json.Unmarshal(*v, &ID)
924 if err != nil {
925 return err
926 }
927 as.ID = &ID
928 }
929 case "name":
930 if v != nil {
931 var name string
932 err = json.Unmarshal(*v, &name)
933 if err != nil {
934 return err
935 }
936 as.Name = &name
937 }
938 case "type":
939 if v != nil {
940 var typeVar string
941 err = json.Unmarshal(*v, &typeVar)
942 if err != nil {
943 return err
944 }
945 as.Type = &typeVar
946 }
947 case "location":
948 if v != nil {
949 var location string
950 err = json.Unmarshal(*v, &location)
951 if err != nil {
952 return err
953 }
954 as.Location = &location
955 }
956 case "tags":
957 if v != nil {
958 var tags map[string]*string
959 err = json.Unmarshal(*v, &tags)
960 if err != nil {
961 return err
962 }
963 as.Tags = tags
964 }
965 }
966 }
967
968 return nil
969 }
970
971
972 type ArtifactSourceFragment struct {
973
974 *ArtifactSourcePropertiesFragment `json:"properties,omitempty"`
975
976 Tags map[string]*string `json:"tags"`
977 }
978
979
980 func (asf ArtifactSourceFragment) MarshalJSON() ([]byte, error) {
981 objectMap := make(map[string]interface{})
982 if asf.ArtifactSourcePropertiesFragment != nil {
983 objectMap["properties"] = asf.ArtifactSourcePropertiesFragment
984 }
985 if asf.Tags != nil {
986 objectMap["tags"] = asf.Tags
987 }
988 return json.Marshal(objectMap)
989 }
990
991
992 func (asf *ArtifactSourceFragment) UnmarshalJSON(body []byte) error {
993 var m map[string]*json.RawMessage
994 err := json.Unmarshal(body, &m)
995 if err != nil {
996 return err
997 }
998 for k, v := range m {
999 switch k {
1000 case "properties":
1001 if v != nil {
1002 var artifactSourcePropertiesFragment ArtifactSourcePropertiesFragment
1003 err = json.Unmarshal(*v, &artifactSourcePropertiesFragment)
1004 if err != nil {
1005 return err
1006 }
1007 asf.ArtifactSourcePropertiesFragment = &artifactSourcePropertiesFragment
1008 }
1009 case "tags":
1010 if v != nil {
1011 var tags map[string]*string
1012 err = json.Unmarshal(*v, &tags)
1013 if err != nil {
1014 return err
1015 }
1016 asf.Tags = tags
1017 }
1018 }
1019 }
1020
1021 return nil
1022 }
1023
1024
1025 type ArtifactSourceList struct {
1026 autorest.Response `json:"-"`
1027
1028 Value *[]ArtifactSource `json:"value,omitempty"`
1029
1030 NextLink *string `json:"nextLink,omitempty"`
1031 }
1032
1033
1034 type ArtifactSourceListIterator struct {
1035 i int
1036 page ArtifactSourceListPage
1037 }
1038
1039
1040
1041 func (iter *ArtifactSourceListIterator) NextWithContext(ctx context.Context) (err error) {
1042 if tracing.IsEnabled() {
1043 ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactSourceListIterator.NextWithContext")
1044 defer func() {
1045 sc := -1
1046 if iter.Response().Response.Response != nil {
1047 sc = iter.Response().Response.Response.StatusCode
1048 }
1049 tracing.EndSpan(ctx, sc, err)
1050 }()
1051 }
1052 iter.i++
1053 if iter.i < len(iter.page.Values()) {
1054 return nil
1055 }
1056 err = iter.page.NextWithContext(ctx)
1057 if err != nil {
1058 iter.i--
1059 return err
1060 }
1061 iter.i = 0
1062 return nil
1063 }
1064
1065
1066
1067
1068 func (iter *ArtifactSourceListIterator) Next() error {
1069 return iter.NextWithContext(context.Background())
1070 }
1071
1072
1073 func (iter ArtifactSourceListIterator) NotDone() bool {
1074 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1075 }
1076
1077
1078 func (iter ArtifactSourceListIterator) Response() ArtifactSourceList {
1079 return iter.page.Response()
1080 }
1081
1082
1083
1084 func (iter ArtifactSourceListIterator) Value() ArtifactSource {
1085 if !iter.page.NotDone() {
1086 return ArtifactSource{}
1087 }
1088 return iter.page.Values()[iter.i]
1089 }
1090
1091
1092 func NewArtifactSourceListIterator(page ArtifactSourceListPage) ArtifactSourceListIterator {
1093 return ArtifactSourceListIterator{page: page}
1094 }
1095
1096
1097 func (asl ArtifactSourceList) IsEmpty() bool {
1098 return asl.Value == nil || len(*asl.Value) == 0
1099 }
1100
1101
1102 func (asl ArtifactSourceList) hasNextLink() bool {
1103 return asl.NextLink != nil && len(*asl.NextLink) != 0
1104 }
1105
1106
1107
1108 func (asl ArtifactSourceList) artifactSourceListPreparer(ctx context.Context) (*http.Request, error) {
1109 if !asl.hasNextLink() {
1110 return nil, nil
1111 }
1112 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1113 autorest.AsJSON(),
1114 autorest.AsGet(),
1115 autorest.WithBaseURL(to.String(asl.NextLink)))
1116 }
1117
1118
1119 type ArtifactSourceListPage struct {
1120 fn func(context.Context, ArtifactSourceList) (ArtifactSourceList, error)
1121 asl ArtifactSourceList
1122 }
1123
1124
1125
1126 func (page *ArtifactSourceListPage) NextWithContext(ctx context.Context) (err error) {
1127 if tracing.IsEnabled() {
1128 ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactSourceListPage.NextWithContext")
1129 defer func() {
1130 sc := -1
1131 if page.Response().Response.Response != nil {
1132 sc = page.Response().Response.Response.StatusCode
1133 }
1134 tracing.EndSpan(ctx, sc, err)
1135 }()
1136 }
1137 for {
1138 next, err := page.fn(ctx, page.asl)
1139 if err != nil {
1140 return err
1141 }
1142 page.asl = next
1143 if !next.hasNextLink() || !next.IsEmpty() {
1144 break
1145 }
1146 }
1147 return nil
1148 }
1149
1150
1151
1152
1153 func (page *ArtifactSourceListPage) Next() error {
1154 return page.NextWithContext(context.Background())
1155 }
1156
1157
1158 func (page ArtifactSourceListPage) NotDone() bool {
1159 return !page.asl.IsEmpty()
1160 }
1161
1162
1163 func (page ArtifactSourceListPage) Response() ArtifactSourceList {
1164 return page.asl
1165 }
1166
1167
1168 func (page ArtifactSourceListPage) Values() []ArtifactSource {
1169 if page.asl.IsEmpty() {
1170 return nil
1171 }
1172 return *page.asl.Value
1173 }
1174
1175
1176 func NewArtifactSourceListPage(cur ArtifactSourceList, getNextPage func(context.Context, ArtifactSourceList) (ArtifactSourceList, error)) ArtifactSourceListPage {
1177 return ArtifactSourceListPage{
1178 fn: getNextPage,
1179 asl: cur,
1180 }
1181 }
1182
1183
1184 type ArtifactSourceProperties struct {
1185
1186 DisplayName *string `json:"displayName,omitempty"`
1187
1188 URI *string `json:"uri,omitempty"`
1189
1190 SourceType SourceControlType `json:"sourceType,omitempty"`
1191
1192 FolderPath *string `json:"folderPath,omitempty"`
1193
1194 ArmTemplateFolderPath *string `json:"armTemplateFolderPath,omitempty"`
1195
1196 BranchRef *string `json:"branchRef,omitempty"`
1197
1198 SecurityToken *string `json:"securityToken,omitempty"`
1199
1200 Status EnableStatus `json:"status,omitempty"`
1201
1202 CreatedDate *date.Time `json:"createdDate,omitempty"`
1203
1204 ProvisioningState *string `json:"provisioningState,omitempty"`
1205
1206 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
1207 }
1208
1209
1210 func (asp ArtifactSourceProperties) MarshalJSON() ([]byte, error) {
1211 objectMap := make(map[string]interface{})
1212 if asp.DisplayName != nil {
1213 objectMap["displayName"] = asp.DisplayName
1214 }
1215 if asp.URI != nil {
1216 objectMap["uri"] = asp.URI
1217 }
1218 if asp.SourceType != "" {
1219 objectMap["sourceType"] = asp.SourceType
1220 }
1221 if asp.FolderPath != nil {
1222 objectMap["folderPath"] = asp.FolderPath
1223 }
1224 if asp.ArmTemplateFolderPath != nil {
1225 objectMap["armTemplateFolderPath"] = asp.ArmTemplateFolderPath
1226 }
1227 if asp.BranchRef != nil {
1228 objectMap["branchRef"] = asp.BranchRef
1229 }
1230 if asp.SecurityToken != nil {
1231 objectMap["securityToken"] = asp.SecurityToken
1232 }
1233 if asp.Status != "" {
1234 objectMap["status"] = asp.Status
1235 }
1236 return json.Marshal(objectMap)
1237 }
1238
1239
1240 type ArtifactSourcePropertiesFragment struct {
1241
1242 DisplayName *string `json:"displayName,omitempty"`
1243
1244 URI *string `json:"uri,omitempty"`
1245
1246 SourceType SourceControlType `json:"sourceType,omitempty"`
1247
1248 FolderPath *string `json:"folderPath,omitempty"`
1249
1250 ArmTemplateFolderPath *string `json:"armTemplateFolderPath,omitempty"`
1251
1252 BranchRef *string `json:"branchRef,omitempty"`
1253
1254 SecurityToken *string `json:"securityToken,omitempty"`
1255
1256 Status EnableStatus `json:"status,omitempty"`
1257 }
1258
1259
1260 type AttachDiskProperties struct {
1261
1262 LeasedByLabVMID *string `json:"leasedByLabVmId,omitempty"`
1263 }
1264
1265
1266 type AttachNewDataDiskOptions struct {
1267
1268 DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"`
1269
1270 DiskName *string `json:"diskName,omitempty"`
1271
1272 DiskType StorageType `json:"diskType,omitempty"`
1273 }
1274
1275
1276 type AttachNewDataDiskOptionsFragment struct {
1277
1278 DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"`
1279
1280 DiskName *string `json:"diskName,omitempty"`
1281
1282 DiskType StorageType `json:"diskType,omitempty"`
1283 }
1284
1285
1286 type BulkCreationParameters struct {
1287
1288 InstanceCount *int32 `json:"instanceCount,omitempty"`
1289 }
1290
1291
1292 type BulkCreationParametersFragment struct {
1293
1294 InstanceCount *int32 `json:"instanceCount,omitempty"`
1295 }
1296
1297
1298 type CloudError struct {
1299
1300 Error *CloudErrorBody `json:"error,omitempty"`
1301 }
1302
1303
1304 type CloudErrorBody struct {
1305
1306 Code *string `json:"code,omitempty"`
1307
1308 Message *string `json:"message,omitempty"`
1309
1310 Target *string `json:"target,omitempty"`
1311
1312 Details *[]CloudErrorBody `json:"details,omitempty"`
1313 }
1314
1315
1316 type ComputeDataDisk struct {
1317
1318 Name *string `json:"name,omitempty"`
1319
1320 DiskURI *string `json:"diskUri,omitempty"`
1321
1322 ManagedDiskID *string `json:"managedDiskId,omitempty"`
1323
1324 DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"`
1325 }
1326
1327
1328 type ComputeDataDiskFragment struct {
1329
1330 Name *string `json:"name,omitempty"`
1331
1332 DiskURI *string `json:"diskUri,omitempty"`
1333
1334 ManagedDiskID *string `json:"managedDiskId,omitempty"`
1335
1336 DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"`
1337 }
1338
1339
1340 type ComputeVMInstanceViewStatus struct {
1341
1342 Code *string `json:"code,omitempty"`
1343
1344 DisplayStatus *string `json:"displayStatus,omitempty"`
1345
1346 Message *string `json:"message,omitempty"`
1347 }
1348
1349
1350 type ComputeVMInstanceViewStatusFragment struct {
1351
1352 Code *string `json:"code,omitempty"`
1353
1354 DisplayStatus *string `json:"displayStatus,omitempty"`
1355
1356 Message *string `json:"message,omitempty"`
1357 }
1358
1359
1360 type ComputeVMProperties struct {
1361
1362 Statuses *[]ComputeVMInstanceViewStatus `json:"statuses,omitempty"`
1363
1364 OsType *string `json:"osType,omitempty"`
1365
1366 VMSize *string `json:"vmSize,omitempty"`
1367
1368 NetworkInterfaceID *string `json:"networkInterfaceId,omitempty"`
1369
1370 OsDiskID *string `json:"osDiskId,omitempty"`
1371
1372 DataDiskIds *[]string `json:"dataDiskIds,omitempty"`
1373
1374 DataDisks *[]ComputeDataDisk `json:"dataDisks,omitempty"`
1375 }
1376
1377
1378 type ComputeVMPropertiesFragment struct {
1379
1380 Statuses *[]ComputeVMInstanceViewStatusFragment `json:"statuses,omitempty"`
1381
1382 OsType *string `json:"osType,omitempty"`
1383
1384 VMSize *string `json:"vmSize,omitempty"`
1385
1386 NetworkInterfaceID *string `json:"networkInterfaceId,omitempty"`
1387
1388 OsDiskID *string `json:"osDiskId,omitempty"`
1389
1390 DataDiskIds *[]string `json:"dataDiskIds,omitempty"`
1391
1392 DataDisks *[]ComputeDataDiskFragment `json:"dataDisks,omitempty"`
1393 }
1394
1395
1396 type CostThresholdProperties struct {
1397
1398 ThresholdID *string `json:"thresholdId,omitempty"`
1399
1400 PercentageThreshold *PercentageCostThresholdProperties `json:"percentageThreshold,omitempty"`
1401
1402 DisplayOnChart CostThresholdStatus `json:"displayOnChart,omitempty"`
1403
1404 SendNotificationWhenExceeded CostThresholdStatus `json:"sendNotificationWhenExceeded,omitempty"`
1405
1406 NotificationSent *string `json:"notificationSent,omitempty"`
1407 }
1408
1409
1410 type CustomImage struct {
1411 autorest.Response `json:"-"`
1412
1413 *CustomImageProperties `json:"properties,omitempty"`
1414
1415 ID *string `json:"id,omitempty"`
1416
1417 Name *string `json:"name,omitempty"`
1418
1419 Type *string `json:"type,omitempty"`
1420
1421 Location *string `json:"location,omitempty"`
1422
1423 Tags map[string]*string `json:"tags"`
1424 }
1425
1426
1427 func (ci CustomImage) MarshalJSON() ([]byte, error) {
1428 objectMap := make(map[string]interface{})
1429 if ci.CustomImageProperties != nil {
1430 objectMap["properties"] = ci.CustomImageProperties
1431 }
1432 if ci.Location != nil {
1433 objectMap["location"] = ci.Location
1434 }
1435 if ci.Tags != nil {
1436 objectMap["tags"] = ci.Tags
1437 }
1438 return json.Marshal(objectMap)
1439 }
1440
1441
1442 func (ci *CustomImage) UnmarshalJSON(body []byte) error {
1443 var m map[string]*json.RawMessage
1444 err := json.Unmarshal(body, &m)
1445 if err != nil {
1446 return err
1447 }
1448 for k, v := range m {
1449 switch k {
1450 case "properties":
1451 if v != nil {
1452 var customImageProperties CustomImageProperties
1453 err = json.Unmarshal(*v, &customImageProperties)
1454 if err != nil {
1455 return err
1456 }
1457 ci.CustomImageProperties = &customImageProperties
1458 }
1459 case "id":
1460 if v != nil {
1461 var ID string
1462 err = json.Unmarshal(*v, &ID)
1463 if err != nil {
1464 return err
1465 }
1466 ci.ID = &ID
1467 }
1468 case "name":
1469 if v != nil {
1470 var name string
1471 err = json.Unmarshal(*v, &name)
1472 if err != nil {
1473 return err
1474 }
1475 ci.Name = &name
1476 }
1477 case "type":
1478 if v != nil {
1479 var typeVar string
1480 err = json.Unmarshal(*v, &typeVar)
1481 if err != nil {
1482 return err
1483 }
1484 ci.Type = &typeVar
1485 }
1486 case "location":
1487 if v != nil {
1488 var location string
1489 err = json.Unmarshal(*v, &location)
1490 if err != nil {
1491 return err
1492 }
1493 ci.Location = &location
1494 }
1495 case "tags":
1496 if v != nil {
1497 var tags map[string]*string
1498 err = json.Unmarshal(*v, &tags)
1499 if err != nil {
1500 return err
1501 }
1502 ci.Tags = tags
1503 }
1504 }
1505 }
1506
1507 return nil
1508 }
1509
1510
1511 type CustomImageFragment struct {
1512
1513 *CustomImagePropertiesFragment `json:"properties,omitempty"`
1514
1515 Tags map[string]*string `json:"tags"`
1516 }
1517
1518
1519 func (cif CustomImageFragment) MarshalJSON() ([]byte, error) {
1520 objectMap := make(map[string]interface{})
1521 if cif.CustomImagePropertiesFragment != nil {
1522 objectMap["properties"] = cif.CustomImagePropertiesFragment
1523 }
1524 if cif.Tags != nil {
1525 objectMap["tags"] = cif.Tags
1526 }
1527 return json.Marshal(objectMap)
1528 }
1529
1530
1531 func (cif *CustomImageFragment) UnmarshalJSON(body []byte) error {
1532 var m map[string]*json.RawMessage
1533 err := json.Unmarshal(body, &m)
1534 if err != nil {
1535 return err
1536 }
1537 for k, v := range m {
1538 switch k {
1539 case "properties":
1540 if v != nil {
1541 var customImagePropertiesFragment CustomImagePropertiesFragment
1542 err = json.Unmarshal(*v, &customImagePropertiesFragment)
1543 if err != nil {
1544 return err
1545 }
1546 cif.CustomImagePropertiesFragment = &customImagePropertiesFragment
1547 }
1548 case "tags":
1549 if v != nil {
1550 var tags map[string]*string
1551 err = json.Unmarshal(*v, &tags)
1552 if err != nil {
1553 return err
1554 }
1555 cif.Tags = tags
1556 }
1557 }
1558 }
1559
1560 return nil
1561 }
1562
1563
1564 type CustomImageList struct {
1565 autorest.Response `json:"-"`
1566
1567 Value *[]CustomImage `json:"value,omitempty"`
1568
1569 NextLink *string `json:"nextLink,omitempty"`
1570 }
1571
1572
1573 type CustomImageListIterator struct {
1574 i int
1575 page CustomImageListPage
1576 }
1577
1578
1579
1580 func (iter *CustomImageListIterator) NextWithContext(ctx context.Context) (err error) {
1581 if tracing.IsEnabled() {
1582 ctx = tracing.StartSpan(ctx, fqdn+"/CustomImageListIterator.NextWithContext")
1583 defer func() {
1584 sc := -1
1585 if iter.Response().Response.Response != nil {
1586 sc = iter.Response().Response.Response.StatusCode
1587 }
1588 tracing.EndSpan(ctx, sc, err)
1589 }()
1590 }
1591 iter.i++
1592 if iter.i < len(iter.page.Values()) {
1593 return nil
1594 }
1595 err = iter.page.NextWithContext(ctx)
1596 if err != nil {
1597 iter.i--
1598 return err
1599 }
1600 iter.i = 0
1601 return nil
1602 }
1603
1604
1605
1606
1607 func (iter *CustomImageListIterator) Next() error {
1608 return iter.NextWithContext(context.Background())
1609 }
1610
1611
1612 func (iter CustomImageListIterator) NotDone() bool {
1613 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1614 }
1615
1616
1617 func (iter CustomImageListIterator) Response() CustomImageList {
1618 return iter.page.Response()
1619 }
1620
1621
1622
1623 func (iter CustomImageListIterator) Value() CustomImage {
1624 if !iter.page.NotDone() {
1625 return CustomImage{}
1626 }
1627 return iter.page.Values()[iter.i]
1628 }
1629
1630
1631 func NewCustomImageListIterator(page CustomImageListPage) CustomImageListIterator {
1632 return CustomImageListIterator{page: page}
1633 }
1634
1635
1636 func (cil CustomImageList) IsEmpty() bool {
1637 return cil.Value == nil || len(*cil.Value) == 0
1638 }
1639
1640
1641 func (cil CustomImageList) hasNextLink() bool {
1642 return cil.NextLink != nil && len(*cil.NextLink) != 0
1643 }
1644
1645
1646
1647 func (cil CustomImageList) customImageListPreparer(ctx context.Context) (*http.Request, error) {
1648 if !cil.hasNextLink() {
1649 return nil, nil
1650 }
1651 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1652 autorest.AsJSON(),
1653 autorest.AsGet(),
1654 autorest.WithBaseURL(to.String(cil.NextLink)))
1655 }
1656
1657
1658 type CustomImageListPage struct {
1659 fn func(context.Context, CustomImageList) (CustomImageList, error)
1660 cil CustomImageList
1661 }
1662
1663
1664
1665 func (page *CustomImageListPage) NextWithContext(ctx context.Context) (err error) {
1666 if tracing.IsEnabled() {
1667 ctx = tracing.StartSpan(ctx, fqdn+"/CustomImageListPage.NextWithContext")
1668 defer func() {
1669 sc := -1
1670 if page.Response().Response.Response != nil {
1671 sc = page.Response().Response.Response.StatusCode
1672 }
1673 tracing.EndSpan(ctx, sc, err)
1674 }()
1675 }
1676 for {
1677 next, err := page.fn(ctx, page.cil)
1678 if err != nil {
1679 return err
1680 }
1681 page.cil = next
1682 if !next.hasNextLink() || !next.IsEmpty() {
1683 break
1684 }
1685 }
1686 return nil
1687 }
1688
1689
1690
1691
1692 func (page *CustomImageListPage) Next() error {
1693 return page.NextWithContext(context.Background())
1694 }
1695
1696
1697 func (page CustomImageListPage) NotDone() bool {
1698 return !page.cil.IsEmpty()
1699 }
1700
1701
1702 func (page CustomImageListPage) Response() CustomImageList {
1703 return page.cil
1704 }
1705
1706
1707 func (page CustomImageListPage) Values() []CustomImage {
1708 if page.cil.IsEmpty() {
1709 return nil
1710 }
1711 return *page.cil.Value
1712 }
1713
1714
1715 func NewCustomImageListPage(cur CustomImageList, getNextPage func(context.Context, CustomImageList) (CustomImageList, error)) CustomImageListPage {
1716 return CustomImageListPage{
1717 fn: getNextPage,
1718 cil: cur,
1719 }
1720 }
1721
1722
1723 type CustomImageProperties struct {
1724
1725 VM *CustomImagePropertiesFromVM `json:"vm,omitempty"`
1726
1727 Vhd *CustomImagePropertiesCustom `json:"vhd,omitempty"`
1728
1729 Description *string `json:"description,omitempty"`
1730
1731 Author *string `json:"author,omitempty"`
1732
1733 CreationDate *date.Time `json:"creationDate,omitempty"`
1734
1735 ManagedImageID *string `json:"managedImageId,omitempty"`
1736
1737 ManagedSnapshotID *string `json:"managedSnapshotId,omitempty"`
1738
1739 DataDiskStorageInfo *[]DataDiskStorageTypeInfo `json:"dataDiskStorageInfo,omitempty"`
1740
1741 CustomImagePlan *CustomImagePropertiesFromPlan `json:"customImagePlan,omitempty"`
1742
1743 IsPlanAuthorized *bool `json:"isPlanAuthorized,omitempty"`
1744
1745 ProvisioningState *string `json:"provisioningState,omitempty"`
1746
1747 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
1748 }
1749
1750
1751 func (cip CustomImageProperties) MarshalJSON() ([]byte, error) {
1752 objectMap := make(map[string]interface{})
1753 if cip.VM != nil {
1754 objectMap["vm"] = cip.VM
1755 }
1756 if cip.Vhd != nil {
1757 objectMap["vhd"] = cip.Vhd
1758 }
1759 if cip.Description != nil {
1760 objectMap["description"] = cip.Description
1761 }
1762 if cip.Author != nil {
1763 objectMap["author"] = cip.Author
1764 }
1765 if cip.ManagedImageID != nil {
1766 objectMap["managedImageId"] = cip.ManagedImageID
1767 }
1768 if cip.ManagedSnapshotID != nil {
1769 objectMap["managedSnapshotId"] = cip.ManagedSnapshotID
1770 }
1771 if cip.DataDiskStorageInfo != nil {
1772 objectMap["dataDiskStorageInfo"] = cip.DataDiskStorageInfo
1773 }
1774 if cip.CustomImagePlan != nil {
1775 objectMap["customImagePlan"] = cip.CustomImagePlan
1776 }
1777 if cip.IsPlanAuthorized != nil {
1778 objectMap["isPlanAuthorized"] = cip.IsPlanAuthorized
1779 }
1780 return json.Marshal(objectMap)
1781 }
1782
1783
1784 type CustomImagePropertiesCustom struct {
1785
1786 ImageName *string `json:"imageName,omitempty"`
1787
1788 SysPrep *bool `json:"sysPrep,omitempty"`
1789
1790 OsType CustomImageOsType `json:"osType,omitempty"`
1791 }
1792
1793
1794 type CustomImagePropertiesCustomFragment struct {
1795
1796 ImageName *string `json:"imageName,omitempty"`
1797
1798 SysPrep *bool `json:"sysPrep,omitempty"`
1799
1800 OsType CustomImageOsType `json:"osType,omitempty"`
1801 }
1802
1803
1804 type CustomImagePropertiesFragment struct {
1805
1806 VM *CustomImagePropertiesFromVMFragment `json:"vm,omitempty"`
1807
1808 Vhd *CustomImagePropertiesCustomFragment `json:"vhd,omitempty"`
1809
1810 Description *string `json:"description,omitempty"`
1811
1812 Author *string `json:"author,omitempty"`
1813
1814 ManagedImageID *string `json:"managedImageId,omitempty"`
1815
1816 ManagedSnapshotID *string `json:"managedSnapshotId,omitempty"`
1817
1818 DataDiskStorageInfo *[]DataDiskStorageTypeInfoFragment `json:"dataDiskStorageInfo,omitempty"`
1819
1820 CustomImagePlan *CustomImagePropertiesFromPlanFragment `json:"customImagePlan,omitempty"`
1821
1822 IsPlanAuthorized *bool `json:"isPlanAuthorized,omitempty"`
1823 }
1824
1825
1826 type CustomImagePropertiesFromPlan struct {
1827
1828 ID *string `json:"id,omitempty"`
1829
1830 Publisher *string `json:"publisher,omitempty"`
1831
1832 Offer *string `json:"offer,omitempty"`
1833 }
1834
1835
1836 type CustomImagePropertiesFromPlanFragment struct {
1837
1838 ID *string `json:"id,omitempty"`
1839
1840 Publisher *string `json:"publisher,omitempty"`
1841
1842 Offer *string `json:"offer,omitempty"`
1843 }
1844
1845
1846 type CustomImagePropertiesFromVM struct {
1847
1848 SourceVMID *string `json:"sourceVmId,omitempty"`
1849
1850 WindowsOsInfo *WindowsOsInfo `json:"windowsOsInfo,omitempty"`
1851
1852 LinuxOsInfo *LinuxOsInfo `json:"linuxOsInfo,omitempty"`
1853 }
1854
1855
1856 type CustomImagePropertiesFromVMFragment struct {
1857
1858 SourceVMID *string `json:"sourceVmId,omitempty"`
1859
1860 WindowsOsInfo *WindowsOsInfoFragment `json:"windowsOsInfo,omitempty"`
1861
1862 LinuxOsInfo *LinuxOsInfoFragment `json:"linuxOsInfo,omitempty"`
1863 }
1864
1865
1866
1867 type CustomImagesCreateOrUpdateFuture struct {
1868 azure.FutureAPI
1869
1870
1871 Result func(CustomImagesClient) (CustomImage, error)
1872 }
1873
1874
1875 func (future *CustomImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1876 var azFuture azure.Future
1877 if err := json.Unmarshal(body, &azFuture); err != nil {
1878 return err
1879 }
1880 future.FutureAPI = &azFuture
1881 future.Result = future.result
1882 return nil
1883 }
1884
1885
1886 func (future *CustomImagesCreateOrUpdateFuture) result(client CustomImagesClient) (ci CustomImage, err error) {
1887 var done bool
1888 done, err = future.DoneWithContext(context.Background(), client)
1889 if err != nil {
1890 err = autorest.NewErrorWithError(err, "dtl.CustomImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1891 return
1892 }
1893 if !done {
1894 ci.Response.Response = future.Response()
1895 err = azure.NewAsyncOpIncompleteError("dtl.CustomImagesCreateOrUpdateFuture")
1896 return
1897 }
1898 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1899 if ci.Response.Response, err = future.GetResult(sender); err == nil && ci.Response.Response.StatusCode != http.StatusNoContent {
1900 ci, err = client.CreateOrUpdateResponder(ci.Response.Response)
1901 if err != nil {
1902 err = autorest.NewErrorWithError(err, "dtl.CustomImagesCreateOrUpdateFuture", "Result", ci.Response.Response, "Failure responding to request")
1903 }
1904 }
1905 return
1906 }
1907
1908
1909
1910 type CustomImagesDeleteFuture struct {
1911 azure.FutureAPI
1912
1913
1914 Result func(CustomImagesClient) (autorest.Response, error)
1915 }
1916
1917
1918 func (future *CustomImagesDeleteFuture) UnmarshalJSON(body []byte) error {
1919 var azFuture azure.Future
1920 if err := json.Unmarshal(body, &azFuture); err != nil {
1921 return err
1922 }
1923 future.FutureAPI = &azFuture
1924 future.Result = future.result
1925 return nil
1926 }
1927
1928
1929 func (future *CustomImagesDeleteFuture) result(client CustomImagesClient) (ar autorest.Response, err error) {
1930 var done bool
1931 done, err = future.DoneWithContext(context.Background(), client)
1932 if err != nil {
1933 err = autorest.NewErrorWithError(err, "dtl.CustomImagesDeleteFuture", "Result", future.Response(), "Polling failure")
1934 return
1935 }
1936 if !done {
1937 ar.Response = future.Response()
1938 err = azure.NewAsyncOpIncompleteError("dtl.CustomImagesDeleteFuture")
1939 return
1940 }
1941 ar.Response = future.Response()
1942 return
1943 }
1944
1945
1946 type DataDiskProperties struct {
1947
1948 AttachNewDataDiskOptions *AttachNewDataDiskOptions `json:"attachNewDataDiskOptions,omitempty"`
1949
1950 ExistingLabDiskID *string `json:"existingLabDiskId,omitempty"`
1951
1952 HostCaching HostCachingOptions `json:"hostCaching,omitempty"`
1953 }
1954
1955
1956 type DataDiskPropertiesFragment struct {
1957
1958 AttachNewDataDiskOptions *AttachNewDataDiskOptionsFragment `json:"attachNewDataDiskOptions,omitempty"`
1959
1960 ExistingLabDiskID *string `json:"existingLabDiskId,omitempty"`
1961
1962 HostCaching HostCachingOptions `json:"hostCaching,omitempty"`
1963 }
1964
1965
1966 type DataDiskStorageTypeInfo struct {
1967
1968 Lun *string `json:"lun,omitempty"`
1969
1970 StorageType StorageType `json:"storageType,omitempty"`
1971 }
1972
1973
1974 type DataDiskStorageTypeInfoFragment struct {
1975
1976 Lun *string `json:"lun,omitempty"`
1977
1978 StorageType StorageType `json:"storageType,omitempty"`
1979 }
1980
1981
1982 type DayDetails struct {
1983
1984 Time *string `json:"time,omitempty"`
1985 }
1986
1987
1988 type DayDetailsFragment struct {
1989
1990 Time *string `json:"time,omitempty"`
1991 }
1992
1993
1994 type DetachDataDiskProperties struct {
1995
1996 ExistingLabDiskID *string `json:"existingLabDiskId,omitempty"`
1997 }
1998
1999
2000 type DetachDiskProperties struct {
2001
2002 LeasedByLabVMID *string `json:"leasedByLabVmId,omitempty"`
2003 }
2004
2005
2006 type Disk struct {
2007 autorest.Response `json:"-"`
2008
2009 *DiskProperties `json:"properties,omitempty"`
2010
2011 ID *string `json:"id,omitempty"`
2012
2013 Name *string `json:"name,omitempty"`
2014
2015 Type *string `json:"type,omitempty"`
2016
2017 Location *string `json:"location,omitempty"`
2018
2019 Tags map[string]*string `json:"tags"`
2020 }
2021
2022
2023 func (d Disk) MarshalJSON() ([]byte, error) {
2024 objectMap := make(map[string]interface{})
2025 if d.DiskProperties != nil {
2026 objectMap["properties"] = d.DiskProperties
2027 }
2028 if d.Location != nil {
2029 objectMap["location"] = d.Location
2030 }
2031 if d.Tags != nil {
2032 objectMap["tags"] = d.Tags
2033 }
2034 return json.Marshal(objectMap)
2035 }
2036
2037
2038 func (d *Disk) UnmarshalJSON(body []byte) error {
2039 var m map[string]*json.RawMessage
2040 err := json.Unmarshal(body, &m)
2041 if err != nil {
2042 return err
2043 }
2044 for k, v := range m {
2045 switch k {
2046 case "properties":
2047 if v != nil {
2048 var diskProperties DiskProperties
2049 err = json.Unmarshal(*v, &diskProperties)
2050 if err != nil {
2051 return err
2052 }
2053 d.DiskProperties = &diskProperties
2054 }
2055 case "id":
2056 if v != nil {
2057 var ID string
2058 err = json.Unmarshal(*v, &ID)
2059 if err != nil {
2060 return err
2061 }
2062 d.ID = &ID
2063 }
2064 case "name":
2065 if v != nil {
2066 var name string
2067 err = json.Unmarshal(*v, &name)
2068 if err != nil {
2069 return err
2070 }
2071 d.Name = &name
2072 }
2073 case "type":
2074 if v != nil {
2075 var typeVar string
2076 err = json.Unmarshal(*v, &typeVar)
2077 if err != nil {
2078 return err
2079 }
2080 d.Type = &typeVar
2081 }
2082 case "location":
2083 if v != nil {
2084 var location string
2085 err = json.Unmarshal(*v, &location)
2086 if err != nil {
2087 return err
2088 }
2089 d.Location = &location
2090 }
2091 case "tags":
2092 if v != nil {
2093 var tags map[string]*string
2094 err = json.Unmarshal(*v, &tags)
2095 if err != nil {
2096 return err
2097 }
2098 d.Tags = tags
2099 }
2100 }
2101 }
2102
2103 return nil
2104 }
2105
2106
2107 type DiskFragment struct {
2108
2109 *DiskPropertiesFragment `json:"properties,omitempty"`
2110
2111 Tags map[string]*string `json:"tags"`
2112 }
2113
2114
2115 func (df DiskFragment) MarshalJSON() ([]byte, error) {
2116 objectMap := make(map[string]interface{})
2117 if df.DiskPropertiesFragment != nil {
2118 objectMap["properties"] = df.DiskPropertiesFragment
2119 }
2120 if df.Tags != nil {
2121 objectMap["tags"] = df.Tags
2122 }
2123 return json.Marshal(objectMap)
2124 }
2125
2126
2127 func (df *DiskFragment) UnmarshalJSON(body []byte) error {
2128 var m map[string]*json.RawMessage
2129 err := json.Unmarshal(body, &m)
2130 if err != nil {
2131 return err
2132 }
2133 for k, v := range m {
2134 switch k {
2135 case "properties":
2136 if v != nil {
2137 var diskPropertiesFragment DiskPropertiesFragment
2138 err = json.Unmarshal(*v, &diskPropertiesFragment)
2139 if err != nil {
2140 return err
2141 }
2142 df.DiskPropertiesFragment = &diskPropertiesFragment
2143 }
2144 case "tags":
2145 if v != nil {
2146 var tags map[string]*string
2147 err = json.Unmarshal(*v, &tags)
2148 if err != nil {
2149 return err
2150 }
2151 df.Tags = tags
2152 }
2153 }
2154 }
2155
2156 return nil
2157 }
2158
2159
2160 type DiskList struct {
2161 autorest.Response `json:"-"`
2162
2163 Value *[]Disk `json:"value,omitempty"`
2164
2165 NextLink *string `json:"nextLink,omitempty"`
2166 }
2167
2168
2169 type DiskListIterator struct {
2170 i int
2171 page DiskListPage
2172 }
2173
2174
2175
2176 func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) {
2177 if tracing.IsEnabled() {
2178 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext")
2179 defer func() {
2180 sc := -1
2181 if iter.Response().Response.Response != nil {
2182 sc = iter.Response().Response.Response.StatusCode
2183 }
2184 tracing.EndSpan(ctx, sc, err)
2185 }()
2186 }
2187 iter.i++
2188 if iter.i < len(iter.page.Values()) {
2189 return nil
2190 }
2191 err = iter.page.NextWithContext(ctx)
2192 if err != nil {
2193 iter.i--
2194 return err
2195 }
2196 iter.i = 0
2197 return nil
2198 }
2199
2200
2201
2202
2203 func (iter *DiskListIterator) Next() error {
2204 return iter.NextWithContext(context.Background())
2205 }
2206
2207
2208 func (iter DiskListIterator) NotDone() bool {
2209 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2210 }
2211
2212
2213 func (iter DiskListIterator) Response() DiskList {
2214 return iter.page.Response()
2215 }
2216
2217
2218
2219 func (iter DiskListIterator) Value() Disk {
2220 if !iter.page.NotDone() {
2221 return Disk{}
2222 }
2223 return iter.page.Values()[iter.i]
2224 }
2225
2226
2227 func NewDiskListIterator(page DiskListPage) DiskListIterator {
2228 return DiskListIterator{page: page}
2229 }
2230
2231
2232 func (dl DiskList) IsEmpty() bool {
2233 return dl.Value == nil || len(*dl.Value) == 0
2234 }
2235
2236
2237 func (dl DiskList) hasNextLink() bool {
2238 return dl.NextLink != nil && len(*dl.NextLink) != 0
2239 }
2240
2241
2242
2243 func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) {
2244 if !dl.hasNextLink() {
2245 return nil, nil
2246 }
2247 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2248 autorest.AsJSON(),
2249 autorest.AsGet(),
2250 autorest.WithBaseURL(to.String(dl.NextLink)))
2251 }
2252
2253
2254 type DiskListPage struct {
2255 fn func(context.Context, DiskList) (DiskList, error)
2256 dl DiskList
2257 }
2258
2259
2260
2261 func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) {
2262 if tracing.IsEnabled() {
2263 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext")
2264 defer func() {
2265 sc := -1
2266 if page.Response().Response.Response != nil {
2267 sc = page.Response().Response.Response.StatusCode
2268 }
2269 tracing.EndSpan(ctx, sc, err)
2270 }()
2271 }
2272 for {
2273 next, err := page.fn(ctx, page.dl)
2274 if err != nil {
2275 return err
2276 }
2277 page.dl = next
2278 if !next.hasNextLink() || !next.IsEmpty() {
2279 break
2280 }
2281 }
2282 return nil
2283 }
2284
2285
2286
2287
2288 func (page *DiskListPage) Next() error {
2289 return page.NextWithContext(context.Background())
2290 }
2291
2292
2293 func (page DiskListPage) NotDone() bool {
2294 return !page.dl.IsEmpty()
2295 }
2296
2297
2298 func (page DiskListPage) Response() DiskList {
2299 return page.dl
2300 }
2301
2302
2303 func (page DiskListPage) Values() []Disk {
2304 if page.dl.IsEmpty() {
2305 return nil
2306 }
2307 return *page.dl.Value
2308 }
2309
2310
2311 func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage {
2312 return DiskListPage{
2313 fn: getNextPage,
2314 dl: cur,
2315 }
2316 }
2317
2318
2319 type DiskProperties struct {
2320
2321 DiskType StorageType `json:"diskType,omitempty"`
2322
2323 DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"`
2324
2325 LeasedByLabVMID *string `json:"leasedByLabVmId,omitempty"`
2326
2327 DiskBlobName *string `json:"diskBlobName,omitempty"`
2328
2329 DiskURI *string `json:"diskUri,omitempty"`
2330
2331 CreatedDate *date.Time `json:"createdDate,omitempty"`
2332
2333 HostCaching *string `json:"hostCaching,omitempty"`
2334
2335 ManagedDiskID *string `json:"managedDiskId,omitempty"`
2336
2337 ProvisioningState *string `json:"provisioningState,omitempty"`
2338
2339 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
2340 }
2341
2342
2343 func (dp DiskProperties) MarshalJSON() ([]byte, error) {
2344 objectMap := make(map[string]interface{})
2345 if dp.DiskType != "" {
2346 objectMap["diskType"] = dp.DiskType
2347 }
2348 if dp.DiskSizeGiB != nil {
2349 objectMap["diskSizeGiB"] = dp.DiskSizeGiB
2350 }
2351 if dp.LeasedByLabVMID != nil {
2352 objectMap["leasedByLabVmId"] = dp.LeasedByLabVMID
2353 }
2354 if dp.DiskBlobName != nil {
2355 objectMap["diskBlobName"] = dp.DiskBlobName
2356 }
2357 if dp.DiskURI != nil {
2358 objectMap["diskUri"] = dp.DiskURI
2359 }
2360 if dp.HostCaching != nil {
2361 objectMap["hostCaching"] = dp.HostCaching
2362 }
2363 if dp.ManagedDiskID != nil {
2364 objectMap["managedDiskId"] = dp.ManagedDiskID
2365 }
2366 return json.Marshal(objectMap)
2367 }
2368
2369
2370 type DiskPropertiesFragment struct {
2371
2372 DiskType StorageType `json:"diskType,omitempty"`
2373
2374 DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"`
2375
2376 LeasedByLabVMID *string `json:"leasedByLabVmId,omitempty"`
2377
2378 DiskBlobName *string `json:"diskBlobName,omitempty"`
2379
2380 DiskURI *string `json:"diskUri,omitempty"`
2381
2382 HostCaching *string `json:"hostCaching,omitempty"`
2383
2384 ManagedDiskID *string `json:"managedDiskId,omitempty"`
2385 }
2386
2387
2388 type DisksAttachFuture struct {
2389 azure.FutureAPI
2390
2391
2392 Result func(DisksClient) (autorest.Response, error)
2393 }
2394
2395
2396 func (future *DisksAttachFuture) UnmarshalJSON(body []byte) error {
2397 var azFuture azure.Future
2398 if err := json.Unmarshal(body, &azFuture); err != nil {
2399 return err
2400 }
2401 future.FutureAPI = &azFuture
2402 future.Result = future.result
2403 return nil
2404 }
2405
2406
2407 func (future *DisksAttachFuture) result(client DisksClient) (ar autorest.Response, err error) {
2408 var done bool
2409 done, err = future.DoneWithContext(context.Background(), client)
2410 if err != nil {
2411 err = autorest.NewErrorWithError(err, "dtl.DisksAttachFuture", "Result", future.Response(), "Polling failure")
2412 return
2413 }
2414 if !done {
2415 ar.Response = future.Response()
2416 err = azure.NewAsyncOpIncompleteError("dtl.DisksAttachFuture")
2417 return
2418 }
2419 ar.Response = future.Response()
2420 return
2421 }
2422
2423
2424
2425 type DisksCreateOrUpdateFuture struct {
2426 azure.FutureAPI
2427
2428
2429 Result func(DisksClient) (Disk, error)
2430 }
2431
2432
2433 func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2434 var azFuture azure.Future
2435 if err := json.Unmarshal(body, &azFuture); err != nil {
2436 return err
2437 }
2438 future.FutureAPI = &azFuture
2439 future.Result = future.result
2440 return nil
2441 }
2442
2443
2444 func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) {
2445 var done bool
2446 done, err = future.DoneWithContext(context.Background(), client)
2447 if err != nil {
2448 err = autorest.NewErrorWithError(err, "dtl.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2449 return
2450 }
2451 if !done {
2452 d.Response.Response = future.Response()
2453 err = azure.NewAsyncOpIncompleteError("dtl.DisksCreateOrUpdateFuture")
2454 return
2455 }
2456 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2457 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2458 d, err = client.CreateOrUpdateResponder(d.Response.Response)
2459 if err != nil {
2460 err = autorest.NewErrorWithError(err, "dtl.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
2461 }
2462 }
2463 return
2464 }
2465
2466
2467 type DisksDeleteFuture struct {
2468 azure.FutureAPI
2469
2470
2471 Result func(DisksClient) (autorest.Response, error)
2472 }
2473
2474
2475 func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error {
2476 var azFuture azure.Future
2477 if err := json.Unmarshal(body, &azFuture); err != nil {
2478 return err
2479 }
2480 future.FutureAPI = &azFuture
2481 future.Result = future.result
2482 return nil
2483 }
2484
2485
2486 func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) {
2487 var done bool
2488 done, err = future.DoneWithContext(context.Background(), client)
2489 if err != nil {
2490 err = autorest.NewErrorWithError(err, "dtl.DisksDeleteFuture", "Result", future.Response(), "Polling failure")
2491 return
2492 }
2493 if !done {
2494 ar.Response = future.Response()
2495 err = azure.NewAsyncOpIncompleteError("dtl.DisksDeleteFuture")
2496 return
2497 }
2498 ar.Response = future.Response()
2499 return
2500 }
2501
2502
2503 type DisksDetachFuture struct {
2504 azure.FutureAPI
2505
2506
2507 Result func(DisksClient) (autorest.Response, error)
2508 }
2509
2510
2511 func (future *DisksDetachFuture) UnmarshalJSON(body []byte) error {
2512 var azFuture azure.Future
2513 if err := json.Unmarshal(body, &azFuture); err != nil {
2514 return err
2515 }
2516 future.FutureAPI = &azFuture
2517 future.Result = future.result
2518 return nil
2519 }
2520
2521
2522 func (future *DisksDetachFuture) result(client DisksClient) (ar autorest.Response, err error) {
2523 var done bool
2524 done, err = future.DoneWithContext(context.Background(), client)
2525 if err != nil {
2526 err = autorest.NewErrorWithError(err, "dtl.DisksDetachFuture", "Result", future.Response(), "Polling failure")
2527 return
2528 }
2529 if !done {
2530 ar.Response = future.Response()
2531 err = azure.NewAsyncOpIncompleteError("dtl.DisksDetachFuture")
2532 return
2533 }
2534 ar.Response = future.Response()
2535 return
2536 }
2537
2538
2539 type Environment struct {
2540 autorest.Response `json:"-"`
2541
2542 *EnvironmentProperties `json:"properties,omitempty"`
2543
2544 ID *string `json:"id,omitempty"`
2545
2546 Name *string `json:"name,omitempty"`
2547
2548 Type *string `json:"type,omitempty"`
2549
2550 Location *string `json:"location,omitempty"`
2551
2552 Tags map[string]*string `json:"tags"`
2553 }
2554
2555
2556 func (e Environment) MarshalJSON() ([]byte, error) {
2557 objectMap := make(map[string]interface{})
2558 if e.EnvironmentProperties != nil {
2559 objectMap["properties"] = e.EnvironmentProperties
2560 }
2561 if e.Location != nil {
2562 objectMap["location"] = e.Location
2563 }
2564 if e.Tags != nil {
2565 objectMap["tags"] = e.Tags
2566 }
2567 return json.Marshal(objectMap)
2568 }
2569
2570
2571 func (e *Environment) UnmarshalJSON(body []byte) error {
2572 var m map[string]*json.RawMessage
2573 err := json.Unmarshal(body, &m)
2574 if err != nil {
2575 return err
2576 }
2577 for k, v := range m {
2578 switch k {
2579 case "properties":
2580 if v != nil {
2581 var environmentProperties EnvironmentProperties
2582 err = json.Unmarshal(*v, &environmentProperties)
2583 if err != nil {
2584 return err
2585 }
2586 e.EnvironmentProperties = &environmentProperties
2587 }
2588 case "id":
2589 if v != nil {
2590 var ID string
2591 err = json.Unmarshal(*v, &ID)
2592 if err != nil {
2593 return err
2594 }
2595 e.ID = &ID
2596 }
2597 case "name":
2598 if v != nil {
2599 var name string
2600 err = json.Unmarshal(*v, &name)
2601 if err != nil {
2602 return err
2603 }
2604 e.Name = &name
2605 }
2606 case "type":
2607 if v != nil {
2608 var typeVar string
2609 err = json.Unmarshal(*v, &typeVar)
2610 if err != nil {
2611 return err
2612 }
2613 e.Type = &typeVar
2614 }
2615 case "location":
2616 if v != nil {
2617 var location string
2618 err = json.Unmarshal(*v, &location)
2619 if err != nil {
2620 return err
2621 }
2622 e.Location = &location
2623 }
2624 case "tags":
2625 if v != nil {
2626 var tags map[string]*string
2627 err = json.Unmarshal(*v, &tags)
2628 if err != nil {
2629 return err
2630 }
2631 e.Tags = tags
2632 }
2633 }
2634 }
2635
2636 return nil
2637 }
2638
2639
2640 type EnvironmentDeploymentProperties struct {
2641
2642 ArmTemplateID *string `json:"armTemplateId,omitempty"`
2643
2644 Parameters *[]ArmTemplateParameterProperties `json:"parameters,omitempty"`
2645 }
2646
2647
2648 type EnvironmentDeploymentPropertiesFragment struct {
2649
2650 ArmTemplateID *string `json:"armTemplateId,omitempty"`
2651
2652 Parameters *[]ArmTemplateParameterPropertiesFragment `json:"parameters,omitempty"`
2653 }
2654
2655
2656 type EnvironmentFragment struct {
2657
2658 *EnvironmentPropertiesFragment `json:"properties,omitempty"`
2659
2660 Tags map[string]*string `json:"tags"`
2661 }
2662
2663
2664 func (ef EnvironmentFragment) MarshalJSON() ([]byte, error) {
2665 objectMap := make(map[string]interface{})
2666 if ef.EnvironmentPropertiesFragment != nil {
2667 objectMap["properties"] = ef.EnvironmentPropertiesFragment
2668 }
2669 if ef.Tags != nil {
2670 objectMap["tags"] = ef.Tags
2671 }
2672 return json.Marshal(objectMap)
2673 }
2674
2675
2676 func (ef *EnvironmentFragment) UnmarshalJSON(body []byte) error {
2677 var m map[string]*json.RawMessage
2678 err := json.Unmarshal(body, &m)
2679 if err != nil {
2680 return err
2681 }
2682 for k, v := range m {
2683 switch k {
2684 case "properties":
2685 if v != nil {
2686 var environmentPropertiesFragment EnvironmentPropertiesFragment
2687 err = json.Unmarshal(*v, &environmentPropertiesFragment)
2688 if err != nil {
2689 return err
2690 }
2691 ef.EnvironmentPropertiesFragment = &environmentPropertiesFragment
2692 }
2693 case "tags":
2694 if v != nil {
2695 var tags map[string]*string
2696 err = json.Unmarshal(*v, &tags)
2697 if err != nil {
2698 return err
2699 }
2700 ef.Tags = tags
2701 }
2702 }
2703 }
2704
2705 return nil
2706 }
2707
2708
2709 type EnvironmentList struct {
2710 autorest.Response `json:"-"`
2711
2712 Value *[]Environment `json:"value,omitempty"`
2713
2714 NextLink *string `json:"nextLink,omitempty"`
2715 }
2716
2717
2718 type EnvironmentListIterator struct {
2719 i int
2720 page EnvironmentListPage
2721 }
2722
2723
2724
2725 func (iter *EnvironmentListIterator) NextWithContext(ctx context.Context) (err error) {
2726 if tracing.IsEnabled() {
2727 ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentListIterator.NextWithContext")
2728 defer func() {
2729 sc := -1
2730 if iter.Response().Response.Response != nil {
2731 sc = iter.Response().Response.Response.StatusCode
2732 }
2733 tracing.EndSpan(ctx, sc, err)
2734 }()
2735 }
2736 iter.i++
2737 if iter.i < len(iter.page.Values()) {
2738 return nil
2739 }
2740 err = iter.page.NextWithContext(ctx)
2741 if err != nil {
2742 iter.i--
2743 return err
2744 }
2745 iter.i = 0
2746 return nil
2747 }
2748
2749
2750
2751
2752 func (iter *EnvironmentListIterator) Next() error {
2753 return iter.NextWithContext(context.Background())
2754 }
2755
2756
2757 func (iter EnvironmentListIterator) NotDone() bool {
2758 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2759 }
2760
2761
2762 func (iter EnvironmentListIterator) Response() EnvironmentList {
2763 return iter.page.Response()
2764 }
2765
2766
2767
2768 func (iter EnvironmentListIterator) Value() Environment {
2769 if !iter.page.NotDone() {
2770 return Environment{}
2771 }
2772 return iter.page.Values()[iter.i]
2773 }
2774
2775
2776 func NewEnvironmentListIterator(page EnvironmentListPage) EnvironmentListIterator {
2777 return EnvironmentListIterator{page: page}
2778 }
2779
2780
2781 func (el EnvironmentList) IsEmpty() bool {
2782 return el.Value == nil || len(*el.Value) == 0
2783 }
2784
2785
2786 func (el EnvironmentList) hasNextLink() bool {
2787 return el.NextLink != nil && len(*el.NextLink) != 0
2788 }
2789
2790
2791
2792 func (el EnvironmentList) environmentListPreparer(ctx context.Context) (*http.Request, error) {
2793 if !el.hasNextLink() {
2794 return nil, nil
2795 }
2796 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2797 autorest.AsJSON(),
2798 autorest.AsGet(),
2799 autorest.WithBaseURL(to.String(el.NextLink)))
2800 }
2801
2802
2803 type EnvironmentListPage struct {
2804 fn func(context.Context, EnvironmentList) (EnvironmentList, error)
2805 el EnvironmentList
2806 }
2807
2808
2809
2810 func (page *EnvironmentListPage) NextWithContext(ctx context.Context) (err error) {
2811 if tracing.IsEnabled() {
2812 ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentListPage.NextWithContext")
2813 defer func() {
2814 sc := -1
2815 if page.Response().Response.Response != nil {
2816 sc = page.Response().Response.Response.StatusCode
2817 }
2818 tracing.EndSpan(ctx, sc, err)
2819 }()
2820 }
2821 for {
2822 next, err := page.fn(ctx, page.el)
2823 if err != nil {
2824 return err
2825 }
2826 page.el = next
2827 if !next.hasNextLink() || !next.IsEmpty() {
2828 break
2829 }
2830 }
2831 return nil
2832 }
2833
2834
2835
2836
2837 func (page *EnvironmentListPage) Next() error {
2838 return page.NextWithContext(context.Background())
2839 }
2840
2841
2842 func (page EnvironmentListPage) NotDone() bool {
2843 return !page.el.IsEmpty()
2844 }
2845
2846
2847 func (page EnvironmentListPage) Response() EnvironmentList {
2848 return page.el
2849 }
2850
2851
2852 func (page EnvironmentListPage) Values() []Environment {
2853 if page.el.IsEmpty() {
2854 return nil
2855 }
2856 return *page.el.Value
2857 }
2858
2859
2860 func NewEnvironmentListPage(cur EnvironmentList, getNextPage func(context.Context, EnvironmentList) (EnvironmentList, error)) EnvironmentListPage {
2861 return EnvironmentListPage{
2862 fn: getNextPage,
2863 el: cur,
2864 }
2865 }
2866
2867
2868 type EnvironmentProperties struct {
2869
2870 DeploymentProperties *EnvironmentDeploymentProperties `json:"deploymentProperties,omitempty"`
2871
2872 ArmTemplateDisplayName *string `json:"armTemplateDisplayName,omitempty"`
2873
2874 ResourceGroupID *string `json:"resourceGroupId,omitempty"`
2875
2876 CreatedByUser *string `json:"createdByUser,omitempty"`
2877
2878 ProvisioningState *string `json:"provisioningState,omitempty"`
2879
2880 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
2881 }
2882
2883
2884 func (ep EnvironmentProperties) MarshalJSON() ([]byte, error) {
2885 objectMap := make(map[string]interface{})
2886 if ep.DeploymentProperties != nil {
2887 objectMap["deploymentProperties"] = ep.DeploymentProperties
2888 }
2889 if ep.ArmTemplateDisplayName != nil {
2890 objectMap["armTemplateDisplayName"] = ep.ArmTemplateDisplayName
2891 }
2892 return json.Marshal(objectMap)
2893 }
2894
2895
2896 type EnvironmentPropertiesFragment struct {
2897
2898 DeploymentProperties *EnvironmentDeploymentPropertiesFragment `json:"deploymentProperties,omitempty"`
2899
2900 ArmTemplateDisplayName *string `json:"armTemplateDisplayName,omitempty"`
2901 }
2902
2903
2904
2905 type EnvironmentsCreateOrUpdateFuture struct {
2906 azure.FutureAPI
2907
2908
2909 Result func(EnvironmentsClient) (Environment, error)
2910 }
2911
2912
2913 func (future *EnvironmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2914 var azFuture azure.Future
2915 if err := json.Unmarshal(body, &azFuture); err != nil {
2916 return err
2917 }
2918 future.FutureAPI = &azFuture
2919 future.Result = future.result
2920 return nil
2921 }
2922
2923
2924 func (future *EnvironmentsCreateOrUpdateFuture) result(client EnvironmentsClient) (e Environment, err error) {
2925 var done bool
2926 done, err = future.DoneWithContext(context.Background(), client)
2927 if err != nil {
2928 err = autorest.NewErrorWithError(err, "dtl.EnvironmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2929 return
2930 }
2931 if !done {
2932 e.Response.Response = future.Response()
2933 err = azure.NewAsyncOpIncompleteError("dtl.EnvironmentsCreateOrUpdateFuture")
2934 return
2935 }
2936 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2937 if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent {
2938 e, err = client.CreateOrUpdateResponder(e.Response.Response)
2939 if err != nil {
2940 err = autorest.NewErrorWithError(err, "dtl.EnvironmentsCreateOrUpdateFuture", "Result", e.Response.Response, "Failure responding to request")
2941 }
2942 }
2943 return
2944 }
2945
2946
2947
2948 type EnvironmentsDeleteFuture struct {
2949 azure.FutureAPI
2950
2951
2952 Result func(EnvironmentsClient) (autorest.Response, error)
2953 }
2954
2955
2956 func (future *EnvironmentsDeleteFuture) UnmarshalJSON(body []byte) error {
2957 var azFuture azure.Future
2958 if err := json.Unmarshal(body, &azFuture); err != nil {
2959 return err
2960 }
2961 future.FutureAPI = &azFuture
2962 future.Result = future.result
2963 return nil
2964 }
2965
2966
2967 func (future *EnvironmentsDeleteFuture) result(client EnvironmentsClient) (ar autorest.Response, err error) {
2968 var done bool
2969 done, err = future.DoneWithContext(context.Background(), client)
2970 if err != nil {
2971 err = autorest.NewErrorWithError(err, "dtl.EnvironmentsDeleteFuture", "Result", future.Response(), "Polling failure")
2972 return
2973 }
2974 if !done {
2975 ar.Response = future.Response()
2976 err = azure.NewAsyncOpIncompleteError("dtl.EnvironmentsDeleteFuture")
2977 return
2978 }
2979 ar.Response = future.Response()
2980 return
2981 }
2982
2983
2984 type EvaluatePoliciesProperties struct {
2985
2986 FactName *string `json:"factName,omitempty"`
2987
2988 FactData *string `json:"factData,omitempty"`
2989
2990 ValueOffset *string `json:"valueOffset,omitempty"`
2991
2992 UserObjectID *string `json:"userObjectId,omitempty"`
2993 }
2994
2995
2996 type EvaluatePoliciesRequest struct {
2997
2998 Policies *[]EvaluatePoliciesProperties `json:"policies,omitempty"`
2999 }
3000
3001
3002 type EvaluatePoliciesResponse struct {
3003 autorest.Response `json:"-"`
3004
3005 Results *[]PolicySetResult `json:"results,omitempty"`
3006 }
3007
3008
3009 type Event struct {
3010
3011 EventName NotificationChannelEventType `json:"eventName,omitempty"`
3012 }
3013
3014
3015 type EventFragment struct {
3016
3017 EventName NotificationChannelEventType `json:"eventName,omitempty"`
3018 }
3019
3020
3021 type ExportResourceUsageParameters struct {
3022
3023 BlobStorageAbsoluteSasURI *string `json:"blobStorageAbsoluteSasUri,omitempty"`
3024
3025 UsageStartDate *date.Time `json:"usageStartDate,omitempty"`
3026 }
3027
3028
3029 type ExternalSubnet struct {
3030
3031 ID *string `json:"id,omitempty"`
3032
3033 Name *string `json:"name,omitempty"`
3034 }
3035
3036
3037 type ExternalSubnetFragment struct {
3038
3039 ID *string `json:"id,omitempty"`
3040
3041 Name *string `json:"name,omitempty"`
3042 }
3043
3044
3045 type Formula struct {
3046 autorest.Response `json:"-"`
3047
3048 *FormulaProperties `json:"properties,omitempty"`
3049
3050 ID *string `json:"id,omitempty"`
3051
3052 Name *string `json:"name,omitempty"`
3053
3054 Type *string `json:"type,omitempty"`
3055
3056 Location *string `json:"location,omitempty"`
3057
3058 Tags map[string]*string `json:"tags"`
3059 }
3060
3061
3062 func (f Formula) MarshalJSON() ([]byte, error) {
3063 objectMap := make(map[string]interface{})
3064 if f.FormulaProperties != nil {
3065 objectMap["properties"] = f.FormulaProperties
3066 }
3067 if f.Location != nil {
3068 objectMap["location"] = f.Location
3069 }
3070 if f.Tags != nil {
3071 objectMap["tags"] = f.Tags
3072 }
3073 return json.Marshal(objectMap)
3074 }
3075
3076
3077 func (f *Formula) UnmarshalJSON(body []byte) error {
3078 var m map[string]*json.RawMessage
3079 err := json.Unmarshal(body, &m)
3080 if err != nil {
3081 return err
3082 }
3083 for k, v := range m {
3084 switch k {
3085 case "properties":
3086 if v != nil {
3087 var formulaProperties FormulaProperties
3088 err = json.Unmarshal(*v, &formulaProperties)
3089 if err != nil {
3090 return err
3091 }
3092 f.FormulaProperties = &formulaProperties
3093 }
3094 case "id":
3095 if v != nil {
3096 var ID string
3097 err = json.Unmarshal(*v, &ID)
3098 if err != nil {
3099 return err
3100 }
3101 f.ID = &ID
3102 }
3103 case "name":
3104 if v != nil {
3105 var name string
3106 err = json.Unmarshal(*v, &name)
3107 if err != nil {
3108 return err
3109 }
3110 f.Name = &name
3111 }
3112 case "type":
3113 if v != nil {
3114 var typeVar string
3115 err = json.Unmarshal(*v, &typeVar)
3116 if err != nil {
3117 return err
3118 }
3119 f.Type = &typeVar
3120 }
3121 case "location":
3122 if v != nil {
3123 var location string
3124 err = json.Unmarshal(*v, &location)
3125 if err != nil {
3126 return err
3127 }
3128 f.Location = &location
3129 }
3130 case "tags":
3131 if v != nil {
3132 var tags map[string]*string
3133 err = json.Unmarshal(*v, &tags)
3134 if err != nil {
3135 return err
3136 }
3137 f.Tags = tags
3138 }
3139 }
3140 }
3141
3142 return nil
3143 }
3144
3145
3146 type FormulaFragment struct {
3147
3148 *FormulaPropertiesFragment `json:"properties,omitempty"`
3149
3150 Tags map[string]*string `json:"tags"`
3151 }
3152
3153
3154 func (ff FormulaFragment) MarshalJSON() ([]byte, error) {
3155 objectMap := make(map[string]interface{})
3156 if ff.FormulaPropertiesFragment != nil {
3157 objectMap["properties"] = ff.FormulaPropertiesFragment
3158 }
3159 if ff.Tags != nil {
3160 objectMap["tags"] = ff.Tags
3161 }
3162 return json.Marshal(objectMap)
3163 }
3164
3165
3166 func (ff *FormulaFragment) UnmarshalJSON(body []byte) error {
3167 var m map[string]*json.RawMessage
3168 err := json.Unmarshal(body, &m)
3169 if err != nil {
3170 return err
3171 }
3172 for k, v := range m {
3173 switch k {
3174 case "properties":
3175 if v != nil {
3176 var formulaPropertiesFragment FormulaPropertiesFragment
3177 err = json.Unmarshal(*v, &formulaPropertiesFragment)
3178 if err != nil {
3179 return err
3180 }
3181 ff.FormulaPropertiesFragment = &formulaPropertiesFragment
3182 }
3183 case "tags":
3184 if v != nil {
3185 var tags map[string]*string
3186 err = json.Unmarshal(*v, &tags)
3187 if err != nil {
3188 return err
3189 }
3190 ff.Tags = tags
3191 }
3192 }
3193 }
3194
3195 return nil
3196 }
3197
3198
3199 type FormulaList struct {
3200 autorest.Response `json:"-"`
3201
3202 Value *[]Formula `json:"value,omitempty"`
3203
3204 NextLink *string `json:"nextLink,omitempty"`
3205 }
3206
3207
3208 type FormulaListIterator struct {
3209 i int
3210 page FormulaListPage
3211 }
3212
3213
3214
3215 func (iter *FormulaListIterator) NextWithContext(ctx context.Context) (err error) {
3216 if tracing.IsEnabled() {
3217 ctx = tracing.StartSpan(ctx, fqdn+"/FormulaListIterator.NextWithContext")
3218 defer func() {
3219 sc := -1
3220 if iter.Response().Response.Response != nil {
3221 sc = iter.Response().Response.Response.StatusCode
3222 }
3223 tracing.EndSpan(ctx, sc, err)
3224 }()
3225 }
3226 iter.i++
3227 if iter.i < len(iter.page.Values()) {
3228 return nil
3229 }
3230 err = iter.page.NextWithContext(ctx)
3231 if err != nil {
3232 iter.i--
3233 return err
3234 }
3235 iter.i = 0
3236 return nil
3237 }
3238
3239
3240
3241
3242 func (iter *FormulaListIterator) Next() error {
3243 return iter.NextWithContext(context.Background())
3244 }
3245
3246
3247 func (iter FormulaListIterator) NotDone() bool {
3248 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3249 }
3250
3251
3252 func (iter FormulaListIterator) Response() FormulaList {
3253 return iter.page.Response()
3254 }
3255
3256
3257
3258 func (iter FormulaListIterator) Value() Formula {
3259 if !iter.page.NotDone() {
3260 return Formula{}
3261 }
3262 return iter.page.Values()[iter.i]
3263 }
3264
3265
3266 func NewFormulaListIterator(page FormulaListPage) FormulaListIterator {
3267 return FormulaListIterator{page: page}
3268 }
3269
3270
3271 func (fl FormulaList) IsEmpty() bool {
3272 return fl.Value == nil || len(*fl.Value) == 0
3273 }
3274
3275
3276 func (fl FormulaList) hasNextLink() bool {
3277 return fl.NextLink != nil && len(*fl.NextLink) != 0
3278 }
3279
3280
3281
3282 func (fl FormulaList) formulaListPreparer(ctx context.Context) (*http.Request, error) {
3283 if !fl.hasNextLink() {
3284 return nil, nil
3285 }
3286 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3287 autorest.AsJSON(),
3288 autorest.AsGet(),
3289 autorest.WithBaseURL(to.String(fl.NextLink)))
3290 }
3291
3292
3293 type FormulaListPage struct {
3294 fn func(context.Context, FormulaList) (FormulaList, error)
3295 fl FormulaList
3296 }
3297
3298
3299
3300 func (page *FormulaListPage) NextWithContext(ctx context.Context) (err error) {
3301 if tracing.IsEnabled() {
3302 ctx = tracing.StartSpan(ctx, fqdn+"/FormulaListPage.NextWithContext")
3303 defer func() {
3304 sc := -1
3305 if page.Response().Response.Response != nil {
3306 sc = page.Response().Response.Response.StatusCode
3307 }
3308 tracing.EndSpan(ctx, sc, err)
3309 }()
3310 }
3311 for {
3312 next, err := page.fn(ctx, page.fl)
3313 if err != nil {
3314 return err
3315 }
3316 page.fl = next
3317 if !next.hasNextLink() || !next.IsEmpty() {
3318 break
3319 }
3320 }
3321 return nil
3322 }
3323
3324
3325
3326
3327 func (page *FormulaListPage) Next() error {
3328 return page.NextWithContext(context.Background())
3329 }
3330
3331
3332 func (page FormulaListPage) NotDone() bool {
3333 return !page.fl.IsEmpty()
3334 }
3335
3336
3337 func (page FormulaListPage) Response() FormulaList {
3338 return page.fl
3339 }
3340
3341
3342 func (page FormulaListPage) Values() []Formula {
3343 if page.fl.IsEmpty() {
3344 return nil
3345 }
3346 return *page.fl.Value
3347 }
3348
3349
3350 func NewFormulaListPage(cur FormulaList, getNextPage func(context.Context, FormulaList) (FormulaList, error)) FormulaListPage {
3351 return FormulaListPage{
3352 fn: getNextPage,
3353 fl: cur,
3354 }
3355 }
3356
3357
3358 type FormulaProperties struct {
3359
3360 Description *string `json:"description,omitempty"`
3361
3362 Author *string `json:"author,omitempty"`
3363
3364 OsType *string `json:"osType,omitempty"`
3365
3366 CreationDate *date.Time `json:"creationDate,omitempty"`
3367
3368 FormulaContent *LabVirtualMachineCreationParameter `json:"formulaContent,omitempty"`
3369
3370 VM *FormulaPropertiesFromVM `json:"vm,omitempty"`
3371
3372 ProvisioningState *string `json:"provisioningState,omitempty"`
3373
3374 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
3375 }
3376
3377
3378 func (fp FormulaProperties) MarshalJSON() ([]byte, error) {
3379 objectMap := make(map[string]interface{})
3380 if fp.Description != nil {
3381 objectMap["description"] = fp.Description
3382 }
3383 if fp.Author != nil {
3384 objectMap["author"] = fp.Author
3385 }
3386 if fp.OsType != nil {
3387 objectMap["osType"] = fp.OsType
3388 }
3389 if fp.FormulaContent != nil {
3390 objectMap["formulaContent"] = fp.FormulaContent
3391 }
3392 if fp.VM != nil {
3393 objectMap["vm"] = fp.VM
3394 }
3395 return json.Marshal(objectMap)
3396 }
3397
3398
3399 type FormulaPropertiesFragment struct {
3400
3401 Description *string `json:"description,omitempty"`
3402
3403 Author *string `json:"author,omitempty"`
3404
3405 OsType *string `json:"osType,omitempty"`
3406
3407 FormulaContent *LabVirtualMachineCreationParameterFragment `json:"formulaContent,omitempty"`
3408
3409 VM *FormulaPropertiesFromVMFragment `json:"vm,omitempty"`
3410 }
3411
3412
3413 type FormulaPropertiesFromVM struct {
3414
3415 LabVMID *string `json:"labVmId,omitempty"`
3416 }
3417
3418
3419 type FormulaPropertiesFromVMFragment struct {
3420
3421 LabVMID *string `json:"labVmId,omitempty"`
3422 }
3423
3424
3425
3426 type FormulasCreateOrUpdateFuture struct {
3427 azure.FutureAPI
3428
3429
3430 Result func(FormulasClient) (Formula, error)
3431 }
3432
3433
3434 func (future *FormulasCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
3435 var azFuture azure.Future
3436 if err := json.Unmarshal(body, &azFuture); err != nil {
3437 return err
3438 }
3439 future.FutureAPI = &azFuture
3440 future.Result = future.result
3441 return nil
3442 }
3443
3444
3445 func (future *FormulasCreateOrUpdateFuture) result(client FormulasClient) (f Formula, err error) {
3446 var done bool
3447 done, err = future.DoneWithContext(context.Background(), client)
3448 if err != nil {
3449 err = autorest.NewErrorWithError(err, "dtl.FormulasCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3450 return
3451 }
3452 if !done {
3453 f.Response.Response = future.Response()
3454 err = azure.NewAsyncOpIncompleteError("dtl.FormulasCreateOrUpdateFuture")
3455 return
3456 }
3457 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3458 if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent {
3459 f, err = client.CreateOrUpdateResponder(f.Response.Response)
3460 if err != nil {
3461 err = autorest.NewErrorWithError(err, "dtl.FormulasCreateOrUpdateFuture", "Result", f.Response.Response, "Failure responding to request")
3462 }
3463 }
3464 return
3465 }
3466
3467
3468 type GalleryImage struct {
3469
3470 *GalleryImageProperties `json:"properties,omitempty"`
3471
3472 ID *string `json:"id,omitempty"`
3473
3474 Name *string `json:"name,omitempty"`
3475
3476 Type *string `json:"type,omitempty"`
3477
3478 Location *string `json:"location,omitempty"`
3479
3480 Tags map[string]*string `json:"tags"`
3481 }
3482
3483
3484 func (gi GalleryImage) MarshalJSON() ([]byte, error) {
3485 objectMap := make(map[string]interface{})
3486 if gi.GalleryImageProperties != nil {
3487 objectMap["properties"] = gi.GalleryImageProperties
3488 }
3489 if gi.Location != nil {
3490 objectMap["location"] = gi.Location
3491 }
3492 if gi.Tags != nil {
3493 objectMap["tags"] = gi.Tags
3494 }
3495 return json.Marshal(objectMap)
3496 }
3497
3498
3499 func (gi *GalleryImage) UnmarshalJSON(body []byte) error {
3500 var m map[string]*json.RawMessage
3501 err := json.Unmarshal(body, &m)
3502 if err != nil {
3503 return err
3504 }
3505 for k, v := range m {
3506 switch k {
3507 case "properties":
3508 if v != nil {
3509 var galleryImageProperties GalleryImageProperties
3510 err = json.Unmarshal(*v, &galleryImageProperties)
3511 if err != nil {
3512 return err
3513 }
3514 gi.GalleryImageProperties = &galleryImageProperties
3515 }
3516 case "id":
3517 if v != nil {
3518 var ID string
3519 err = json.Unmarshal(*v, &ID)
3520 if err != nil {
3521 return err
3522 }
3523 gi.ID = &ID
3524 }
3525 case "name":
3526 if v != nil {
3527 var name string
3528 err = json.Unmarshal(*v, &name)
3529 if err != nil {
3530 return err
3531 }
3532 gi.Name = &name
3533 }
3534 case "type":
3535 if v != nil {
3536 var typeVar string
3537 err = json.Unmarshal(*v, &typeVar)
3538 if err != nil {
3539 return err
3540 }
3541 gi.Type = &typeVar
3542 }
3543 case "location":
3544 if v != nil {
3545 var location string
3546 err = json.Unmarshal(*v, &location)
3547 if err != nil {
3548 return err
3549 }
3550 gi.Location = &location
3551 }
3552 case "tags":
3553 if v != nil {
3554 var tags map[string]*string
3555 err = json.Unmarshal(*v, &tags)
3556 if err != nil {
3557 return err
3558 }
3559 gi.Tags = tags
3560 }
3561 }
3562 }
3563
3564 return nil
3565 }
3566
3567
3568 type GalleryImageList struct {
3569 autorest.Response `json:"-"`
3570
3571 Value *[]GalleryImage `json:"value,omitempty"`
3572
3573 NextLink *string `json:"nextLink,omitempty"`
3574 }
3575
3576
3577 type GalleryImageListIterator struct {
3578 i int
3579 page GalleryImageListPage
3580 }
3581
3582
3583
3584 func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) {
3585 if tracing.IsEnabled() {
3586 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext")
3587 defer func() {
3588 sc := -1
3589 if iter.Response().Response.Response != nil {
3590 sc = iter.Response().Response.Response.StatusCode
3591 }
3592 tracing.EndSpan(ctx, sc, err)
3593 }()
3594 }
3595 iter.i++
3596 if iter.i < len(iter.page.Values()) {
3597 return nil
3598 }
3599 err = iter.page.NextWithContext(ctx)
3600 if err != nil {
3601 iter.i--
3602 return err
3603 }
3604 iter.i = 0
3605 return nil
3606 }
3607
3608
3609
3610
3611 func (iter *GalleryImageListIterator) Next() error {
3612 return iter.NextWithContext(context.Background())
3613 }
3614
3615
3616 func (iter GalleryImageListIterator) NotDone() bool {
3617 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3618 }
3619
3620
3621 func (iter GalleryImageListIterator) Response() GalleryImageList {
3622 return iter.page.Response()
3623 }
3624
3625
3626
3627 func (iter GalleryImageListIterator) Value() GalleryImage {
3628 if !iter.page.NotDone() {
3629 return GalleryImage{}
3630 }
3631 return iter.page.Values()[iter.i]
3632 }
3633
3634
3635 func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator {
3636 return GalleryImageListIterator{page: page}
3637 }
3638
3639
3640 func (gil GalleryImageList) IsEmpty() bool {
3641 return gil.Value == nil || len(*gil.Value) == 0
3642 }
3643
3644
3645 func (gil GalleryImageList) hasNextLink() bool {
3646 return gil.NextLink != nil && len(*gil.NextLink) != 0
3647 }
3648
3649
3650
3651 func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) {
3652 if !gil.hasNextLink() {
3653 return nil, nil
3654 }
3655 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3656 autorest.AsJSON(),
3657 autorest.AsGet(),
3658 autorest.WithBaseURL(to.String(gil.NextLink)))
3659 }
3660
3661
3662 type GalleryImageListPage struct {
3663 fn func(context.Context, GalleryImageList) (GalleryImageList, error)
3664 gil GalleryImageList
3665 }
3666
3667
3668
3669 func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) {
3670 if tracing.IsEnabled() {
3671 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext")
3672 defer func() {
3673 sc := -1
3674 if page.Response().Response.Response != nil {
3675 sc = page.Response().Response.Response.StatusCode
3676 }
3677 tracing.EndSpan(ctx, sc, err)
3678 }()
3679 }
3680 for {
3681 next, err := page.fn(ctx, page.gil)
3682 if err != nil {
3683 return err
3684 }
3685 page.gil = next
3686 if !next.hasNextLink() || !next.IsEmpty() {
3687 break
3688 }
3689 }
3690 return nil
3691 }
3692
3693
3694
3695
3696 func (page *GalleryImageListPage) Next() error {
3697 return page.NextWithContext(context.Background())
3698 }
3699
3700
3701 func (page GalleryImageListPage) NotDone() bool {
3702 return !page.gil.IsEmpty()
3703 }
3704
3705
3706 func (page GalleryImageListPage) Response() GalleryImageList {
3707 return page.gil
3708 }
3709
3710
3711 func (page GalleryImageListPage) Values() []GalleryImage {
3712 if page.gil.IsEmpty() {
3713 return nil
3714 }
3715 return *page.gil.Value
3716 }
3717
3718
3719 func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage {
3720 return GalleryImageListPage{
3721 fn: getNextPage,
3722 gil: cur,
3723 }
3724 }
3725
3726
3727 type GalleryImageProperties struct {
3728
3729 Author *string `json:"author,omitempty"`
3730
3731 CreatedDate *date.Time `json:"createdDate,omitempty"`
3732
3733 Description *string `json:"description,omitempty"`
3734
3735 ImageReference *GalleryImageReference `json:"imageReference,omitempty"`
3736
3737 Icon *string `json:"icon,omitempty"`
3738
3739 Enabled *bool `json:"enabled,omitempty"`
3740
3741 PlanID *string `json:"planId,omitempty"`
3742
3743 IsPlanAuthorized *bool `json:"isPlanAuthorized,omitempty"`
3744 }
3745
3746
3747 func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) {
3748 objectMap := make(map[string]interface{})
3749 if gip.Author != nil {
3750 objectMap["author"] = gip.Author
3751 }
3752 if gip.Description != nil {
3753 objectMap["description"] = gip.Description
3754 }
3755 if gip.ImageReference != nil {
3756 objectMap["imageReference"] = gip.ImageReference
3757 }
3758 if gip.Icon != nil {
3759 objectMap["icon"] = gip.Icon
3760 }
3761 if gip.Enabled != nil {
3762 objectMap["enabled"] = gip.Enabled
3763 }
3764 if gip.PlanID != nil {
3765 objectMap["planId"] = gip.PlanID
3766 }
3767 if gip.IsPlanAuthorized != nil {
3768 objectMap["isPlanAuthorized"] = gip.IsPlanAuthorized
3769 }
3770 return json.Marshal(objectMap)
3771 }
3772
3773
3774 type GalleryImageReference struct {
3775
3776 Offer *string `json:"offer,omitempty"`
3777
3778 Publisher *string `json:"publisher,omitempty"`
3779
3780 Sku *string `json:"sku,omitempty"`
3781
3782 OsType *string `json:"osType,omitempty"`
3783
3784 Version *string `json:"version,omitempty"`
3785 }
3786
3787
3788 type GalleryImageReferenceFragment struct {
3789
3790 Offer *string `json:"offer,omitempty"`
3791
3792 Publisher *string `json:"publisher,omitempty"`
3793
3794 Sku *string `json:"sku,omitempty"`
3795
3796 OsType *string `json:"osType,omitempty"`
3797
3798 Version *string `json:"version,omitempty"`
3799 }
3800
3801
3802 type GenerateArmTemplateRequest struct {
3803
3804 VirtualMachineName *string `json:"virtualMachineName,omitempty"`
3805
3806 Parameters *[]ParameterInfo `json:"parameters,omitempty"`
3807
3808 Location *string `json:"location,omitempty"`
3809
3810 FileUploadOptions FileUploadOptions `json:"fileUploadOptions,omitempty"`
3811 }
3812
3813
3814 type GenerateUploadURIParameter struct {
3815
3816 BlobName *string `json:"blobName,omitempty"`
3817 }
3818
3819
3820 type GenerateUploadURIResponse struct {
3821 autorest.Response `json:"-"`
3822
3823 UploadURI *string `json:"uploadUri,omitempty"`
3824 }
3825
3826
3827
3828 type GlobalSchedulesExecuteFuture struct {
3829 azure.FutureAPI
3830
3831
3832 Result func(GlobalSchedulesClient) (autorest.Response, error)
3833 }
3834
3835
3836 func (future *GlobalSchedulesExecuteFuture) UnmarshalJSON(body []byte) error {
3837 var azFuture azure.Future
3838 if err := json.Unmarshal(body, &azFuture); err != nil {
3839 return err
3840 }
3841 future.FutureAPI = &azFuture
3842 future.Result = future.result
3843 return nil
3844 }
3845
3846
3847 func (future *GlobalSchedulesExecuteFuture) result(client GlobalSchedulesClient) (ar autorest.Response, err error) {
3848 var done bool
3849 done, err = future.DoneWithContext(context.Background(), client)
3850 if err != nil {
3851 err = autorest.NewErrorWithError(err, "dtl.GlobalSchedulesExecuteFuture", "Result", future.Response(), "Polling failure")
3852 return
3853 }
3854 if !done {
3855 ar.Response = future.Response()
3856 err = azure.NewAsyncOpIncompleteError("dtl.GlobalSchedulesExecuteFuture")
3857 return
3858 }
3859 ar.Response = future.Response()
3860 return
3861 }
3862
3863
3864
3865 type GlobalSchedulesRetargetFuture struct {
3866 azure.FutureAPI
3867
3868
3869 Result func(GlobalSchedulesClient) (autorest.Response, error)
3870 }
3871
3872
3873 func (future *GlobalSchedulesRetargetFuture) UnmarshalJSON(body []byte) error {
3874 var azFuture azure.Future
3875 if err := json.Unmarshal(body, &azFuture); err != nil {
3876 return err
3877 }
3878 future.FutureAPI = &azFuture
3879 future.Result = future.result
3880 return nil
3881 }
3882
3883
3884 func (future *GlobalSchedulesRetargetFuture) result(client GlobalSchedulesClient) (ar autorest.Response, err error) {
3885 var done bool
3886 done, err = future.DoneWithContext(context.Background(), client)
3887 if err != nil {
3888 err = autorest.NewErrorWithError(err, "dtl.GlobalSchedulesRetargetFuture", "Result", future.Response(), "Polling failure")
3889 return
3890 }
3891 if !done {
3892 ar.Response = future.Response()
3893 err = azure.NewAsyncOpIncompleteError("dtl.GlobalSchedulesRetargetFuture")
3894 return
3895 }
3896 ar.Response = future.Response()
3897 return
3898 }
3899
3900
3901 type HourDetails struct {
3902
3903 Minute *int32 `json:"minute,omitempty"`
3904 }
3905
3906
3907 type HourDetailsFragment struct {
3908
3909 Minute *int32 `json:"minute,omitempty"`
3910 }
3911
3912
3913 type IdentityProperties struct {
3914
3915 Type *string `json:"type,omitempty"`
3916
3917 PrincipalID *string `json:"principalId,omitempty"`
3918
3919 TenantID *string `json:"tenantId,omitempty"`
3920
3921 ClientSecretURL *string `json:"clientSecretUrl,omitempty"`
3922 }
3923
3924
3925
3926 type ImportLabVirtualMachineRequest struct {
3927
3928 SourceVirtualMachineResourceID *string `json:"sourceVirtualMachineResourceId,omitempty"`
3929
3930 DestinationVirtualMachineName *string `json:"destinationVirtualMachineName,omitempty"`
3931 }
3932
3933
3934
3935 type InboundNatRule struct {
3936
3937 TransportProtocol TransportProtocol `json:"transportProtocol,omitempty"`
3938
3939 FrontendPort *int32 `json:"frontendPort,omitempty"`
3940
3941 BackendPort *int32 `json:"backendPort,omitempty"`
3942 }
3943
3944
3945
3946 type InboundNatRuleFragment struct {
3947
3948 TransportProtocol TransportProtocol `json:"transportProtocol,omitempty"`
3949
3950 FrontendPort *int32 `json:"frontendPort,omitempty"`
3951
3952 BackendPort *int32 `json:"backendPort,omitempty"`
3953 }
3954
3955
3956 type Lab struct {
3957 autorest.Response `json:"-"`
3958
3959 *LabProperties `json:"properties,omitempty"`
3960
3961 ID *string `json:"id,omitempty"`
3962
3963 Name *string `json:"name,omitempty"`
3964
3965 Type *string `json:"type,omitempty"`
3966
3967 Location *string `json:"location,omitempty"`
3968
3969 Tags map[string]*string `json:"tags"`
3970 }
3971
3972
3973 func (l Lab) MarshalJSON() ([]byte, error) {
3974 objectMap := make(map[string]interface{})
3975 if l.LabProperties != nil {
3976 objectMap["properties"] = l.LabProperties
3977 }
3978 if l.Location != nil {
3979 objectMap["location"] = l.Location
3980 }
3981 if l.Tags != nil {
3982 objectMap["tags"] = l.Tags
3983 }
3984 return json.Marshal(objectMap)
3985 }
3986
3987
3988 func (l *Lab) UnmarshalJSON(body []byte) error {
3989 var m map[string]*json.RawMessage
3990 err := json.Unmarshal(body, &m)
3991 if err != nil {
3992 return err
3993 }
3994 for k, v := range m {
3995 switch k {
3996 case "properties":
3997 if v != nil {
3998 var labProperties LabProperties
3999 err = json.Unmarshal(*v, &labProperties)
4000 if err != nil {
4001 return err
4002 }
4003 l.LabProperties = &labProperties
4004 }
4005 case "id":
4006 if v != nil {
4007 var ID string
4008 err = json.Unmarshal(*v, &ID)
4009 if err != nil {
4010 return err
4011 }
4012 l.ID = &ID
4013 }
4014 case "name":
4015 if v != nil {
4016 var name string
4017 err = json.Unmarshal(*v, &name)
4018 if err != nil {
4019 return err
4020 }
4021 l.Name = &name
4022 }
4023 case "type":
4024 if v != nil {
4025 var typeVar string
4026 err = json.Unmarshal(*v, &typeVar)
4027 if err != nil {
4028 return err
4029 }
4030 l.Type = &typeVar
4031 }
4032 case "location":
4033 if v != nil {
4034 var location string
4035 err = json.Unmarshal(*v, &location)
4036 if err != nil {
4037 return err
4038 }
4039 l.Location = &location
4040 }
4041 case "tags":
4042 if v != nil {
4043 var tags map[string]*string
4044 err = json.Unmarshal(*v, &tags)
4045 if err != nil {
4046 return err
4047 }
4048 l.Tags = tags
4049 }
4050 }
4051 }
4052
4053 return nil
4054 }
4055
4056
4057 type LabAnnouncementProperties struct {
4058
4059 Title *string `json:"title,omitempty"`
4060
4061 Markdown *string `json:"markdown,omitempty"`
4062
4063 Enabled EnableStatus `json:"enabled,omitempty"`
4064
4065 ExpirationDate *date.Time `json:"expirationDate,omitempty"`
4066
4067 Expired *bool `json:"expired,omitempty"`
4068
4069 ProvisioningState *string `json:"provisioningState,omitempty"`
4070
4071 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
4072 }
4073
4074
4075 func (lap LabAnnouncementProperties) MarshalJSON() ([]byte, error) {
4076 objectMap := make(map[string]interface{})
4077 if lap.Title != nil {
4078 objectMap["title"] = lap.Title
4079 }
4080 if lap.Markdown != nil {
4081 objectMap["markdown"] = lap.Markdown
4082 }
4083 if lap.Enabled != "" {
4084 objectMap["enabled"] = lap.Enabled
4085 }
4086 if lap.ExpirationDate != nil {
4087 objectMap["expirationDate"] = lap.ExpirationDate
4088 }
4089 if lap.Expired != nil {
4090 objectMap["expired"] = lap.Expired
4091 }
4092 return json.Marshal(objectMap)
4093 }
4094
4095
4096 type LabAnnouncementPropertiesFragment struct {
4097
4098 Title *string `json:"title,omitempty"`
4099
4100 Markdown *string `json:"markdown,omitempty"`
4101
4102 Enabled EnableStatus `json:"enabled,omitempty"`
4103
4104 ExpirationDate *date.Time `json:"expirationDate,omitempty"`
4105
4106 Expired *bool `json:"expired,omitempty"`
4107 }
4108
4109
4110 type LabCost struct {
4111 autorest.Response `json:"-"`
4112
4113 *LabCostProperties `json:"properties,omitempty"`
4114
4115 ID *string `json:"id,omitempty"`
4116
4117 Name *string `json:"name,omitempty"`
4118
4119 Type *string `json:"type,omitempty"`
4120
4121 Location *string `json:"location,omitempty"`
4122
4123 Tags map[string]*string `json:"tags"`
4124 }
4125
4126
4127 func (lc LabCost) MarshalJSON() ([]byte, error) {
4128 objectMap := make(map[string]interface{})
4129 if lc.LabCostProperties != nil {
4130 objectMap["properties"] = lc.LabCostProperties
4131 }
4132 if lc.Location != nil {
4133 objectMap["location"] = lc.Location
4134 }
4135 if lc.Tags != nil {
4136 objectMap["tags"] = lc.Tags
4137 }
4138 return json.Marshal(objectMap)
4139 }
4140
4141
4142 func (lc *LabCost) UnmarshalJSON(body []byte) error {
4143 var m map[string]*json.RawMessage
4144 err := json.Unmarshal(body, &m)
4145 if err != nil {
4146 return err
4147 }
4148 for k, v := range m {
4149 switch k {
4150 case "properties":
4151 if v != nil {
4152 var labCostProperties LabCostProperties
4153 err = json.Unmarshal(*v, &labCostProperties)
4154 if err != nil {
4155 return err
4156 }
4157 lc.LabCostProperties = &labCostProperties
4158 }
4159 case "id":
4160 if v != nil {
4161 var ID string
4162 err = json.Unmarshal(*v, &ID)
4163 if err != nil {
4164 return err
4165 }
4166 lc.ID = &ID
4167 }
4168 case "name":
4169 if v != nil {
4170 var name string
4171 err = json.Unmarshal(*v, &name)
4172 if err != nil {
4173 return err
4174 }
4175 lc.Name = &name
4176 }
4177 case "type":
4178 if v != nil {
4179 var typeVar string
4180 err = json.Unmarshal(*v, &typeVar)
4181 if err != nil {
4182 return err
4183 }
4184 lc.Type = &typeVar
4185 }
4186 case "location":
4187 if v != nil {
4188 var location string
4189 err = json.Unmarshal(*v, &location)
4190 if err != nil {
4191 return err
4192 }
4193 lc.Location = &location
4194 }
4195 case "tags":
4196 if v != nil {
4197 var tags map[string]*string
4198 err = json.Unmarshal(*v, &tags)
4199 if err != nil {
4200 return err
4201 }
4202 lc.Tags = tags
4203 }
4204 }
4205 }
4206
4207 return nil
4208 }
4209
4210
4211 type LabCostDetailsProperties struct {
4212
4213 Date *date.Time `json:"date,omitempty"`
4214
4215 Cost *float64 `json:"cost,omitempty"`
4216
4217 CostType CostType `json:"costType,omitempty"`
4218 }
4219
4220
4221 type LabCostProperties struct {
4222
4223 TargetCost *TargetCostProperties `json:"targetCost,omitempty"`
4224
4225 LabCostSummary *LabCostSummaryProperties `json:"labCostSummary,omitempty"`
4226
4227 LabCostDetails *[]LabCostDetailsProperties `json:"labCostDetails,omitempty"`
4228
4229 ResourceCosts *[]LabResourceCostProperties `json:"resourceCosts,omitempty"`
4230
4231 CurrencyCode *string `json:"currencyCode,omitempty"`
4232
4233 StartDateTime *date.Time `json:"startDateTime,omitempty"`
4234
4235 EndDateTime *date.Time `json:"endDateTime,omitempty"`
4236
4237 CreatedDate *date.Time `json:"createdDate,omitempty"`
4238
4239 ProvisioningState *string `json:"provisioningState,omitempty"`
4240
4241 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
4242 }
4243
4244
4245 func (lcp LabCostProperties) MarshalJSON() ([]byte, error) {
4246 objectMap := make(map[string]interface{})
4247 if lcp.TargetCost != nil {
4248 objectMap["targetCost"] = lcp.TargetCost
4249 }
4250 if lcp.CurrencyCode != nil {
4251 objectMap["currencyCode"] = lcp.CurrencyCode
4252 }
4253 if lcp.StartDateTime != nil {
4254 objectMap["startDateTime"] = lcp.StartDateTime
4255 }
4256 if lcp.EndDateTime != nil {
4257 objectMap["endDateTime"] = lcp.EndDateTime
4258 }
4259 if lcp.CreatedDate != nil {
4260 objectMap["createdDate"] = lcp.CreatedDate
4261 }
4262 return json.Marshal(objectMap)
4263 }
4264
4265
4266 type LabCostSummaryProperties struct {
4267
4268 EstimatedLabCost *float64 `json:"estimatedLabCost,omitempty"`
4269 }
4270
4271
4272 type LabFragment struct {
4273
4274 *LabPropertiesFragment `json:"properties,omitempty"`
4275
4276 Tags map[string]*string `json:"tags"`
4277 }
4278
4279
4280 func (lf LabFragment) MarshalJSON() ([]byte, error) {
4281 objectMap := make(map[string]interface{})
4282 if lf.LabPropertiesFragment != nil {
4283 objectMap["properties"] = lf.LabPropertiesFragment
4284 }
4285 if lf.Tags != nil {
4286 objectMap["tags"] = lf.Tags
4287 }
4288 return json.Marshal(objectMap)
4289 }
4290
4291
4292 func (lf *LabFragment) UnmarshalJSON(body []byte) error {
4293 var m map[string]*json.RawMessage
4294 err := json.Unmarshal(body, &m)
4295 if err != nil {
4296 return err
4297 }
4298 for k, v := range m {
4299 switch k {
4300 case "properties":
4301 if v != nil {
4302 var labPropertiesFragment LabPropertiesFragment
4303 err = json.Unmarshal(*v, &labPropertiesFragment)
4304 if err != nil {
4305 return err
4306 }
4307 lf.LabPropertiesFragment = &labPropertiesFragment
4308 }
4309 case "tags":
4310 if v != nil {
4311 var tags map[string]*string
4312 err = json.Unmarshal(*v, &tags)
4313 if err != nil {
4314 return err
4315 }
4316 lf.Tags = tags
4317 }
4318 }
4319 }
4320
4321 return nil
4322 }
4323
4324
4325 type LabList struct {
4326 autorest.Response `json:"-"`
4327
4328 Value *[]Lab `json:"value,omitempty"`
4329
4330 NextLink *string `json:"nextLink,omitempty"`
4331 }
4332
4333
4334 type LabListIterator struct {
4335 i int
4336 page LabListPage
4337 }
4338
4339
4340
4341 func (iter *LabListIterator) NextWithContext(ctx context.Context) (err error) {
4342 if tracing.IsEnabled() {
4343 ctx = tracing.StartSpan(ctx, fqdn+"/LabListIterator.NextWithContext")
4344 defer func() {
4345 sc := -1
4346 if iter.Response().Response.Response != nil {
4347 sc = iter.Response().Response.Response.StatusCode
4348 }
4349 tracing.EndSpan(ctx, sc, err)
4350 }()
4351 }
4352 iter.i++
4353 if iter.i < len(iter.page.Values()) {
4354 return nil
4355 }
4356 err = iter.page.NextWithContext(ctx)
4357 if err != nil {
4358 iter.i--
4359 return err
4360 }
4361 iter.i = 0
4362 return nil
4363 }
4364
4365
4366
4367
4368 func (iter *LabListIterator) Next() error {
4369 return iter.NextWithContext(context.Background())
4370 }
4371
4372
4373 func (iter LabListIterator) NotDone() bool {
4374 return iter.page.NotDone() && iter.i < len(iter.page.Values())
4375 }
4376
4377
4378 func (iter LabListIterator) Response() LabList {
4379 return iter.page.Response()
4380 }
4381
4382
4383
4384 func (iter LabListIterator) Value() Lab {
4385 if !iter.page.NotDone() {
4386 return Lab{}
4387 }
4388 return iter.page.Values()[iter.i]
4389 }
4390
4391
4392 func NewLabListIterator(page LabListPage) LabListIterator {
4393 return LabListIterator{page: page}
4394 }
4395
4396
4397 func (ll LabList) IsEmpty() bool {
4398 return ll.Value == nil || len(*ll.Value) == 0
4399 }
4400
4401
4402 func (ll LabList) hasNextLink() bool {
4403 return ll.NextLink != nil && len(*ll.NextLink) != 0
4404 }
4405
4406
4407
4408 func (ll LabList) labListPreparer(ctx context.Context) (*http.Request, error) {
4409 if !ll.hasNextLink() {
4410 return nil, nil
4411 }
4412 return autorest.Prepare((&http.Request{}).WithContext(ctx),
4413 autorest.AsJSON(),
4414 autorest.AsGet(),
4415 autorest.WithBaseURL(to.String(ll.NextLink)))
4416 }
4417
4418
4419 type LabListPage struct {
4420 fn func(context.Context, LabList) (LabList, error)
4421 ll LabList
4422 }
4423
4424
4425
4426 func (page *LabListPage) NextWithContext(ctx context.Context) (err error) {
4427 if tracing.IsEnabled() {
4428 ctx = tracing.StartSpan(ctx, fqdn+"/LabListPage.NextWithContext")
4429 defer func() {
4430 sc := -1
4431 if page.Response().Response.Response != nil {
4432 sc = page.Response().Response.Response.StatusCode
4433 }
4434 tracing.EndSpan(ctx, sc, err)
4435 }()
4436 }
4437 for {
4438 next, err := page.fn(ctx, page.ll)
4439 if err != nil {
4440 return err
4441 }
4442 page.ll = next
4443 if !next.hasNextLink() || !next.IsEmpty() {
4444 break
4445 }
4446 }
4447 return nil
4448 }
4449
4450
4451
4452
4453 func (page *LabListPage) Next() error {
4454 return page.NextWithContext(context.Background())
4455 }
4456
4457
4458 func (page LabListPage) NotDone() bool {
4459 return !page.ll.IsEmpty()
4460 }
4461
4462
4463 func (page LabListPage) Response() LabList {
4464 return page.ll
4465 }
4466
4467
4468 func (page LabListPage) Values() []Lab {
4469 if page.ll.IsEmpty() {
4470 return nil
4471 }
4472 return *page.ll.Value
4473 }
4474
4475
4476 func NewLabListPage(cur LabList, getNextPage func(context.Context, LabList) (LabList, error)) LabListPage {
4477 return LabListPage{
4478 fn: getNextPage,
4479 ll: cur,
4480 }
4481 }
4482
4483
4484 type LabProperties struct {
4485
4486 DefaultStorageAccount *string `json:"defaultStorageAccount,omitempty"`
4487
4488 DefaultPremiumStorageAccount *string `json:"defaultPremiumStorageAccount,omitempty"`
4489
4490 ArtifactsStorageAccount *string `json:"artifactsStorageAccount,omitempty"`
4491
4492 PremiumDataDiskStorageAccount *string `json:"premiumDataDiskStorageAccount,omitempty"`
4493
4494 VaultName *string `json:"vaultName,omitempty"`
4495
4496 LabStorageType StorageType `json:"labStorageType,omitempty"`
4497
4498 MandatoryArtifactsResourceIdsLinux *[]string `json:"mandatoryArtifactsResourceIdsLinux,omitempty"`
4499
4500 MandatoryArtifactsResourceIdsWindows *[]string `json:"mandatoryArtifactsResourceIdsWindows,omitempty"`
4501
4502 CreatedDate *date.Time `json:"createdDate,omitempty"`
4503
4504
4505
4506 PremiumDataDisks PremiumDataDisk `json:"premiumDataDisks,omitempty"`
4507
4508 EnvironmentPermission EnvironmentPermission `json:"environmentPermission,omitempty"`
4509
4510 Announcement *LabAnnouncementProperties `json:"announcement,omitempty"`
4511
4512 Support *LabSupportProperties `json:"support,omitempty"`
4513
4514 VMCreationResourceGroup *string `json:"vmCreationResourceGroup,omitempty"`
4515
4516 PublicIPID *string `json:"publicIpId,omitempty"`
4517
4518 LoadBalancerID *string `json:"loadBalancerId,omitempty"`
4519
4520 NetworkSecurityGroupID *string `json:"networkSecurityGroupId,omitempty"`
4521
4522 ExtendedProperties map[string]*string `json:"extendedProperties"`
4523
4524 ProvisioningState *string `json:"provisioningState,omitempty"`
4525
4526 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
4527 }
4528
4529
4530 func (lp LabProperties) MarshalJSON() ([]byte, error) {
4531 objectMap := make(map[string]interface{})
4532 if lp.LabStorageType != "" {
4533 objectMap["labStorageType"] = lp.LabStorageType
4534 }
4535 if lp.MandatoryArtifactsResourceIdsLinux != nil {
4536 objectMap["mandatoryArtifactsResourceIdsLinux"] = lp.MandatoryArtifactsResourceIdsLinux
4537 }
4538 if lp.MandatoryArtifactsResourceIdsWindows != nil {
4539 objectMap["mandatoryArtifactsResourceIdsWindows"] = lp.MandatoryArtifactsResourceIdsWindows
4540 }
4541 if lp.PremiumDataDisks != "" {
4542 objectMap["premiumDataDisks"] = lp.PremiumDataDisks
4543 }
4544 if lp.EnvironmentPermission != "" {
4545 objectMap["environmentPermission"] = lp.EnvironmentPermission
4546 }
4547 if lp.Announcement != nil {
4548 objectMap["announcement"] = lp.Announcement
4549 }
4550 if lp.Support != nil {
4551 objectMap["support"] = lp.Support
4552 }
4553 if lp.ExtendedProperties != nil {
4554 objectMap["extendedProperties"] = lp.ExtendedProperties
4555 }
4556 return json.Marshal(objectMap)
4557 }
4558
4559
4560 type LabPropertiesFragment struct {
4561
4562 LabStorageType StorageType `json:"labStorageType,omitempty"`
4563
4564 MandatoryArtifactsResourceIdsLinux *[]string `json:"mandatoryArtifactsResourceIdsLinux,omitempty"`
4565
4566 MandatoryArtifactsResourceIdsWindows *[]string `json:"mandatoryArtifactsResourceIdsWindows,omitempty"`
4567
4568
4569
4570 PremiumDataDisks PremiumDataDisk `json:"premiumDataDisks,omitempty"`
4571
4572 EnvironmentPermission EnvironmentPermission `json:"environmentPermission,omitempty"`
4573
4574 Announcement *LabAnnouncementPropertiesFragment `json:"announcement,omitempty"`
4575
4576 Support *LabSupportPropertiesFragment `json:"support,omitempty"`
4577
4578 ExtendedProperties map[string]*string `json:"extendedProperties"`
4579 }
4580
4581
4582 func (lpf LabPropertiesFragment) MarshalJSON() ([]byte, error) {
4583 objectMap := make(map[string]interface{})
4584 if lpf.LabStorageType != "" {
4585 objectMap["labStorageType"] = lpf.LabStorageType
4586 }
4587 if lpf.MandatoryArtifactsResourceIdsLinux != nil {
4588 objectMap["mandatoryArtifactsResourceIdsLinux"] = lpf.MandatoryArtifactsResourceIdsLinux
4589 }
4590 if lpf.MandatoryArtifactsResourceIdsWindows != nil {
4591 objectMap["mandatoryArtifactsResourceIdsWindows"] = lpf.MandatoryArtifactsResourceIdsWindows
4592 }
4593 if lpf.PremiumDataDisks != "" {
4594 objectMap["premiumDataDisks"] = lpf.PremiumDataDisks
4595 }
4596 if lpf.EnvironmentPermission != "" {
4597 objectMap["environmentPermission"] = lpf.EnvironmentPermission
4598 }
4599 if lpf.Announcement != nil {
4600 objectMap["announcement"] = lpf.Announcement
4601 }
4602 if lpf.Support != nil {
4603 objectMap["support"] = lpf.Support
4604 }
4605 if lpf.ExtendedProperties != nil {
4606 objectMap["extendedProperties"] = lpf.ExtendedProperties
4607 }
4608 return json.Marshal(objectMap)
4609 }
4610
4611
4612 type LabResourceCostProperties struct {
4613
4614 Resourcename *string `json:"resourcename,omitempty"`
4615
4616 ResourceUID *string `json:"resourceUId,omitempty"`
4617
4618 ResourceCost *float64 `json:"resourceCost,omitempty"`
4619
4620 ResourceType *string `json:"resourceType,omitempty"`
4621
4622 ResourceOwner *string `json:"resourceOwner,omitempty"`
4623
4624 ResourcePricingTier *string `json:"resourcePricingTier,omitempty"`
4625
4626 ResourceStatus *string `json:"resourceStatus,omitempty"`
4627
4628 ResourceID *string `json:"resourceId,omitempty"`
4629
4630 ExternalResourceID *string `json:"externalResourceId,omitempty"`
4631 }
4632
4633
4634
4635 type LabsClaimAnyVMFuture struct {
4636 azure.FutureAPI
4637
4638
4639 Result func(LabsClient) (autorest.Response, error)
4640 }
4641
4642
4643 func (future *LabsClaimAnyVMFuture) UnmarshalJSON(body []byte) error {
4644 var azFuture azure.Future
4645 if err := json.Unmarshal(body, &azFuture); err != nil {
4646 return err
4647 }
4648 future.FutureAPI = &azFuture
4649 future.Result = future.result
4650 return nil
4651 }
4652
4653
4654 func (future *LabsClaimAnyVMFuture) result(client LabsClient) (ar autorest.Response, err error) {
4655 var done bool
4656 done, err = future.DoneWithContext(context.Background(), client)
4657 if err != nil {
4658 err = autorest.NewErrorWithError(err, "dtl.LabsClaimAnyVMFuture", "Result", future.Response(), "Polling failure")
4659 return
4660 }
4661 if !done {
4662 ar.Response = future.Response()
4663 err = azure.NewAsyncOpIncompleteError("dtl.LabsClaimAnyVMFuture")
4664 return
4665 }
4666 ar.Response = future.Response()
4667 return
4668 }
4669
4670
4671
4672 type LabsCreateEnvironmentFuture struct {
4673 azure.FutureAPI
4674
4675
4676 Result func(LabsClient) (autorest.Response, error)
4677 }
4678
4679
4680 func (future *LabsCreateEnvironmentFuture) UnmarshalJSON(body []byte) error {
4681 var azFuture azure.Future
4682 if err := json.Unmarshal(body, &azFuture); err != nil {
4683 return err
4684 }
4685 future.FutureAPI = &azFuture
4686 future.Result = future.result
4687 return nil
4688 }
4689
4690
4691 func (future *LabsCreateEnvironmentFuture) result(client LabsClient) (ar autorest.Response, err error) {
4692 var done bool
4693 done, err = future.DoneWithContext(context.Background(), client)
4694 if err != nil {
4695 err = autorest.NewErrorWithError(err, "dtl.LabsCreateEnvironmentFuture", "Result", future.Response(), "Polling failure")
4696 return
4697 }
4698 if !done {
4699 ar.Response = future.Response()
4700 err = azure.NewAsyncOpIncompleteError("dtl.LabsCreateEnvironmentFuture")
4701 return
4702 }
4703 ar.Response = future.Response()
4704 return
4705 }
4706
4707
4708
4709 type LabsCreateOrUpdateFuture struct {
4710 azure.FutureAPI
4711
4712
4713 Result func(LabsClient) (Lab, error)
4714 }
4715
4716
4717 func (future *LabsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
4718 var azFuture azure.Future
4719 if err := json.Unmarshal(body, &azFuture); err != nil {
4720 return err
4721 }
4722 future.FutureAPI = &azFuture
4723 future.Result = future.result
4724 return nil
4725 }
4726
4727
4728 func (future *LabsCreateOrUpdateFuture) result(client LabsClient) (l Lab, err error) {
4729 var done bool
4730 done, err = future.DoneWithContext(context.Background(), client)
4731 if err != nil {
4732 err = autorest.NewErrorWithError(err, "dtl.LabsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4733 return
4734 }
4735 if !done {
4736 l.Response.Response = future.Response()
4737 err = azure.NewAsyncOpIncompleteError("dtl.LabsCreateOrUpdateFuture")
4738 return
4739 }
4740 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4741 if l.Response.Response, err = future.GetResult(sender); err == nil && l.Response.Response.StatusCode != http.StatusNoContent {
4742 l, err = client.CreateOrUpdateResponder(l.Response.Response)
4743 if err != nil {
4744 err = autorest.NewErrorWithError(err, "dtl.LabsCreateOrUpdateFuture", "Result", l.Response.Response, "Failure responding to request")
4745 }
4746 }
4747 return
4748 }
4749
4750
4751 type LabsDeleteFuture struct {
4752 azure.FutureAPI
4753
4754
4755 Result func(LabsClient) (autorest.Response, error)
4756 }
4757
4758
4759 func (future *LabsDeleteFuture) UnmarshalJSON(body []byte) error {
4760 var azFuture azure.Future
4761 if err := json.Unmarshal(body, &azFuture); err != nil {
4762 return err
4763 }
4764 future.FutureAPI = &azFuture
4765 future.Result = future.result
4766 return nil
4767 }
4768
4769
4770 func (future *LabsDeleteFuture) result(client LabsClient) (ar autorest.Response, err error) {
4771 var done bool
4772 done, err = future.DoneWithContext(context.Background(), client)
4773 if err != nil {
4774 err = autorest.NewErrorWithError(err, "dtl.LabsDeleteFuture", "Result", future.Response(), "Polling failure")
4775 return
4776 }
4777 if !done {
4778 ar.Response = future.Response()
4779 err = azure.NewAsyncOpIncompleteError("dtl.LabsDeleteFuture")
4780 return
4781 }
4782 ar.Response = future.Response()
4783 return
4784 }
4785
4786
4787
4788 type LabsExportResourceUsageFuture struct {
4789 azure.FutureAPI
4790
4791
4792 Result func(LabsClient) (autorest.Response, error)
4793 }
4794
4795
4796 func (future *LabsExportResourceUsageFuture) UnmarshalJSON(body []byte) error {
4797 var azFuture azure.Future
4798 if err := json.Unmarshal(body, &azFuture); err != nil {
4799 return err
4800 }
4801 future.FutureAPI = &azFuture
4802 future.Result = future.result
4803 return nil
4804 }
4805
4806
4807 func (future *LabsExportResourceUsageFuture) result(client LabsClient) (ar autorest.Response, err error) {
4808 var done bool
4809 done, err = future.DoneWithContext(context.Background(), client)
4810 if err != nil {
4811 err = autorest.NewErrorWithError(err, "dtl.LabsExportResourceUsageFuture", "Result", future.Response(), "Polling failure")
4812 return
4813 }
4814 if !done {
4815 ar.Response = future.Response()
4816 err = azure.NewAsyncOpIncompleteError("dtl.LabsExportResourceUsageFuture")
4817 return
4818 }
4819 ar.Response = future.Response()
4820 return
4821 }
4822
4823
4824
4825 type LabsImportVirtualMachineFuture struct {
4826 azure.FutureAPI
4827
4828
4829 Result func(LabsClient) (autorest.Response, error)
4830 }
4831
4832
4833 func (future *LabsImportVirtualMachineFuture) UnmarshalJSON(body []byte) error {
4834 var azFuture azure.Future
4835 if err := json.Unmarshal(body, &azFuture); err != nil {
4836 return err
4837 }
4838 future.FutureAPI = &azFuture
4839 future.Result = future.result
4840 return nil
4841 }
4842
4843
4844 func (future *LabsImportVirtualMachineFuture) result(client LabsClient) (ar autorest.Response, err error) {
4845 var done bool
4846 done, err = future.DoneWithContext(context.Background(), client)
4847 if err != nil {
4848 err = autorest.NewErrorWithError(err, "dtl.LabsImportVirtualMachineFuture", "Result", future.Response(), "Polling failure")
4849 return
4850 }
4851 if !done {
4852 ar.Response = future.Response()
4853 err = azure.NewAsyncOpIncompleteError("dtl.LabsImportVirtualMachineFuture")
4854 return
4855 }
4856 ar.Response = future.Response()
4857 return
4858 }
4859
4860
4861 type LabSupportProperties struct {
4862
4863 Enabled EnableStatus `json:"enabled,omitempty"`
4864
4865 Markdown *string `json:"markdown,omitempty"`
4866 }
4867
4868
4869 type LabSupportPropertiesFragment struct {
4870
4871 Enabled EnableStatus `json:"enabled,omitempty"`
4872
4873 Markdown *string `json:"markdown,omitempty"`
4874 }
4875
4876
4877 type LabVhd struct {
4878
4879 ID *string `json:"id,omitempty"`
4880 }
4881
4882
4883 type LabVhdList struct {
4884 autorest.Response `json:"-"`
4885
4886 Value *[]LabVhd `json:"value,omitempty"`
4887
4888 NextLink *string `json:"nextLink,omitempty"`
4889 }
4890
4891
4892 type LabVhdListIterator struct {
4893 i int
4894 page LabVhdListPage
4895 }
4896
4897
4898
4899 func (iter *LabVhdListIterator) NextWithContext(ctx context.Context) (err error) {
4900 if tracing.IsEnabled() {
4901 ctx = tracing.StartSpan(ctx, fqdn+"/LabVhdListIterator.NextWithContext")
4902 defer func() {
4903 sc := -1
4904 if iter.Response().Response.Response != nil {
4905 sc = iter.Response().Response.Response.StatusCode
4906 }
4907 tracing.EndSpan(ctx, sc, err)
4908 }()
4909 }
4910 iter.i++
4911 if iter.i < len(iter.page.Values()) {
4912 return nil
4913 }
4914 err = iter.page.NextWithContext(ctx)
4915 if err != nil {
4916 iter.i--
4917 return err
4918 }
4919 iter.i = 0
4920 return nil
4921 }
4922
4923
4924
4925
4926 func (iter *LabVhdListIterator) Next() error {
4927 return iter.NextWithContext(context.Background())
4928 }
4929
4930
4931 func (iter LabVhdListIterator) NotDone() bool {
4932 return iter.page.NotDone() && iter.i < len(iter.page.Values())
4933 }
4934
4935
4936 func (iter LabVhdListIterator) Response() LabVhdList {
4937 return iter.page.Response()
4938 }
4939
4940
4941
4942 func (iter LabVhdListIterator) Value() LabVhd {
4943 if !iter.page.NotDone() {
4944 return LabVhd{}
4945 }
4946 return iter.page.Values()[iter.i]
4947 }
4948
4949
4950 func NewLabVhdListIterator(page LabVhdListPage) LabVhdListIterator {
4951 return LabVhdListIterator{page: page}
4952 }
4953
4954
4955 func (lvl LabVhdList) IsEmpty() bool {
4956 return lvl.Value == nil || len(*lvl.Value) == 0
4957 }
4958
4959
4960 func (lvl LabVhdList) hasNextLink() bool {
4961 return lvl.NextLink != nil && len(*lvl.NextLink) != 0
4962 }
4963
4964
4965
4966 func (lvl LabVhdList) labVhdListPreparer(ctx context.Context) (*http.Request, error) {
4967 if !lvl.hasNextLink() {
4968 return nil, nil
4969 }
4970 return autorest.Prepare((&http.Request{}).WithContext(ctx),
4971 autorest.AsJSON(),
4972 autorest.AsGet(),
4973 autorest.WithBaseURL(to.String(lvl.NextLink)))
4974 }
4975
4976
4977 type LabVhdListPage struct {
4978 fn func(context.Context, LabVhdList) (LabVhdList, error)
4979 lvl LabVhdList
4980 }
4981
4982
4983
4984 func (page *LabVhdListPage) NextWithContext(ctx context.Context) (err error) {
4985 if tracing.IsEnabled() {
4986 ctx = tracing.StartSpan(ctx, fqdn+"/LabVhdListPage.NextWithContext")
4987 defer func() {
4988 sc := -1
4989 if page.Response().Response.Response != nil {
4990 sc = page.Response().Response.Response.StatusCode
4991 }
4992 tracing.EndSpan(ctx, sc, err)
4993 }()
4994 }
4995 for {
4996 next, err := page.fn(ctx, page.lvl)
4997 if err != nil {
4998 return err
4999 }
5000 page.lvl = next
5001 if !next.hasNextLink() || !next.IsEmpty() {
5002 break
5003 }
5004 }
5005 return nil
5006 }
5007
5008
5009
5010
5011 func (page *LabVhdListPage) Next() error {
5012 return page.NextWithContext(context.Background())
5013 }
5014
5015
5016 func (page LabVhdListPage) NotDone() bool {
5017 return !page.lvl.IsEmpty()
5018 }
5019
5020
5021 func (page LabVhdListPage) Response() LabVhdList {
5022 return page.lvl
5023 }
5024
5025
5026 func (page LabVhdListPage) Values() []LabVhd {
5027 if page.lvl.IsEmpty() {
5028 return nil
5029 }
5030 return *page.lvl.Value
5031 }
5032
5033
5034 func NewLabVhdListPage(cur LabVhdList, getNextPage func(context.Context, LabVhdList) (LabVhdList, error)) LabVhdListPage {
5035 return LabVhdListPage{
5036 fn: getNextPage,
5037 lvl: cur,
5038 }
5039 }
5040
5041
5042 type LabVirtualMachine struct {
5043 autorest.Response `json:"-"`
5044
5045 *LabVirtualMachineProperties `json:"properties,omitempty"`
5046
5047 ID *string `json:"id,omitempty"`
5048
5049 Name *string `json:"name,omitempty"`
5050
5051 Type *string `json:"type,omitempty"`
5052
5053 Location *string `json:"location,omitempty"`
5054
5055 Tags map[string]*string `json:"tags"`
5056 }
5057
5058
5059 func (lvm LabVirtualMachine) MarshalJSON() ([]byte, error) {
5060 objectMap := make(map[string]interface{})
5061 if lvm.LabVirtualMachineProperties != nil {
5062 objectMap["properties"] = lvm.LabVirtualMachineProperties
5063 }
5064 if lvm.Location != nil {
5065 objectMap["location"] = lvm.Location
5066 }
5067 if lvm.Tags != nil {
5068 objectMap["tags"] = lvm.Tags
5069 }
5070 return json.Marshal(objectMap)
5071 }
5072
5073
5074 func (lvm *LabVirtualMachine) UnmarshalJSON(body []byte) error {
5075 var m map[string]*json.RawMessage
5076 err := json.Unmarshal(body, &m)
5077 if err != nil {
5078 return err
5079 }
5080 for k, v := range m {
5081 switch k {
5082 case "properties":
5083 if v != nil {
5084 var labVirtualMachineProperties LabVirtualMachineProperties
5085 err = json.Unmarshal(*v, &labVirtualMachineProperties)
5086 if err != nil {
5087 return err
5088 }
5089 lvm.LabVirtualMachineProperties = &labVirtualMachineProperties
5090 }
5091 case "id":
5092 if v != nil {
5093 var ID string
5094 err = json.Unmarshal(*v, &ID)
5095 if err != nil {
5096 return err
5097 }
5098 lvm.ID = &ID
5099 }
5100 case "name":
5101 if v != nil {
5102 var name string
5103 err = json.Unmarshal(*v, &name)
5104 if err != nil {
5105 return err
5106 }
5107 lvm.Name = &name
5108 }
5109 case "type":
5110 if v != nil {
5111 var typeVar string
5112 err = json.Unmarshal(*v, &typeVar)
5113 if err != nil {
5114 return err
5115 }
5116 lvm.Type = &typeVar
5117 }
5118 case "location":
5119 if v != nil {
5120 var location string
5121 err = json.Unmarshal(*v, &location)
5122 if err != nil {
5123 return err
5124 }
5125 lvm.Location = &location
5126 }
5127 case "tags":
5128 if v != nil {
5129 var tags map[string]*string
5130 err = json.Unmarshal(*v, &tags)
5131 if err != nil {
5132 return err
5133 }
5134 lvm.Tags = tags
5135 }
5136 }
5137 }
5138
5139 return nil
5140 }
5141
5142
5143 type LabVirtualMachineCreationParameter struct {
5144
5145 *LabVirtualMachineCreationParameterProperties `json:"properties,omitempty"`
5146
5147 Name *string `json:"name,omitempty"`
5148
5149 Location *string `json:"location,omitempty"`
5150
5151 Tags map[string]*string `json:"tags"`
5152 }
5153
5154
5155 func (lvmcp LabVirtualMachineCreationParameter) MarshalJSON() ([]byte, error) {
5156 objectMap := make(map[string]interface{})
5157 if lvmcp.LabVirtualMachineCreationParameterProperties != nil {
5158 objectMap["properties"] = lvmcp.LabVirtualMachineCreationParameterProperties
5159 }
5160 if lvmcp.Name != nil {
5161 objectMap["name"] = lvmcp.Name
5162 }
5163 if lvmcp.Location != nil {
5164 objectMap["location"] = lvmcp.Location
5165 }
5166 if lvmcp.Tags != nil {
5167 objectMap["tags"] = lvmcp.Tags
5168 }
5169 return json.Marshal(objectMap)
5170 }
5171
5172
5173 func (lvmcp *LabVirtualMachineCreationParameter) UnmarshalJSON(body []byte) error {
5174 var m map[string]*json.RawMessage
5175 err := json.Unmarshal(body, &m)
5176 if err != nil {
5177 return err
5178 }
5179 for k, v := range m {
5180 switch k {
5181 case "properties":
5182 if v != nil {
5183 var labVirtualMachineCreationParameterProperties LabVirtualMachineCreationParameterProperties
5184 err = json.Unmarshal(*v, &labVirtualMachineCreationParameterProperties)
5185 if err != nil {
5186 return err
5187 }
5188 lvmcp.LabVirtualMachineCreationParameterProperties = &labVirtualMachineCreationParameterProperties
5189 }
5190 case "name":
5191 if v != nil {
5192 var name string
5193 err = json.Unmarshal(*v, &name)
5194 if err != nil {
5195 return err
5196 }
5197 lvmcp.Name = &name
5198 }
5199 case "location":
5200 if v != nil {
5201 var location string
5202 err = json.Unmarshal(*v, &location)
5203 if err != nil {
5204 return err
5205 }
5206 lvmcp.Location = &location
5207 }
5208 case "tags":
5209 if v != nil {
5210 var tags map[string]*string
5211 err = json.Unmarshal(*v, &tags)
5212 if err != nil {
5213 return err
5214 }
5215 lvmcp.Tags = tags
5216 }
5217 }
5218 }
5219
5220 return nil
5221 }
5222
5223
5224 type LabVirtualMachineCreationParameterFragment struct {
5225
5226 *LabVirtualMachineCreationParameterPropertiesFragment `json:"properties,omitempty"`
5227
5228 Name *string `json:"name,omitempty"`
5229
5230 Location *string `json:"location,omitempty"`
5231
5232 Tags map[string]*string `json:"tags"`
5233 }
5234
5235
5236 func (lvmcpf LabVirtualMachineCreationParameterFragment) MarshalJSON() ([]byte, error) {
5237 objectMap := make(map[string]interface{})
5238 if lvmcpf.LabVirtualMachineCreationParameterPropertiesFragment != nil {
5239 objectMap["properties"] = lvmcpf.LabVirtualMachineCreationParameterPropertiesFragment
5240 }
5241 if lvmcpf.Name != nil {
5242 objectMap["name"] = lvmcpf.Name
5243 }
5244 if lvmcpf.Location != nil {
5245 objectMap["location"] = lvmcpf.Location
5246 }
5247 if lvmcpf.Tags != nil {
5248 objectMap["tags"] = lvmcpf.Tags
5249 }
5250 return json.Marshal(objectMap)
5251 }
5252
5253
5254 func (lvmcpf *LabVirtualMachineCreationParameterFragment) UnmarshalJSON(body []byte) error {
5255 var m map[string]*json.RawMessage
5256 err := json.Unmarshal(body, &m)
5257 if err != nil {
5258 return err
5259 }
5260 for k, v := range m {
5261 switch k {
5262 case "properties":
5263 if v != nil {
5264 var labVirtualMachineCreationParameterPropertiesFragment LabVirtualMachineCreationParameterPropertiesFragment
5265 err = json.Unmarshal(*v, &labVirtualMachineCreationParameterPropertiesFragment)
5266 if err != nil {
5267 return err
5268 }
5269 lvmcpf.LabVirtualMachineCreationParameterPropertiesFragment = &labVirtualMachineCreationParameterPropertiesFragment
5270 }
5271 case "name":
5272 if v != nil {
5273 var name string
5274 err = json.Unmarshal(*v, &name)
5275 if err != nil {
5276 return err
5277 }
5278 lvmcpf.Name = &name
5279 }
5280 case "location":
5281 if v != nil {
5282 var location string
5283 err = json.Unmarshal(*v, &location)
5284 if err != nil {
5285 return err
5286 }
5287 lvmcpf.Location = &location
5288 }
5289 case "tags":
5290 if v != nil {
5291 var tags map[string]*string
5292 err = json.Unmarshal(*v, &tags)
5293 if err != nil {
5294 return err
5295 }
5296 lvmcpf.Tags = tags
5297 }
5298 }
5299 }
5300
5301 return nil
5302 }
5303
5304
5305 type LabVirtualMachineCreationParameterProperties struct {
5306
5307 BulkCreationParameters *BulkCreationParameters `json:"bulkCreationParameters,omitempty"`
5308
5309 Notes *string `json:"notes,omitempty"`
5310
5311 OwnerObjectID *string `json:"ownerObjectId,omitempty"`
5312
5313 OwnerUserPrincipalName *string `json:"ownerUserPrincipalName,omitempty"`
5314
5315 CreatedByUserID *string `json:"createdByUserId,omitempty"`
5316
5317 CreatedByUser *string `json:"createdByUser,omitempty"`
5318
5319 CreatedDate *date.Time `json:"createdDate,omitempty"`
5320
5321 ComputeID *string `json:"computeId,omitempty"`
5322
5323 CustomImageID *string `json:"customImageId,omitempty"`
5324
5325 OsType *string `json:"osType,omitempty"`
5326
5327 Size *string `json:"size,omitempty"`
5328
5329 UserName *string `json:"userName,omitempty"`
5330
5331 Password *string `json:"password,omitempty"`
5332
5333 SSHKey *string `json:"sshKey,omitempty"`
5334
5335 IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"`
5336
5337 Fqdn *string `json:"fqdn,omitempty"`
5338
5339 LabSubnetName *string `json:"labSubnetName,omitempty"`
5340
5341 LabVirtualNetworkID *string `json:"labVirtualNetworkId,omitempty"`
5342
5343 DisallowPublicIPAddress *bool `json:"disallowPublicIpAddress,omitempty"`
5344
5345 Artifacts *[]ArtifactInstallProperties `json:"artifacts,omitempty"`
5346
5347 ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties `json:"artifactDeploymentStatus,omitempty"`
5348
5349 GalleryImageReference *GalleryImageReference `json:"galleryImageReference,omitempty"`
5350
5351 PlanID *string `json:"planId,omitempty"`
5352
5353 NetworkInterface *NetworkInterfaceProperties `json:"networkInterface,omitempty"`
5354
5355 ExpirationDate *date.Time `json:"expirationDate,omitempty"`
5356
5357 AllowClaim *bool `json:"allowClaim,omitempty"`
5358
5359 StorageType *string `json:"storageType,omitempty"`
5360
5361 VirtualMachineCreationSource VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty"`
5362
5363 EnvironmentID *string `json:"environmentId,omitempty"`
5364
5365 DataDiskParameters *[]DataDiskProperties `json:"dataDiskParameters,omitempty"`
5366
5367 ScheduleParameters *[]ScheduleCreationParameter `json:"scheduleParameters,omitempty"`
5368
5369 LastKnownPowerState *string `json:"lastKnownPowerState,omitempty"`
5370 }
5371
5372
5373 type LabVirtualMachineCreationParameterPropertiesFragment struct {
5374
5375 BulkCreationParameters *BulkCreationParametersFragment `json:"bulkCreationParameters,omitempty"`
5376
5377 Notes *string `json:"notes,omitempty"`
5378
5379 OwnerObjectID *string `json:"ownerObjectId,omitempty"`
5380
5381 OwnerUserPrincipalName *string `json:"ownerUserPrincipalName,omitempty"`
5382
5383 CreatedByUserID *string `json:"createdByUserId,omitempty"`
5384
5385 CreatedByUser *string `json:"createdByUser,omitempty"`
5386
5387 CreatedDate *date.Time `json:"createdDate,omitempty"`
5388
5389 ComputeID *string `json:"computeId,omitempty"`
5390
5391 CustomImageID *string `json:"customImageId,omitempty"`
5392
5393 OsType *string `json:"osType,omitempty"`
5394
5395 Size *string `json:"size,omitempty"`
5396
5397 UserName *string `json:"userName,omitempty"`
5398
5399 Password *string `json:"password,omitempty"`
5400
5401 SSHKey *string `json:"sshKey,omitempty"`
5402
5403 IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"`
5404
5405 Fqdn *string `json:"fqdn,omitempty"`
5406
5407 LabSubnetName *string `json:"labSubnetName,omitempty"`
5408
5409 LabVirtualNetworkID *string `json:"labVirtualNetworkId,omitempty"`
5410
5411 DisallowPublicIPAddress *bool `json:"disallowPublicIpAddress,omitempty"`
5412
5413 Artifacts *[]ArtifactInstallPropertiesFragment `json:"artifacts,omitempty"`
5414
5415 ArtifactDeploymentStatus *ArtifactDeploymentStatusPropertiesFragment `json:"artifactDeploymentStatus,omitempty"`
5416
5417 GalleryImageReference *GalleryImageReferenceFragment `json:"galleryImageReference,omitempty"`
5418
5419 PlanID *string `json:"planId,omitempty"`
5420
5421 NetworkInterface *NetworkInterfacePropertiesFragment `json:"networkInterface,omitempty"`
5422
5423 ExpirationDate *date.Time `json:"expirationDate,omitempty"`
5424
5425 AllowClaim *bool `json:"allowClaim,omitempty"`
5426
5427 StorageType *string `json:"storageType,omitempty"`
5428
5429 VirtualMachineCreationSource VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty"`
5430
5431 EnvironmentID *string `json:"environmentId,omitempty"`
5432
5433 DataDiskParameters *[]DataDiskPropertiesFragment `json:"dataDiskParameters,omitempty"`
5434
5435 ScheduleParameters *[]ScheduleCreationParameterFragment `json:"scheduleParameters,omitempty"`
5436
5437 LastKnownPowerState *string `json:"lastKnownPowerState,omitempty"`
5438 }
5439
5440
5441 type LabVirtualMachineFragment struct {
5442
5443 *LabVirtualMachinePropertiesFragment `json:"properties,omitempty"`
5444
5445 Tags map[string]*string `json:"tags"`
5446 }
5447
5448
5449 func (lvmf LabVirtualMachineFragment) MarshalJSON() ([]byte, error) {
5450 objectMap := make(map[string]interface{})
5451 if lvmf.LabVirtualMachinePropertiesFragment != nil {
5452 objectMap["properties"] = lvmf.LabVirtualMachinePropertiesFragment
5453 }
5454 if lvmf.Tags != nil {
5455 objectMap["tags"] = lvmf.Tags
5456 }
5457 return json.Marshal(objectMap)
5458 }
5459
5460
5461 func (lvmf *LabVirtualMachineFragment) UnmarshalJSON(body []byte) error {
5462 var m map[string]*json.RawMessage
5463 err := json.Unmarshal(body, &m)
5464 if err != nil {
5465 return err
5466 }
5467 for k, v := range m {
5468 switch k {
5469 case "properties":
5470 if v != nil {
5471 var labVirtualMachinePropertiesFragment LabVirtualMachinePropertiesFragment
5472 err = json.Unmarshal(*v, &labVirtualMachinePropertiesFragment)
5473 if err != nil {
5474 return err
5475 }
5476 lvmf.LabVirtualMachinePropertiesFragment = &labVirtualMachinePropertiesFragment
5477 }
5478 case "tags":
5479 if v != nil {
5480 var tags map[string]*string
5481 err = json.Unmarshal(*v, &tags)
5482 if err != nil {
5483 return err
5484 }
5485 lvmf.Tags = tags
5486 }
5487 }
5488 }
5489
5490 return nil
5491 }
5492
5493
5494 type LabVirtualMachineList struct {
5495 autorest.Response `json:"-"`
5496
5497 Value *[]LabVirtualMachine `json:"value,omitempty"`
5498
5499 NextLink *string `json:"nextLink,omitempty"`
5500 }
5501
5502
5503 type LabVirtualMachineListIterator struct {
5504 i int
5505 page LabVirtualMachineListPage
5506 }
5507
5508
5509
5510 func (iter *LabVirtualMachineListIterator) NextWithContext(ctx context.Context) (err error) {
5511 if tracing.IsEnabled() {
5512 ctx = tracing.StartSpan(ctx, fqdn+"/LabVirtualMachineListIterator.NextWithContext")
5513 defer func() {
5514 sc := -1
5515 if iter.Response().Response.Response != nil {
5516 sc = iter.Response().Response.Response.StatusCode
5517 }
5518 tracing.EndSpan(ctx, sc, err)
5519 }()
5520 }
5521 iter.i++
5522 if iter.i < len(iter.page.Values()) {
5523 return nil
5524 }
5525 err = iter.page.NextWithContext(ctx)
5526 if err != nil {
5527 iter.i--
5528 return err
5529 }
5530 iter.i = 0
5531 return nil
5532 }
5533
5534
5535
5536
5537 func (iter *LabVirtualMachineListIterator) Next() error {
5538 return iter.NextWithContext(context.Background())
5539 }
5540
5541
5542 func (iter LabVirtualMachineListIterator) NotDone() bool {
5543 return iter.page.NotDone() && iter.i < len(iter.page.Values())
5544 }
5545
5546
5547 func (iter LabVirtualMachineListIterator) Response() LabVirtualMachineList {
5548 return iter.page.Response()
5549 }
5550
5551
5552
5553 func (iter LabVirtualMachineListIterator) Value() LabVirtualMachine {
5554 if !iter.page.NotDone() {
5555 return LabVirtualMachine{}
5556 }
5557 return iter.page.Values()[iter.i]
5558 }
5559
5560
5561 func NewLabVirtualMachineListIterator(page LabVirtualMachineListPage) LabVirtualMachineListIterator {
5562 return LabVirtualMachineListIterator{page: page}
5563 }
5564
5565
5566 func (lvml LabVirtualMachineList) IsEmpty() bool {
5567 return lvml.Value == nil || len(*lvml.Value) == 0
5568 }
5569
5570
5571 func (lvml LabVirtualMachineList) hasNextLink() bool {
5572 return lvml.NextLink != nil && len(*lvml.NextLink) != 0
5573 }
5574
5575
5576
5577 func (lvml LabVirtualMachineList) labVirtualMachineListPreparer(ctx context.Context) (*http.Request, error) {
5578 if !lvml.hasNextLink() {
5579 return nil, nil
5580 }
5581 return autorest.Prepare((&http.Request{}).WithContext(ctx),
5582 autorest.AsJSON(),
5583 autorest.AsGet(),
5584 autorest.WithBaseURL(to.String(lvml.NextLink)))
5585 }
5586
5587
5588 type LabVirtualMachineListPage struct {
5589 fn func(context.Context, LabVirtualMachineList) (LabVirtualMachineList, error)
5590 lvml LabVirtualMachineList
5591 }
5592
5593
5594
5595 func (page *LabVirtualMachineListPage) NextWithContext(ctx context.Context) (err error) {
5596 if tracing.IsEnabled() {
5597 ctx = tracing.StartSpan(ctx, fqdn+"/LabVirtualMachineListPage.NextWithContext")
5598 defer func() {
5599 sc := -1
5600 if page.Response().Response.Response != nil {
5601 sc = page.Response().Response.Response.StatusCode
5602 }
5603 tracing.EndSpan(ctx, sc, err)
5604 }()
5605 }
5606 for {
5607 next, err := page.fn(ctx, page.lvml)
5608 if err != nil {
5609 return err
5610 }
5611 page.lvml = next
5612 if !next.hasNextLink() || !next.IsEmpty() {
5613 break
5614 }
5615 }
5616 return nil
5617 }
5618
5619
5620
5621
5622 func (page *LabVirtualMachineListPage) Next() error {
5623 return page.NextWithContext(context.Background())
5624 }
5625
5626
5627 func (page LabVirtualMachineListPage) NotDone() bool {
5628 return !page.lvml.IsEmpty()
5629 }
5630
5631
5632 func (page LabVirtualMachineListPage) Response() LabVirtualMachineList {
5633 return page.lvml
5634 }
5635
5636
5637 func (page LabVirtualMachineListPage) Values() []LabVirtualMachine {
5638 if page.lvml.IsEmpty() {
5639 return nil
5640 }
5641 return *page.lvml.Value
5642 }
5643
5644
5645 func NewLabVirtualMachineListPage(cur LabVirtualMachineList, getNextPage func(context.Context, LabVirtualMachineList) (LabVirtualMachineList, error)) LabVirtualMachineListPage {
5646 return LabVirtualMachineListPage{
5647 fn: getNextPage,
5648 lvml: cur,
5649 }
5650 }
5651
5652
5653 type LabVirtualMachineProperties struct {
5654
5655 Notes *string `json:"notes,omitempty"`
5656
5657 OwnerObjectID *string `json:"ownerObjectId,omitempty"`
5658
5659 OwnerUserPrincipalName *string `json:"ownerUserPrincipalName,omitempty"`
5660
5661 CreatedByUserID *string `json:"createdByUserId,omitempty"`
5662
5663 CreatedByUser *string `json:"createdByUser,omitempty"`
5664
5665 CreatedDate *date.Time `json:"createdDate,omitempty"`
5666
5667 ComputeID *string `json:"computeId,omitempty"`
5668
5669 CustomImageID *string `json:"customImageId,omitempty"`
5670
5671 OsType *string `json:"osType,omitempty"`
5672
5673 Size *string `json:"size,omitempty"`
5674
5675 UserName *string `json:"userName,omitempty"`
5676
5677 Password *string `json:"password,omitempty"`
5678
5679 SSHKey *string `json:"sshKey,omitempty"`
5680
5681 IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"`
5682
5683 Fqdn *string `json:"fqdn,omitempty"`
5684
5685 LabSubnetName *string `json:"labSubnetName,omitempty"`
5686
5687 LabVirtualNetworkID *string `json:"labVirtualNetworkId,omitempty"`
5688
5689 DisallowPublicIPAddress *bool `json:"disallowPublicIpAddress,omitempty"`
5690
5691 Artifacts *[]ArtifactInstallProperties `json:"artifacts,omitempty"`
5692
5693 ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties `json:"artifactDeploymentStatus,omitempty"`
5694
5695 GalleryImageReference *GalleryImageReference `json:"galleryImageReference,omitempty"`
5696
5697 PlanID *string `json:"planId,omitempty"`
5698
5699 ComputeVM *ComputeVMProperties `json:"computeVm,omitempty"`
5700
5701 NetworkInterface *NetworkInterfaceProperties `json:"networkInterface,omitempty"`
5702
5703 ApplicableSchedule *ApplicableSchedule `json:"applicableSchedule,omitempty"`
5704
5705 ExpirationDate *date.Time `json:"expirationDate,omitempty"`
5706
5707 AllowClaim *bool `json:"allowClaim,omitempty"`
5708
5709 StorageType *string `json:"storageType,omitempty"`
5710
5711 VirtualMachineCreationSource VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty"`
5712
5713 EnvironmentID *string `json:"environmentId,omitempty"`
5714
5715 DataDiskParameters *[]DataDiskProperties `json:"dataDiskParameters,omitempty"`
5716
5717 ScheduleParameters *[]ScheduleCreationParameter `json:"scheduleParameters,omitempty"`
5718
5719 LastKnownPowerState *string `json:"lastKnownPowerState,omitempty"`
5720
5721 ProvisioningState *string `json:"provisioningState,omitempty"`
5722
5723 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
5724 }
5725
5726
5727 func (lvmp LabVirtualMachineProperties) MarshalJSON() ([]byte, error) {
5728 objectMap := make(map[string]interface{})
5729 if lvmp.Notes != nil {
5730 objectMap["notes"] = lvmp.Notes
5731 }
5732 if lvmp.OwnerObjectID != nil {
5733 objectMap["ownerObjectId"] = lvmp.OwnerObjectID
5734 }
5735 if lvmp.OwnerUserPrincipalName != nil {
5736 objectMap["ownerUserPrincipalName"] = lvmp.OwnerUserPrincipalName
5737 }
5738 if lvmp.CreatedByUserID != nil {
5739 objectMap["createdByUserId"] = lvmp.CreatedByUserID
5740 }
5741 if lvmp.CreatedByUser != nil {
5742 objectMap["createdByUser"] = lvmp.CreatedByUser
5743 }
5744 if lvmp.CreatedDate != nil {
5745 objectMap["createdDate"] = lvmp.CreatedDate
5746 }
5747 if lvmp.ComputeID != nil {
5748 objectMap["computeId"] = lvmp.ComputeID
5749 }
5750 if lvmp.CustomImageID != nil {
5751 objectMap["customImageId"] = lvmp.CustomImageID
5752 }
5753 if lvmp.OsType != nil {
5754 objectMap["osType"] = lvmp.OsType
5755 }
5756 if lvmp.Size != nil {
5757 objectMap["size"] = lvmp.Size
5758 }
5759 if lvmp.UserName != nil {
5760 objectMap["userName"] = lvmp.UserName
5761 }
5762 if lvmp.Password != nil {
5763 objectMap["password"] = lvmp.Password
5764 }
5765 if lvmp.SSHKey != nil {
5766 objectMap["sshKey"] = lvmp.SSHKey
5767 }
5768 if lvmp.IsAuthenticationWithSSHKey != nil {
5769 objectMap["isAuthenticationWithSshKey"] = lvmp.IsAuthenticationWithSSHKey
5770 }
5771 if lvmp.Fqdn != nil {
5772 objectMap["fqdn"] = lvmp.Fqdn
5773 }
5774 if lvmp.LabSubnetName != nil {
5775 objectMap["labSubnetName"] = lvmp.LabSubnetName
5776 }
5777 if lvmp.LabVirtualNetworkID != nil {
5778 objectMap["labVirtualNetworkId"] = lvmp.LabVirtualNetworkID
5779 }
5780 if lvmp.DisallowPublicIPAddress != nil {
5781 objectMap["disallowPublicIpAddress"] = lvmp.DisallowPublicIPAddress
5782 }
5783 if lvmp.Artifacts != nil {
5784 objectMap["artifacts"] = lvmp.Artifacts
5785 }
5786 if lvmp.ArtifactDeploymentStatus != nil {
5787 objectMap["artifactDeploymentStatus"] = lvmp.ArtifactDeploymentStatus
5788 }
5789 if lvmp.GalleryImageReference != nil {
5790 objectMap["galleryImageReference"] = lvmp.GalleryImageReference
5791 }
5792 if lvmp.PlanID != nil {
5793 objectMap["planId"] = lvmp.PlanID
5794 }
5795 if lvmp.NetworkInterface != nil {
5796 objectMap["networkInterface"] = lvmp.NetworkInterface
5797 }
5798 if lvmp.ExpirationDate != nil {
5799 objectMap["expirationDate"] = lvmp.ExpirationDate
5800 }
5801 if lvmp.AllowClaim != nil {
5802 objectMap["allowClaim"] = lvmp.AllowClaim
5803 }
5804 if lvmp.StorageType != nil {
5805 objectMap["storageType"] = lvmp.StorageType
5806 }
5807 if lvmp.VirtualMachineCreationSource != "" {
5808 objectMap["virtualMachineCreationSource"] = lvmp.VirtualMachineCreationSource
5809 }
5810 if lvmp.EnvironmentID != nil {
5811 objectMap["environmentId"] = lvmp.EnvironmentID
5812 }
5813 if lvmp.DataDiskParameters != nil {
5814 objectMap["dataDiskParameters"] = lvmp.DataDiskParameters
5815 }
5816 if lvmp.ScheduleParameters != nil {
5817 objectMap["scheduleParameters"] = lvmp.ScheduleParameters
5818 }
5819 if lvmp.LastKnownPowerState != nil {
5820 objectMap["lastKnownPowerState"] = lvmp.LastKnownPowerState
5821 }
5822 return json.Marshal(objectMap)
5823 }
5824
5825
5826 type LabVirtualMachinePropertiesFragment struct {
5827
5828 Notes *string `json:"notes,omitempty"`
5829
5830 OwnerObjectID *string `json:"ownerObjectId,omitempty"`
5831
5832 OwnerUserPrincipalName *string `json:"ownerUserPrincipalName,omitempty"`
5833
5834 CreatedByUserID *string `json:"createdByUserId,omitempty"`
5835
5836 CreatedByUser *string `json:"createdByUser,omitempty"`
5837
5838 CreatedDate *date.Time `json:"createdDate,omitempty"`
5839
5840 ComputeID *string `json:"computeId,omitempty"`
5841
5842 CustomImageID *string `json:"customImageId,omitempty"`
5843
5844 OsType *string `json:"osType,omitempty"`
5845
5846 Size *string `json:"size,omitempty"`
5847
5848 UserName *string `json:"userName,omitempty"`
5849
5850 Password *string `json:"password,omitempty"`
5851
5852 SSHKey *string `json:"sshKey,omitempty"`
5853
5854 IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"`
5855
5856 Fqdn *string `json:"fqdn,omitempty"`
5857
5858 LabSubnetName *string `json:"labSubnetName,omitempty"`
5859
5860 LabVirtualNetworkID *string `json:"labVirtualNetworkId,omitempty"`
5861
5862 DisallowPublicIPAddress *bool `json:"disallowPublicIpAddress,omitempty"`
5863
5864 Artifacts *[]ArtifactInstallPropertiesFragment `json:"artifacts,omitempty"`
5865
5866 ArtifactDeploymentStatus *ArtifactDeploymentStatusPropertiesFragment `json:"artifactDeploymentStatus,omitempty"`
5867
5868 GalleryImageReference *GalleryImageReferenceFragment `json:"galleryImageReference,omitempty"`
5869
5870 PlanID *string `json:"planId,omitempty"`
5871
5872 NetworkInterface *NetworkInterfacePropertiesFragment `json:"networkInterface,omitempty"`
5873
5874 ExpirationDate *date.Time `json:"expirationDate,omitempty"`
5875
5876 AllowClaim *bool `json:"allowClaim,omitempty"`
5877
5878 StorageType *string `json:"storageType,omitempty"`
5879
5880 VirtualMachineCreationSource VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty"`
5881
5882 EnvironmentID *string `json:"environmentId,omitempty"`
5883
5884 DataDiskParameters *[]DataDiskPropertiesFragment `json:"dataDiskParameters,omitempty"`
5885
5886 ScheduleParameters *[]ScheduleCreationParameterFragment `json:"scheduleParameters,omitempty"`
5887
5888 LastKnownPowerState *string `json:"lastKnownPowerState,omitempty"`
5889 }
5890
5891
5892 type LinuxOsInfo struct {
5893
5894 LinuxOsState LinuxOsState `json:"linuxOsState,omitempty"`
5895 }
5896
5897
5898 type LinuxOsInfoFragment struct {
5899
5900 LinuxOsState LinuxOsState `json:"linuxOsState,omitempty"`
5901 }
5902
5903
5904 type NetworkInterfaceProperties struct {
5905
5906 VirtualNetworkID *string `json:"virtualNetworkId,omitempty"`
5907
5908 SubnetID *string `json:"subnetId,omitempty"`
5909
5910 PublicIPAddressID *string `json:"publicIpAddressId,omitempty"`
5911
5912 PublicIPAddress *string `json:"publicIpAddress,omitempty"`
5913
5914 PrivateIPAddress *string `json:"privateIpAddress,omitempty"`
5915
5916 DNSName *string `json:"dnsName,omitempty"`
5917
5918 RdpAuthority *string `json:"rdpAuthority,omitempty"`
5919
5920 SSHAuthority *string `json:"sshAuthority,omitempty"`
5921
5922 SharedPublicIPAddressConfiguration *SharedPublicIPAddressConfiguration `json:"sharedPublicIpAddressConfiguration,omitempty"`
5923 }
5924
5925
5926 type NetworkInterfacePropertiesFragment struct {
5927
5928 VirtualNetworkID *string `json:"virtualNetworkId,omitempty"`
5929
5930 SubnetID *string `json:"subnetId,omitempty"`
5931
5932 PublicIPAddressID *string `json:"publicIpAddressId,omitempty"`
5933
5934 PublicIPAddress *string `json:"publicIpAddress,omitempty"`
5935
5936 PrivateIPAddress *string `json:"privateIpAddress,omitempty"`
5937
5938 DNSName *string `json:"dnsName,omitempty"`
5939
5940 RdpAuthority *string `json:"rdpAuthority,omitempty"`
5941
5942 SSHAuthority *string `json:"sshAuthority,omitempty"`
5943
5944 SharedPublicIPAddressConfiguration *SharedPublicIPAddressConfigurationFragment `json:"sharedPublicIpAddressConfiguration,omitempty"`
5945 }
5946
5947
5948 type NotificationChannel struct {
5949 autorest.Response `json:"-"`
5950
5951 *NotificationChannelProperties `json:"properties,omitempty"`
5952
5953 ID *string `json:"id,omitempty"`
5954
5955 Name *string `json:"name,omitempty"`
5956
5957 Type *string `json:"type,omitempty"`
5958
5959 Location *string `json:"location,omitempty"`
5960
5961 Tags map[string]*string `json:"tags"`
5962 }
5963
5964
5965 func (nc NotificationChannel) MarshalJSON() ([]byte, error) {
5966 objectMap := make(map[string]interface{})
5967 if nc.NotificationChannelProperties != nil {
5968 objectMap["properties"] = nc.NotificationChannelProperties
5969 }
5970 if nc.Location != nil {
5971 objectMap["location"] = nc.Location
5972 }
5973 if nc.Tags != nil {
5974 objectMap["tags"] = nc.Tags
5975 }
5976 return json.Marshal(objectMap)
5977 }
5978
5979
5980 func (nc *NotificationChannel) UnmarshalJSON(body []byte) error {
5981 var m map[string]*json.RawMessage
5982 err := json.Unmarshal(body, &m)
5983 if err != nil {
5984 return err
5985 }
5986 for k, v := range m {
5987 switch k {
5988 case "properties":
5989 if v != nil {
5990 var notificationChannelProperties NotificationChannelProperties
5991 err = json.Unmarshal(*v, ¬ificationChannelProperties)
5992 if err != nil {
5993 return err
5994 }
5995 nc.NotificationChannelProperties = ¬ificationChannelProperties
5996 }
5997 case "id":
5998 if v != nil {
5999 var ID string
6000 err = json.Unmarshal(*v, &ID)
6001 if err != nil {
6002 return err
6003 }
6004 nc.ID = &ID
6005 }
6006 case "name":
6007 if v != nil {
6008 var name string
6009 err = json.Unmarshal(*v, &name)
6010 if err != nil {
6011 return err
6012 }
6013 nc.Name = &name
6014 }
6015 case "type":
6016 if v != nil {
6017 var typeVar string
6018 err = json.Unmarshal(*v, &typeVar)
6019 if err != nil {
6020 return err
6021 }
6022 nc.Type = &typeVar
6023 }
6024 case "location":
6025 if v != nil {
6026 var location string
6027 err = json.Unmarshal(*v, &location)
6028 if err != nil {
6029 return err
6030 }
6031 nc.Location = &location
6032 }
6033 case "tags":
6034 if v != nil {
6035 var tags map[string]*string
6036 err = json.Unmarshal(*v, &tags)
6037 if err != nil {
6038 return err
6039 }
6040 nc.Tags = tags
6041 }
6042 }
6043 }
6044
6045 return nil
6046 }
6047
6048
6049 type NotificationChannelFragment struct {
6050
6051 *NotificationChannelPropertiesFragment `json:"properties,omitempty"`
6052
6053 Tags map[string]*string `json:"tags"`
6054 }
6055
6056
6057 func (ncf NotificationChannelFragment) MarshalJSON() ([]byte, error) {
6058 objectMap := make(map[string]interface{})
6059 if ncf.NotificationChannelPropertiesFragment != nil {
6060 objectMap["properties"] = ncf.NotificationChannelPropertiesFragment
6061 }
6062 if ncf.Tags != nil {
6063 objectMap["tags"] = ncf.Tags
6064 }
6065 return json.Marshal(objectMap)
6066 }
6067
6068
6069 func (ncf *NotificationChannelFragment) UnmarshalJSON(body []byte) error {
6070 var m map[string]*json.RawMessage
6071 err := json.Unmarshal(body, &m)
6072 if err != nil {
6073 return err
6074 }
6075 for k, v := range m {
6076 switch k {
6077 case "properties":
6078 if v != nil {
6079 var notificationChannelPropertiesFragment NotificationChannelPropertiesFragment
6080 err = json.Unmarshal(*v, ¬ificationChannelPropertiesFragment)
6081 if err != nil {
6082 return err
6083 }
6084 ncf.NotificationChannelPropertiesFragment = ¬ificationChannelPropertiesFragment
6085 }
6086 case "tags":
6087 if v != nil {
6088 var tags map[string]*string
6089 err = json.Unmarshal(*v, &tags)
6090 if err != nil {
6091 return err
6092 }
6093 ncf.Tags = tags
6094 }
6095 }
6096 }
6097
6098 return nil
6099 }
6100
6101
6102 type NotificationChannelList struct {
6103 autorest.Response `json:"-"`
6104
6105 Value *[]NotificationChannel `json:"value,omitempty"`
6106
6107 NextLink *string `json:"nextLink,omitempty"`
6108 }
6109
6110
6111 type NotificationChannelListIterator struct {
6112 i int
6113 page NotificationChannelListPage
6114 }
6115
6116
6117
6118 func (iter *NotificationChannelListIterator) NextWithContext(ctx context.Context) (err error) {
6119 if tracing.IsEnabled() {
6120 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationChannelListIterator.NextWithContext")
6121 defer func() {
6122 sc := -1
6123 if iter.Response().Response.Response != nil {
6124 sc = iter.Response().Response.Response.StatusCode
6125 }
6126 tracing.EndSpan(ctx, sc, err)
6127 }()
6128 }
6129 iter.i++
6130 if iter.i < len(iter.page.Values()) {
6131 return nil
6132 }
6133 err = iter.page.NextWithContext(ctx)
6134 if err != nil {
6135 iter.i--
6136 return err
6137 }
6138 iter.i = 0
6139 return nil
6140 }
6141
6142
6143
6144
6145 func (iter *NotificationChannelListIterator) Next() error {
6146 return iter.NextWithContext(context.Background())
6147 }
6148
6149
6150 func (iter NotificationChannelListIterator) NotDone() bool {
6151 return iter.page.NotDone() && iter.i < len(iter.page.Values())
6152 }
6153
6154
6155 func (iter NotificationChannelListIterator) Response() NotificationChannelList {
6156 return iter.page.Response()
6157 }
6158
6159
6160
6161 func (iter NotificationChannelListIterator) Value() NotificationChannel {
6162 if !iter.page.NotDone() {
6163 return NotificationChannel{}
6164 }
6165 return iter.page.Values()[iter.i]
6166 }
6167
6168
6169 func NewNotificationChannelListIterator(page NotificationChannelListPage) NotificationChannelListIterator {
6170 return NotificationChannelListIterator{page: page}
6171 }
6172
6173
6174 func (ncl NotificationChannelList) IsEmpty() bool {
6175 return ncl.Value == nil || len(*ncl.Value) == 0
6176 }
6177
6178
6179 func (ncl NotificationChannelList) hasNextLink() bool {
6180 return ncl.NextLink != nil && len(*ncl.NextLink) != 0
6181 }
6182
6183
6184
6185 func (ncl NotificationChannelList) notificationChannelListPreparer(ctx context.Context) (*http.Request, error) {
6186 if !ncl.hasNextLink() {
6187 return nil, nil
6188 }
6189 return autorest.Prepare((&http.Request{}).WithContext(ctx),
6190 autorest.AsJSON(),
6191 autorest.AsGet(),
6192 autorest.WithBaseURL(to.String(ncl.NextLink)))
6193 }
6194
6195
6196 type NotificationChannelListPage struct {
6197 fn func(context.Context, NotificationChannelList) (NotificationChannelList, error)
6198 ncl NotificationChannelList
6199 }
6200
6201
6202
6203 func (page *NotificationChannelListPage) NextWithContext(ctx context.Context) (err error) {
6204 if tracing.IsEnabled() {
6205 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationChannelListPage.NextWithContext")
6206 defer func() {
6207 sc := -1
6208 if page.Response().Response.Response != nil {
6209 sc = page.Response().Response.Response.StatusCode
6210 }
6211 tracing.EndSpan(ctx, sc, err)
6212 }()
6213 }
6214 for {
6215 next, err := page.fn(ctx, page.ncl)
6216 if err != nil {
6217 return err
6218 }
6219 page.ncl = next
6220 if !next.hasNextLink() || !next.IsEmpty() {
6221 break
6222 }
6223 }
6224 return nil
6225 }
6226
6227
6228
6229
6230 func (page *NotificationChannelListPage) Next() error {
6231 return page.NextWithContext(context.Background())
6232 }
6233
6234
6235 func (page NotificationChannelListPage) NotDone() bool {
6236 return !page.ncl.IsEmpty()
6237 }
6238
6239
6240 func (page NotificationChannelListPage) Response() NotificationChannelList {
6241 return page.ncl
6242 }
6243
6244
6245 func (page NotificationChannelListPage) Values() []NotificationChannel {
6246 if page.ncl.IsEmpty() {
6247 return nil
6248 }
6249 return *page.ncl.Value
6250 }
6251
6252
6253 func NewNotificationChannelListPage(cur NotificationChannelList, getNextPage func(context.Context, NotificationChannelList) (NotificationChannelList, error)) NotificationChannelListPage {
6254 return NotificationChannelListPage{
6255 fn: getNextPage,
6256 ncl: cur,
6257 }
6258 }
6259
6260
6261 type NotificationChannelProperties struct {
6262
6263 WebHookURL *string `json:"webHookUrl,omitempty"`
6264
6265 EmailRecipient *string `json:"emailRecipient,omitempty"`
6266
6267 NotificationLocale *string `json:"notificationLocale,omitempty"`
6268
6269 Description *string `json:"description,omitempty"`
6270
6271 Events *[]Event `json:"events,omitempty"`
6272
6273 CreatedDate *date.Time `json:"createdDate,omitempty"`
6274
6275 ProvisioningState *string `json:"provisioningState,omitempty"`
6276
6277 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
6278 }
6279
6280
6281 func (ncp NotificationChannelProperties) MarshalJSON() ([]byte, error) {
6282 objectMap := make(map[string]interface{})
6283 if ncp.WebHookURL != nil {
6284 objectMap["webHookUrl"] = ncp.WebHookURL
6285 }
6286 if ncp.EmailRecipient != nil {
6287 objectMap["emailRecipient"] = ncp.EmailRecipient
6288 }
6289 if ncp.NotificationLocale != nil {
6290 objectMap["notificationLocale"] = ncp.NotificationLocale
6291 }
6292 if ncp.Description != nil {
6293 objectMap["description"] = ncp.Description
6294 }
6295 if ncp.Events != nil {
6296 objectMap["events"] = ncp.Events
6297 }
6298 return json.Marshal(objectMap)
6299 }
6300
6301
6302 type NotificationChannelPropertiesFragment struct {
6303
6304 WebHookURL *string `json:"webHookUrl,omitempty"`
6305
6306 EmailRecipient *string `json:"emailRecipient,omitempty"`
6307
6308 NotificationLocale *string `json:"notificationLocale,omitempty"`
6309
6310 Description *string `json:"description,omitempty"`
6311
6312 Events *[]EventFragment `json:"events,omitempty"`
6313 }
6314
6315
6316 type NotificationSettings struct {
6317
6318 Status EnableStatus `json:"status,omitempty"`
6319
6320 TimeInMinutes *int32 `json:"timeInMinutes,omitempty"`
6321
6322 WebhookURL *string `json:"webhookUrl,omitempty"`
6323
6324 EmailRecipient *string `json:"emailRecipient,omitempty"`
6325
6326 NotificationLocale *string `json:"notificationLocale,omitempty"`
6327 }
6328
6329
6330 type NotificationSettingsFragment struct {
6331
6332 Status EnableStatus `json:"status,omitempty"`
6333
6334 TimeInMinutes *int32 `json:"timeInMinutes,omitempty"`
6335
6336 WebhookURL *string `json:"webhookUrl,omitempty"`
6337
6338 EmailRecipient *string `json:"emailRecipient,omitempty"`
6339
6340 NotificationLocale *string `json:"notificationLocale,omitempty"`
6341 }
6342
6343
6344 type NotifyParameters struct {
6345
6346 EventName NotificationChannelEventType `json:"eventName,omitempty"`
6347
6348 JSONPayload *string `json:"jsonPayload,omitempty"`
6349 }
6350
6351
6352 type OperationError struct {
6353
6354 Code *string `json:"code,omitempty"`
6355
6356 Message *string `json:"message,omitempty"`
6357 }
6358
6359
6360 type OperationMetadata struct {
6361
6362 Name *string `json:"name,omitempty"`
6363
6364 Display *OperationMetadataDisplay `json:"display,omitempty"`
6365 }
6366
6367
6368 type OperationMetadataDisplay struct {
6369
6370 Provider *string `json:"provider,omitempty"`
6371
6372 Resource *string `json:"resource,omitempty"`
6373
6374 Operation *string `json:"operation,omitempty"`
6375
6376 Description *string `json:"description,omitempty"`
6377 }
6378
6379
6380 type OperationResult struct {
6381 autorest.Response `json:"-"`
6382
6383 Status *string `json:"status,omitempty"`
6384
6385 StatusCode HTTPStatusCode `json:"statusCode,omitempty"`
6386
6387 Error *OperationError `json:"error,omitempty"`
6388 }
6389
6390
6391 type ParameterInfo struct {
6392
6393 Name *string `json:"name,omitempty"`
6394
6395 Value *string `json:"value,omitempty"`
6396 }
6397
6398
6399 type ParametersValueFileInfo struct {
6400
6401 FileName *string `json:"fileName,omitempty"`
6402
6403 ParametersValueInfo interface{} `json:"parametersValueInfo,omitempty"`
6404 }
6405
6406
6407 type PercentageCostThresholdProperties struct {
6408
6409 ThresholdValue *float64 `json:"thresholdValue,omitempty"`
6410 }
6411
6412
6413 type Policy struct {
6414 autorest.Response `json:"-"`
6415
6416 *PolicyProperties `json:"properties,omitempty"`
6417
6418 ID *string `json:"id,omitempty"`
6419
6420 Name *string `json:"name,omitempty"`
6421
6422 Type *string `json:"type,omitempty"`
6423
6424 Location *string `json:"location,omitempty"`
6425
6426 Tags map[string]*string `json:"tags"`
6427 }
6428
6429
6430 func (p Policy) MarshalJSON() ([]byte, error) {
6431 objectMap := make(map[string]interface{})
6432 if p.PolicyProperties != nil {
6433 objectMap["properties"] = p.PolicyProperties
6434 }
6435 if p.Location != nil {
6436 objectMap["location"] = p.Location
6437 }
6438 if p.Tags != nil {
6439 objectMap["tags"] = p.Tags
6440 }
6441 return json.Marshal(objectMap)
6442 }
6443
6444
6445 func (p *Policy) UnmarshalJSON(body []byte) error {
6446 var m map[string]*json.RawMessage
6447 err := json.Unmarshal(body, &m)
6448 if err != nil {
6449 return err
6450 }
6451 for k, v := range m {
6452 switch k {
6453 case "properties":
6454 if v != nil {
6455 var policyProperties PolicyProperties
6456 err = json.Unmarshal(*v, &policyProperties)
6457 if err != nil {
6458 return err
6459 }
6460 p.PolicyProperties = &policyProperties
6461 }
6462 case "id":
6463 if v != nil {
6464 var ID string
6465 err = json.Unmarshal(*v, &ID)
6466 if err != nil {
6467 return err
6468 }
6469 p.ID = &ID
6470 }
6471 case "name":
6472 if v != nil {
6473 var name string
6474 err = json.Unmarshal(*v, &name)
6475 if err != nil {
6476 return err
6477 }
6478 p.Name = &name
6479 }
6480 case "type":
6481 if v != nil {
6482 var typeVar string
6483 err = json.Unmarshal(*v, &typeVar)
6484 if err != nil {
6485 return err
6486 }
6487 p.Type = &typeVar
6488 }
6489 case "location":
6490 if v != nil {
6491 var location string
6492 err = json.Unmarshal(*v, &location)
6493 if err != nil {
6494 return err
6495 }
6496 p.Location = &location
6497 }
6498 case "tags":
6499 if v != nil {
6500 var tags map[string]*string
6501 err = json.Unmarshal(*v, &tags)
6502 if err != nil {
6503 return err
6504 }
6505 p.Tags = tags
6506 }
6507 }
6508 }
6509
6510 return nil
6511 }
6512
6513
6514 type PolicyFragment struct {
6515
6516 *PolicyPropertiesFragment `json:"properties,omitempty"`
6517
6518 Tags map[string]*string `json:"tags"`
6519 }
6520
6521
6522 func (pf PolicyFragment) MarshalJSON() ([]byte, error) {
6523 objectMap := make(map[string]interface{})
6524 if pf.PolicyPropertiesFragment != nil {
6525 objectMap["properties"] = pf.PolicyPropertiesFragment
6526 }
6527 if pf.Tags != nil {
6528 objectMap["tags"] = pf.Tags
6529 }
6530 return json.Marshal(objectMap)
6531 }
6532
6533
6534 func (pf *PolicyFragment) UnmarshalJSON(body []byte) error {
6535 var m map[string]*json.RawMessage
6536 err := json.Unmarshal(body, &m)
6537 if err != nil {
6538 return err
6539 }
6540 for k, v := range m {
6541 switch k {
6542 case "properties":
6543 if v != nil {
6544 var policyPropertiesFragment PolicyPropertiesFragment
6545 err = json.Unmarshal(*v, &policyPropertiesFragment)
6546 if err != nil {
6547 return err
6548 }
6549 pf.PolicyPropertiesFragment = &policyPropertiesFragment
6550 }
6551 case "tags":
6552 if v != nil {
6553 var tags map[string]*string
6554 err = json.Unmarshal(*v, &tags)
6555 if err != nil {
6556 return err
6557 }
6558 pf.Tags = tags
6559 }
6560 }
6561 }
6562
6563 return nil
6564 }
6565
6566
6567 type PolicyList struct {
6568 autorest.Response `json:"-"`
6569
6570 Value *[]Policy `json:"value,omitempty"`
6571
6572 NextLink *string `json:"nextLink,omitempty"`
6573 }
6574
6575
6576 type PolicyListIterator struct {
6577 i int
6578 page PolicyListPage
6579 }
6580
6581
6582
6583 func (iter *PolicyListIterator) NextWithContext(ctx context.Context) (err error) {
6584 if tracing.IsEnabled() {
6585 ctx = tracing.StartSpan(ctx, fqdn+"/PolicyListIterator.NextWithContext")
6586 defer func() {
6587 sc := -1
6588 if iter.Response().Response.Response != nil {
6589 sc = iter.Response().Response.Response.StatusCode
6590 }
6591 tracing.EndSpan(ctx, sc, err)
6592 }()
6593 }
6594 iter.i++
6595 if iter.i < len(iter.page.Values()) {
6596 return nil
6597 }
6598 err = iter.page.NextWithContext(ctx)
6599 if err != nil {
6600 iter.i--
6601 return err
6602 }
6603 iter.i = 0
6604 return nil
6605 }
6606
6607
6608
6609
6610 func (iter *PolicyListIterator) Next() error {
6611 return iter.NextWithContext(context.Background())
6612 }
6613
6614
6615 func (iter PolicyListIterator) NotDone() bool {
6616 return iter.page.NotDone() && iter.i < len(iter.page.Values())
6617 }
6618
6619
6620 func (iter PolicyListIterator) Response() PolicyList {
6621 return iter.page.Response()
6622 }
6623
6624
6625
6626 func (iter PolicyListIterator) Value() Policy {
6627 if !iter.page.NotDone() {
6628 return Policy{}
6629 }
6630 return iter.page.Values()[iter.i]
6631 }
6632
6633
6634 func NewPolicyListIterator(page PolicyListPage) PolicyListIterator {
6635 return PolicyListIterator{page: page}
6636 }
6637
6638
6639 func (pl PolicyList) IsEmpty() bool {
6640 return pl.Value == nil || len(*pl.Value) == 0
6641 }
6642
6643
6644 func (pl PolicyList) hasNextLink() bool {
6645 return pl.NextLink != nil && len(*pl.NextLink) != 0
6646 }
6647
6648
6649
6650 func (pl PolicyList) policyListPreparer(ctx context.Context) (*http.Request, error) {
6651 if !pl.hasNextLink() {
6652 return nil, nil
6653 }
6654 return autorest.Prepare((&http.Request{}).WithContext(ctx),
6655 autorest.AsJSON(),
6656 autorest.AsGet(),
6657 autorest.WithBaseURL(to.String(pl.NextLink)))
6658 }
6659
6660
6661 type PolicyListPage struct {
6662 fn func(context.Context, PolicyList) (PolicyList, error)
6663 pl PolicyList
6664 }
6665
6666
6667
6668 func (page *PolicyListPage) NextWithContext(ctx context.Context) (err error) {
6669 if tracing.IsEnabled() {
6670 ctx = tracing.StartSpan(ctx, fqdn+"/PolicyListPage.NextWithContext")
6671 defer func() {
6672 sc := -1
6673 if page.Response().Response.Response != nil {
6674 sc = page.Response().Response.Response.StatusCode
6675 }
6676 tracing.EndSpan(ctx, sc, err)
6677 }()
6678 }
6679 for {
6680 next, err := page.fn(ctx, page.pl)
6681 if err != nil {
6682 return err
6683 }
6684 page.pl = next
6685 if !next.hasNextLink() || !next.IsEmpty() {
6686 break
6687 }
6688 }
6689 return nil
6690 }
6691
6692
6693
6694
6695 func (page *PolicyListPage) Next() error {
6696 return page.NextWithContext(context.Background())
6697 }
6698
6699
6700 func (page PolicyListPage) NotDone() bool {
6701 return !page.pl.IsEmpty()
6702 }
6703
6704
6705 func (page PolicyListPage) Response() PolicyList {
6706 return page.pl
6707 }
6708
6709
6710 func (page PolicyListPage) Values() []Policy {
6711 if page.pl.IsEmpty() {
6712 return nil
6713 }
6714 return *page.pl.Value
6715 }
6716
6717
6718 func NewPolicyListPage(cur PolicyList, getNextPage func(context.Context, PolicyList) (PolicyList, error)) PolicyListPage {
6719 return PolicyListPage{
6720 fn: getNextPage,
6721 pl: cur,
6722 }
6723 }
6724
6725
6726 type PolicyProperties struct {
6727
6728 Description *string `json:"description,omitempty"`
6729
6730 Status PolicyStatus `json:"status,omitempty"`
6731
6732 FactName PolicyFactName `json:"factName,omitempty"`
6733
6734 FactData *string `json:"factData,omitempty"`
6735
6736 Threshold *string `json:"threshold,omitempty"`
6737
6738 EvaluatorType PolicyEvaluatorType `json:"evaluatorType,omitempty"`
6739
6740 CreatedDate *date.Time `json:"createdDate,omitempty"`
6741
6742 ProvisioningState *string `json:"provisioningState,omitempty"`
6743
6744 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
6745 }
6746
6747
6748 func (pp PolicyProperties) MarshalJSON() ([]byte, error) {
6749 objectMap := make(map[string]interface{})
6750 if pp.Description != nil {
6751 objectMap["description"] = pp.Description
6752 }
6753 if pp.Status != "" {
6754 objectMap["status"] = pp.Status
6755 }
6756 if pp.FactName != "" {
6757 objectMap["factName"] = pp.FactName
6758 }
6759 if pp.FactData != nil {
6760 objectMap["factData"] = pp.FactData
6761 }
6762 if pp.Threshold != nil {
6763 objectMap["threshold"] = pp.Threshold
6764 }
6765 if pp.EvaluatorType != "" {
6766 objectMap["evaluatorType"] = pp.EvaluatorType
6767 }
6768 return json.Marshal(objectMap)
6769 }
6770
6771
6772 type PolicyPropertiesFragment struct {
6773
6774 Description *string `json:"description,omitempty"`
6775
6776 Status PolicyStatus `json:"status,omitempty"`
6777
6778 FactName PolicyFactName `json:"factName,omitempty"`
6779
6780 FactData *string `json:"factData,omitempty"`
6781
6782 Threshold *string `json:"threshold,omitempty"`
6783
6784 EvaluatorType PolicyEvaluatorType `json:"evaluatorType,omitempty"`
6785 }
6786
6787
6788 type PolicySetResult struct {
6789
6790 HasError *bool `json:"hasError,omitempty"`
6791
6792 PolicyViolations *[]PolicyViolation `json:"policyViolations,omitempty"`
6793 }
6794
6795
6796 type PolicyViolation struct {
6797
6798 Code *string `json:"code,omitempty"`
6799
6800 Message *string `json:"message,omitempty"`
6801 }
6802
6803
6804 type Port struct {
6805
6806 TransportProtocol TransportProtocol `json:"transportProtocol,omitempty"`
6807
6808 BackendPort *int32 `json:"backendPort,omitempty"`
6809 }
6810
6811
6812 type PortFragment struct {
6813
6814 TransportProtocol TransportProtocol `json:"transportProtocol,omitempty"`
6815
6816 BackendPort *int32 `json:"backendPort,omitempty"`
6817 }
6818
6819
6820 type ProviderOperationResult struct {
6821 autorest.Response `json:"-"`
6822
6823 Value *[]OperationMetadata `json:"value,omitempty"`
6824
6825 NextLink *string `json:"nextLink,omitempty"`
6826 }
6827
6828
6829 func (por ProviderOperationResult) MarshalJSON() ([]byte, error) {
6830 objectMap := make(map[string]interface{})
6831 if por.Value != nil {
6832 objectMap["value"] = por.Value
6833 }
6834 return json.Marshal(objectMap)
6835 }
6836
6837
6838 type ProviderOperationResultIterator struct {
6839 i int
6840 page ProviderOperationResultPage
6841 }
6842
6843
6844
6845 func (iter *ProviderOperationResultIterator) NextWithContext(ctx context.Context) (err error) {
6846 if tracing.IsEnabled() {
6847 ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationResultIterator.NextWithContext")
6848 defer func() {
6849 sc := -1
6850 if iter.Response().Response.Response != nil {
6851 sc = iter.Response().Response.Response.StatusCode
6852 }
6853 tracing.EndSpan(ctx, sc, err)
6854 }()
6855 }
6856 iter.i++
6857 if iter.i < len(iter.page.Values()) {
6858 return nil
6859 }
6860 err = iter.page.NextWithContext(ctx)
6861 if err != nil {
6862 iter.i--
6863 return err
6864 }
6865 iter.i = 0
6866 return nil
6867 }
6868
6869
6870
6871
6872 func (iter *ProviderOperationResultIterator) Next() error {
6873 return iter.NextWithContext(context.Background())
6874 }
6875
6876
6877 func (iter ProviderOperationResultIterator) NotDone() bool {
6878 return iter.page.NotDone() && iter.i < len(iter.page.Values())
6879 }
6880
6881
6882 func (iter ProviderOperationResultIterator) Response() ProviderOperationResult {
6883 return iter.page.Response()
6884 }
6885
6886
6887
6888 func (iter ProviderOperationResultIterator) Value() OperationMetadata {
6889 if !iter.page.NotDone() {
6890 return OperationMetadata{}
6891 }
6892 return iter.page.Values()[iter.i]
6893 }
6894
6895
6896 func NewProviderOperationResultIterator(page ProviderOperationResultPage) ProviderOperationResultIterator {
6897 return ProviderOperationResultIterator{page: page}
6898 }
6899
6900
6901 func (por ProviderOperationResult) IsEmpty() bool {
6902 return por.Value == nil || len(*por.Value) == 0
6903 }
6904
6905
6906 func (por ProviderOperationResult) hasNextLink() bool {
6907 return por.NextLink != nil && len(*por.NextLink) != 0
6908 }
6909
6910
6911
6912 func (por ProviderOperationResult) providerOperationResultPreparer(ctx context.Context) (*http.Request, error) {
6913 if !por.hasNextLink() {
6914 return nil, nil
6915 }
6916 return autorest.Prepare((&http.Request{}).WithContext(ctx),
6917 autorest.AsJSON(),
6918 autorest.AsGet(),
6919 autorest.WithBaseURL(to.String(por.NextLink)))
6920 }
6921
6922
6923 type ProviderOperationResultPage struct {
6924 fn func(context.Context, ProviderOperationResult) (ProviderOperationResult, error)
6925 por ProviderOperationResult
6926 }
6927
6928
6929
6930 func (page *ProviderOperationResultPage) NextWithContext(ctx context.Context) (err error) {
6931 if tracing.IsEnabled() {
6932 ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationResultPage.NextWithContext")
6933 defer func() {
6934 sc := -1
6935 if page.Response().Response.Response != nil {
6936 sc = page.Response().Response.Response.StatusCode
6937 }
6938 tracing.EndSpan(ctx, sc, err)
6939 }()
6940 }
6941 for {
6942 next, err := page.fn(ctx, page.por)
6943 if err != nil {
6944 return err
6945 }
6946 page.por = next
6947 if !next.hasNextLink() || !next.IsEmpty() {
6948 break
6949 }
6950 }
6951 return nil
6952 }
6953
6954
6955
6956
6957 func (page *ProviderOperationResultPage) Next() error {
6958 return page.NextWithContext(context.Background())
6959 }
6960
6961
6962 func (page ProviderOperationResultPage) NotDone() bool {
6963 return !page.por.IsEmpty()
6964 }
6965
6966
6967 func (page ProviderOperationResultPage) Response() ProviderOperationResult {
6968 return page.por
6969 }
6970
6971
6972 func (page ProviderOperationResultPage) Values() []OperationMetadata {
6973 if page.por.IsEmpty() {
6974 return nil
6975 }
6976 return *page.por.Value
6977 }
6978
6979
6980 func NewProviderOperationResultPage(cur ProviderOperationResult, getNextPage func(context.Context, ProviderOperationResult) (ProviderOperationResult, error)) ProviderOperationResultPage {
6981 return ProviderOperationResultPage{
6982 fn: getNextPage,
6983 por: cur,
6984 }
6985 }
6986
6987
6988 type RdpConnection struct {
6989 autorest.Response `json:"-"`
6990
6991 Contents *string `json:"contents,omitempty"`
6992 }
6993
6994
6995 type ResizeLabVirtualMachineProperties struct {
6996
6997 Size *string `json:"size,omitempty"`
6998 }
6999
7000
7001 type Resource struct {
7002
7003 ID *string `json:"id,omitempty"`
7004
7005 Name *string `json:"name,omitempty"`
7006
7007 Type *string `json:"type,omitempty"`
7008
7009 Location *string `json:"location,omitempty"`
7010
7011 Tags map[string]*string `json:"tags"`
7012 }
7013
7014
7015 func (r Resource) MarshalJSON() ([]byte, error) {
7016 objectMap := make(map[string]interface{})
7017 if r.Location != nil {
7018 objectMap["location"] = r.Location
7019 }
7020 if r.Tags != nil {
7021 objectMap["tags"] = r.Tags
7022 }
7023 return json.Marshal(objectMap)
7024 }
7025
7026
7027 type RetargetScheduleProperties struct {
7028
7029 CurrentResourceID *string `json:"currentResourceId,omitempty"`
7030
7031 TargetResourceID *string `json:"targetResourceId,omitempty"`
7032 }
7033
7034
7035 type Schedule struct {
7036 autorest.Response `json:"-"`
7037
7038 *ScheduleProperties `json:"properties,omitempty"`
7039
7040 ID *string `json:"id,omitempty"`
7041
7042 Name *string `json:"name,omitempty"`
7043
7044 Type *string `json:"type,omitempty"`
7045
7046 Location *string `json:"location,omitempty"`
7047
7048 Tags map[string]*string `json:"tags"`
7049 }
7050
7051
7052 func (s Schedule) MarshalJSON() ([]byte, error) {
7053 objectMap := make(map[string]interface{})
7054 if s.ScheduleProperties != nil {
7055 objectMap["properties"] = s.ScheduleProperties
7056 }
7057 if s.Location != nil {
7058 objectMap["location"] = s.Location
7059 }
7060 if s.Tags != nil {
7061 objectMap["tags"] = s.Tags
7062 }
7063 return json.Marshal(objectMap)
7064 }
7065
7066
7067 func (s *Schedule) UnmarshalJSON(body []byte) error {
7068 var m map[string]*json.RawMessage
7069 err := json.Unmarshal(body, &m)
7070 if err != nil {
7071 return err
7072 }
7073 for k, v := range m {
7074 switch k {
7075 case "properties":
7076 if v != nil {
7077 var scheduleProperties ScheduleProperties
7078 err = json.Unmarshal(*v, &scheduleProperties)
7079 if err != nil {
7080 return err
7081 }
7082 s.ScheduleProperties = &scheduleProperties
7083 }
7084 case "id":
7085 if v != nil {
7086 var ID string
7087 err = json.Unmarshal(*v, &ID)
7088 if err != nil {
7089 return err
7090 }
7091 s.ID = &ID
7092 }
7093 case "name":
7094 if v != nil {
7095 var name string
7096 err = json.Unmarshal(*v, &name)
7097 if err != nil {
7098 return err
7099 }
7100 s.Name = &name
7101 }
7102 case "type":
7103 if v != nil {
7104 var typeVar string
7105 err = json.Unmarshal(*v, &typeVar)
7106 if err != nil {
7107 return err
7108 }
7109 s.Type = &typeVar
7110 }
7111 case "location":
7112 if v != nil {
7113 var location string
7114 err = json.Unmarshal(*v, &location)
7115 if err != nil {
7116 return err
7117 }
7118 s.Location = &location
7119 }
7120 case "tags":
7121 if v != nil {
7122 var tags map[string]*string
7123 err = json.Unmarshal(*v, &tags)
7124 if err != nil {
7125 return err
7126 }
7127 s.Tags = tags
7128 }
7129 }
7130 }
7131
7132 return nil
7133 }
7134
7135
7136 type ScheduleCreationParameter struct {
7137
7138 *ScheduleCreationParameterProperties `json:"properties,omitempty"`
7139
7140 Name *string `json:"name,omitempty"`
7141
7142 Location *string `json:"location,omitempty"`
7143
7144 Tags map[string]*string `json:"tags"`
7145 }
7146
7147
7148 func (scp ScheduleCreationParameter) MarshalJSON() ([]byte, error) {
7149 objectMap := make(map[string]interface{})
7150 if scp.ScheduleCreationParameterProperties != nil {
7151 objectMap["properties"] = scp.ScheduleCreationParameterProperties
7152 }
7153 if scp.Name != nil {
7154 objectMap["name"] = scp.Name
7155 }
7156 if scp.Location != nil {
7157 objectMap["location"] = scp.Location
7158 }
7159 if scp.Tags != nil {
7160 objectMap["tags"] = scp.Tags
7161 }
7162 return json.Marshal(objectMap)
7163 }
7164
7165
7166 func (scp *ScheduleCreationParameter) UnmarshalJSON(body []byte) error {
7167 var m map[string]*json.RawMessage
7168 err := json.Unmarshal(body, &m)
7169 if err != nil {
7170 return err
7171 }
7172 for k, v := range m {
7173 switch k {
7174 case "properties":
7175 if v != nil {
7176 var scheduleCreationParameterProperties ScheduleCreationParameterProperties
7177 err = json.Unmarshal(*v, &scheduleCreationParameterProperties)
7178 if err != nil {
7179 return err
7180 }
7181 scp.ScheduleCreationParameterProperties = &scheduleCreationParameterProperties
7182 }
7183 case "name":
7184 if v != nil {
7185 var name string
7186 err = json.Unmarshal(*v, &name)
7187 if err != nil {
7188 return err
7189 }
7190 scp.Name = &name
7191 }
7192 case "location":
7193 if v != nil {
7194 var location string
7195 err = json.Unmarshal(*v, &location)
7196 if err != nil {
7197 return err
7198 }
7199 scp.Location = &location
7200 }
7201 case "tags":
7202 if v != nil {
7203 var tags map[string]*string
7204 err = json.Unmarshal(*v, &tags)
7205 if err != nil {
7206 return err
7207 }
7208 scp.Tags = tags
7209 }
7210 }
7211 }
7212
7213 return nil
7214 }
7215
7216
7217 type ScheduleCreationParameterFragment struct {
7218
7219 *ScheduleCreationParameterPropertiesFragment `json:"properties,omitempty"`
7220
7221 Name *string `json:"name,omitempty"`
7222
7223 Location *string `json:"location,omitempty"`
7224
7225 Tags map[string]*string `json:"tags"`
7226 }
7227
7228
7229 func (scpf ScheduleCreationParameterFragment) MarshalJSON() ([]byte, error) {
7230 objectMap := make(map[string]interface{})
7231 if scpf.ScheduleCreationParameterPropertiesFragment != nil {
7232 objectMap["properties"] = scpf.ScheduleCreationParameterPropertiesFragment
7233 }
7234 if scpf.Name != nil {
7235 objectMap["name"] = scpf.Name
7236 }
7237 if scpf.Location != nil {
7238 objectMap["location"] = scpf.Location
7239 }
7240 if scpf.Tags != nil {
7241 objectMap["tags"] = scpf.Tags
7242 }
7243 return json.Marshal(objectMap)
7244 }
7245
7246
7247 func (scpf *ScheduleCreationParameterFragment) UnmarshalJSON(body []byte) error {
7248 var m map[string]*json.RawMessage
7249 err := json.Unmarshal(body, &m)
7250 if err != nil {
7251 return err
7252 }
7253 for k, v := range m {
7254 switch k {
7255 case "properties":
7256 if v != nil {
7257 var scheduleCreationParameterPropertiesFragment ScheduleCreationParameterPropertiesFragment
7258 err = json.Unmarshal(*v, &scheduleCreationParameterPropertiesFragment)
7259 if err != nil {
7260 return err
7261 }
7262 scpf.ScheduleCreationParameterPropertiesFragment = &scheduleCreationParameterPropertiesFragment
7263 }
7264 case "name":
7265 if v != nil {
7266 var name string
7267 err = json.Unmarshal(*v, &name)
7268 if err != nil {
7269 return err
7270 }
7271 scpf.Name = &name
7272 }
7273 case "location":
7274 if v != nil {
7275 var location string
7276 err = json.Unmarshal(*v, &location)
7277 if err != nil {
7278 return err
7279 }
7280 scpf.Location = &location
7281 }
7282 case "tags":
7283 if v != nil {
7284 var tags map[string]*string
7285 err = json.Unmarshal(*v, &tags)
7286 if err != nil {
7287 return err
7288 }
7289 scpf.Tags = tags
7290 }
7291 }
7292 }
7293
7294 return nil
7295 }
7296
7297
7298 type ScheduleCreationParameterProperties struct {
7299
7300 Status EnableStatus `json:"status,omitempty"`
7301
7302 TaskType *string `json:"taskType,omitempty"`
7303
7304 WeeklyRecurrence *WeekDetails `json:"weeklyRecurrence,omitempty"`
7305
7306 DailyRecurrence *DayDetails `json:"dailyRecurrence,omitempty"`
7307
7308 HourlyRecurrence *HourDetails `json:"hourlyRecurrence,omitempty"`
7309
7310 TimeZoneID *string `json:"timeZoneId,omitempty"`
7311
7312 NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"`
7313
7314 TargetResourceID *string `json:"targetResourceId,omitempty"`
7315 }
7316
7317
7318 type ScheduleCreationParameterPropertiesFragment struct {
7319
7320 Status EnableStatus `json:"status,omitempty"`
7321
7322 TaskType *string `json:"taskType,omitempty"`
7323
7324 WeeklyRecurrence *WeekDetailsFragment `json:"weeklyRecurrence,omitempty"`
7325
7326 DailyRecurrence *DayDetailsFragment `json:"dailyRecurrence,omitempty"`
7327
7328 HourlyRecurrence *HourDetailsFragment `json:"hourlyRecurrence,omitempty"`
7329
7330 TimeZoneID *string `json:"timeZoneId,omitempty"`
7331
7332 NotificationSettings *NotificationSettingsFragment `json:"notificationSettings,omitempty"`
7333
7334 TargetResourceID *string `json:"targetResourceId,omitempty"`
7335 }
7336
7337
7338 type ScheduleFragment struct {
7339
7340 *SchedulePropertiesFragment `json:"properties,omitempty"`
7341
7342 Tags map[string]*string `json:"tags"`
7343 }
7344
7345
7346 func (sf ScheduleFragment) MarshalJSON() ([]byte, error) {
7347 objectMap := make(map[string]interface{})
7348 if sf.SchedulePropertiesFragment != nil {
7349 objectMap["properties"] = sf.SchedulePropertiesFragment
7350 }
7351 if sf.Tags != nil {
7352 objectMap["tags"] = sf.Tags
7353 }
7354 return json.Marshal(objectMap)
7355 }
7356
7357
7358 func (sf *ScheduleFragment) UnmarshalJSON(body []byte) error {
7359 var m map[string]*json.RawMessage
7360 err := json.Unmarshal(body, &m)
7361 if err != nil {
7362 return err
7363 }
7364 for k, v := range m {
7365 switch k {
7366 case "properties":
7367 if v != nil {
7368 var schedulePropertiesFragment SchedulePropertiesFragment
7369 err = json.Unmarshal(*v, &schedulePropertiesFragment)
7370 if err != nil {
7371 return err
7372 }
7373 sf.SchedulePropertiesFragment = &schedulePropertiesFragment
7374 }
7375 case "tags":
7376 if v != nil {
7377 var tags map[string]*string
7378 err = json.Unmarshal(*v, &tags)
7379 if err != nil {
7380 return err
7381 }
7382 sf.Tags = tags
7383 }
7384 }
7385 }
7386
7387 return nil
7388 }
7389
7390
7391 type ScheduleList struct {
7392 autorest.Response `json:"-"`
7393
7394 Value *[]Schedule `json:"value,omitempty"`
7395
7396 NextLink *string `json:"nextLink,omitempty"`
7397 }
7398
7399
7400 type ScheduleListIterator struct {
7401 i int
7402 page ScheduleListPage
7403 }
7404
7405
7406
7407 func (iter *ScheduleListIterator) NextWithContext(ctx context.Context) (err error) {
7408 if tracing.IsEnabled() {
7409 ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListIterator.NextWithContext")
7410 defer func() {
7411 sc := -1
7412 if iter.Response().Response.Response != nil {
7413 sc = iter.Response().Response.Response.StatusCode
7414 }
7415 tracing.EndSpan(ctx, sc, err)
7416 }()
7417 }
7418 iter.i++
7419 if iter.i < len(iter.page.Values()) {
7420 return nil
7421 }
7422 err = iter.page.NextWithContext(ctx)
7423 if err != nil {
7424 iter.i--
7425 return err
7426 }
7427 iter.i = 0
7428 return nil
7429 }
7430
7431
7432
7433
7434 func (iter *ScheduleListIterator) Next() error {
7435 return iter.NextWithContext(context.Background())
7436 }
7437
7438
7439 func (iter ScheduleListIterator) NotDone() bool {
7440 return iter.page.NotDone() && iter.i < len(iter.page.Values())
7441 }
7442
7443
7444 func (iter ScheduleListIterator) Response() ScheduleList {
7445 return iter.page.Response()
7446 }
7447
7448
7449
7450 func (iter ScheduleListIterator) Value() Schedule {
7451 if !iter.page.NotDone() {
7452 return Schedule{}
7453 }
7454 return iter.page.Values()[iter.i]
7455 }
7456
7457
7458 func NewScheduleListIterator(page ScheduleListPage) ScheduleListIterator {
7459 return ScheduleListIterator{page: page}
7460 }
7461
7462
7463 func (sl ScheduleList) IsEmpty() bool {
7464 return sl.Value == nil || len(*sl.Value) == 0
7465 }
7466
7467
7468 func (sl ScheduleList) hasNextLink() bool {
7469 return sl.NextLink != nil && len(*sl.NextLink) != 0
7470 }
7471
7472
7473
7474 func (sl ScheduleList) scheduleListPreparer(ctx context.Context) (*http.Request, error) {
7475 if !sl.hasNextLink() {
7476 return nil, nil
7477 }
7478 return autorest.Prepare((&http.Request{}).WithContext(ctx),
7479 autorest.AsJSON(),
7480 autorest.AsGet(),
7481 autorest.WithBaseURL(to.String(sl.NextLink)))
7482 }
7483
7484
7485 type ScheduleListPage struct {
7486 fn func(context.Context, ScheduleList) (ScheduleList, error)
7487 sl ScheduleList
7488 }
7489
7490
7491
7492 func (page *ScheduleListPage) NextWithContext(ctx context.Context) (err error) {
7493 if tracing.IsEnabled() {
7494 ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListPage.NextWithContext")
7495 defer func() {
7496 sc := -1
7497 if page.Response().Response.Response != nil {
7498 sc = page.Response().Response.Response.StatusCode
7499 }
7500 tracing.EndSpan(ctx, sc, err)
7501 }()
7502 }
7503 for {
7504 next, err := page.fn(ctx, page.sl)
7505 if err != nil {
7506 return err
7507 }
7508 page.sl = next
7509 if !next.hasNextLink() || !next.IsEmpty() {
7510 break
7511 }
7512 }
7513 return nil
7514 }
7515
7516
7517
7518
7519 func (page *ScheduleListPage) Next() error {
7520 return page.NextWithContext(context.Background())
7521 }
7522
7523
7524 func (page ScheduleListPage) NotDone() bool {
7525 return !page.sl.IsEmpty()
7526 }
7527
7528
7529 func (page ScheduleListPage) Response() ScheduleList {
7530 return page.sl
7531 }
7532
7533
7534 func (page ScheduleListPage) Values() []Schedule {
7535 if page.sl.IsEmpty() {
7536 return nil
7537 }
7538 return *page.sl.Value
7539 }
7540
7541
7542 func NewScheduleListPage(cur ScheduleList, getNextPage func(context.Context, ScheduleList) (ScheduleList, error)) ScheduleListPage {
7543 return ScheduleListPage{
7544 fn: getNextPage,
7545 sl: cur,
7546 }
7547 }
7548
7549
7550 type ScheduleProperties struct {
7551
7552 Status EnableStatus `json:"status,omitempty"`
7553
7554 TaskType *string `json:"taskType,omitempty"`
7555
7556 WeeklyRecurrence *WeekDetails `json:"weeklyRecurrence,omitempty"`
7557
7558 DailyRecurrence *DayDetails `json:"dailyRecurrence,omitempty"`
7559
7560 HourlyRecurrence *HourDetails `json:"hourlyRecurrence,omitempty"`
7561
7562 TimeZoneID *string `json:"timeZoneId,omitempty"`
7563
7564 NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"`
7565
7566 CreatedDate *date.Time `json:"createdDate,omitempty"`
7567
7568 TargetResourceID *string `json:"targetResourceId,omitempty"`
7569
7570 ProvisioningState *string `json:"provisioningState,omitempty"`
7571
7572 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
7573 }
7574
7575
7576 func (sp ScheduleProperties) MarshalJSON() ([]byte, error) {
7577 objectMap := make(map[string]interface{})
7578 if sp.Status != "" {
7579 objectMap["status"] = sp.Status
7580 }
7581 if sp.TaskType != nil {
7582 objectMap["taskType"] = sp.TaskType
7583 }
7584 if sp.WeeklyRecurrence != nil {
7585 objectMap["weeklyRecurrence"] = sp.WeeklyRecurrence
7586 }
7587 if sp.DailyRecurrence != nil {
7588 objectMap["dailyRecurrence"] = sp.DailyRecurrence
7589 }
7590 if sp.HourlyRecurrence != nil {
7591 objectMap["hourlyRecurrence"] = sp.HourlyRecurrence
7592 }
7593 if sp.TimeZoneID != nil {
7594 objectMap["timeZoneId"] = sp.TimeZoneID
7595 }
7596 if sp.NotificationSettings != nil {
7597 objectMap["notificationSettings"] = sp.NotificationSettings
7598 }
7599 if sp.TargetResourceID != nil {
7600 objectMap["targetResourceId"] = sp.TargetResourceID
7601 }
7602 return json.Marshal(objectMap)
7603 }
7604
7605
7606 type SchedulePropertiesFragment struct {
7607
7608 Status EnableStatus `json:"status,omitempty"`
7609
7610 TaskType *string `json:"taskType,omitempty"`
7611
7612 WeeklyRecurrence *WeekDetailsFragment `json:"weeklyRecurrence,omitempty"`
7613
7614 DailyRecurrence *DayDetailsFragment `json:"dailyRecurrence,omitempty"`
7615
7616 HourlyRecurrence *HourDetailsFragment `json:"hourlyRecurrence,omitempty"`
7617
7618 TimeZoneID *string `json:"timeZoneId,omitempty"`
7619
7620 NotificationSettings *NotificationSettingsFragment `json:"notificationSettings,omitempty"`
7621
7622 TargetResourceID *string `json:"targetResourceId,omitempty"`
7623 }
7624
7625
7626
7627 type SchedulesExecuteFuture struct {
7628 azure.FutureAPI
7629
7630
7631 Result func(SchedulesClient) (autorest.Response, error)
7632 }
7633
7634
7635 func (future *SchedulesExecuteFuture) UnmarshalJSON(body []byte) error {
7636 var azFuture azure.Future
7637 if err := json.Unmarshal(body, &azFuture); err != nil {
7638 return err
7639 }
7640 future.FutureAPI = &azFuture
7641 future.Result = future.result
7642 return nil
7643 }
7644
7645
7646 func (future *SchedulesExecuteFuture) result(client SchedulesClient) (ar autorest.Response, err error) {
7647 var done bool
7648 done, err = future.DoneWithContext(context.Background(), client)
7649 if err != nil {
7650 err = autorest.NewErrorWithError(err, "dtl.SchedulesExecuteFuture", "Result", future.Response(), "Polling failure")
7651 return
7652 }
7653 if !done {
7654 ar.Response = future.Response()
7655 err = azure.NewAsyncOpIncompleteError("dtl.SchedulesExecuteFuture")
7656 return
7657 }
7658 ar.Response = future.Response()
7659 return
7660 }
7661
7662
7663 type Secret struct {
7664 autorest.Response `json:"-"`
7665
7666 *SecretProperties `json:"properties,omitempty"`
7667
7668 ID *string `json:"id,omitempty"`
7669
7670 Name *string `json:"name,omitempty"`
7671
7672 Type *string `json:"type,omitempty"`
7673
7674 Location *string `json:"location,omitempty"`
7675
7676 Tags map[string]*string `json:"tags"`
7677 }
7678
7679
7680 func (s Secret) MarshalJSON() ([]byte, error) {
7681 objectMap := make(map[string]interface{})
7682 if s.SecretProperties != nil {
7683 objectMap["properties"] = s.SecretProperties
7684 }
7685 if s.Location != nil {
7686 objectMap["location"] = s.Location
7687 }
7688 if s.Tags != nil {
7689 objectMap["tags"] = s.Tags
7690 }
7691 return json.Marshal(objectMap)
7692 }
7693
7694
7695 func (s *Secret) UnmarshalJSON(body []byte) error {
7696 var m map[string]*json.RawMessage
7697 err := json.Unmarshal(body, &m)
7698 if err != nil {
7699 return err
7700 }
7701 for k, v := range m {
7702 switch k {
7703 case "properties":
7704 if v != nil {
7705 var secretProperties SecretProperties
7706 err = json.Unmarshal(*v, &secretProperties)
7707 if err != nil {
7708 return err
7709 }
7710 s.SecretProperties = &secretProperties
7711 }
7712 case "id":
7713 if v != nil {
7714 var ID string
7715 err = json.Unmarshal(*v, &ID)
7716 if err != nil {
7717 return err
7718 }
7719 s.ID = &ID
7720 }
7721 case "name":
7722 if v != nil {
7723 var name string
7724 err = json.Unmarshal(*v, &name)
7725 if err != nil {
7726 return err
7727 }
7728 s.Name = &name
7729 }
7730 case "type":
7731 if v != nil {
7732 var typeVar string
7733 err = json.Unmarshal(*v, &typeVar)
7734 if err != nil {
7735 return err
7736 }
7737 s.Type = &typeVar
7738 }
7739 case "location":
7740 if v != nil {
7741 var location string
7742 err = json.Unmarshal(*v, &location)
7743 if err != nil {
7744 return err
7745 }
7746 s.Location = &location
7747 }
7748 case "tags":
7749 if v != nil {
7750 var tags map[string]*string
7751 err = json.Unmarshal(*v, &tags)
7752 if err != nil {
7753 return err
7754 }
7755 s.Tags = tags
7756 }
7757 }
7758 }
7759
7760 return nil
7761 }
7762
7763
7764 type SecretFragment struct {
7765
7766 *SecretPropertiesFragment `json:"properties,omitempty"`
7767
7768 Tags map[string]*string `json:"tags"`
7769 }
7770
7771
7772 func (sf SecretFragment) MarshalJSON() ([]byte, error) {
7773 objectMap := make(map[string]interface{})
7774 if sf.SecretPropertiesFragment != nil {
7775 objectMap["properties"] = sf.SecretPropertiesFragment
7776 }
7777 if sf.Tags != nil {
7778 objectMap["tags"] = sf.Tags
7779 }
7780 return json.Marshal(objectMap)
7781 }
7782
7783
7784 func (sf *SecretFragment) UnmarshalJSON(body []byte) error {
7785 var m map[string]*json.RawMessage
7786 err := json.Unmarshal(body, &m)
7787 if err != nil {
7788 return err
7789 }
7790 for k, v := range m {
7791 switch k {
7792 case "properties":
7793 if v != nil {
7794 var secretPropertiesFragment SecretPropertiesFragment
7795 err = json.Unmarshal(*v, &secretPropertiesFragment)
7796 if err != nil {
7797 return err
7798 }
7799 sf.SecretPropertiesFragment = &secretPropertiesFragment
7800 }
7801 case "tags":
7802 if v != nil {
7803 var tags map[string]*string
7804 err = json.Unmarshal(*v, &tags)
7805 if err != nil {
7806 return err
7807 }
7808 sf.Tags = tags
7809 }
7810 }
7811 }
7812
7813 return nil
7814 }
7815
7816
7817 type SecretList struct {
7818 autorest.Response `json:"-"`
7819
7820 Value *[]Secret `json:"value,omitempty"`
7821
7822 NextLink *string `json:"nextLink,omitempty"`
7823 }
7824
7825
7826 type SecretListIterator struct {
7827 i int
7828 page SecretListPage
7829 }
7830
7831
7832
7833 func (iter *SecretListIterator) NextWithContext(ctx context.Context) (err error) {
7834 if tracing.IsEnabled() {
7835 ctx = tracing.StartSpan(ctx, fqdn+"/SecretListIterator.NextWithContext")
7836 defer func() {
7837 sc := -1
7838 if iter.Response().Response.Response != nil {
7839 sc = iter.Response().Response.Response.StatusCode
7840 }
7841 tracing.EndSpan(ctx, sc, err)
7842 }()
7843 }
7844 iter.i++
7845 if iter.i < len(iter.page.Values()) {
7846 return nil
7847 }
7848 err = iter.page.NextWithContext(ctx)
7849 if err != nil {
7850 iter.i--
7851 return err
7852 }
7853 iter.i = 0
7854 return nil
7855 }
7856
7857
7858
7859
7860 func (iter *SecretListIterator) Next() error {
7861 return iter.NextWithContext(context.Background())
7862 }
7863
7864
7865 func (iter SecretListIterator) NotDone() bool {
7866 return iter.page.NotDone() && iter.i < len(iter.page.Values())
7867 }
7868
7869
7870 func (iter SecretListIterator) Response() SecretList {
7871 return iter.page.Response()
7872 }
7873
7874
7875
7876 func (iter SecretListIterator) Value() Secret {
7877 if !iter.page.NotDone() {
7878 return Secret{}
7879 }
7880 return iter.page.Values()[iter.i]
7881 }
7882
7883
7884 func NewSecretListIterator(page SecretListPage) SecretListIterator {
7885 return SecretListIterator{page: page}
7886 }
7887
7888
7889 func (sl SecretList) IsEmpty() bool {
7890 return sl.Value == nil || len(*sl.Value) == 0
7891 }
7892
7893
7894 func (sl SecretList) hasNextLink() bool {
7895 return sl.NextLink != nil && len(*sl.NextLink) != 0
7896 }
7897
7898
7899
7900 func (sl SecretList) secretListPreparer(ctx context.Context) (*http.Request, error) {
7901 if !sl.hasNextLink() {
7902 return nil, nil
7903 }
7904 return autorest.Prepare((&http.Request{}).WithContext(ctx),
7905 autorest.AsJSON(),
7906 autorest.AsGet(),
7907 autorest.WithBaseURL(to.String(sl.NextLink)))
7908 }
7909
7910
7911 type SecretListPage struct {
7912 fn func(context.Context, SecretList) (SecretList, error)
7913 sl SecretList
7914 }
7915
7916
7917
7918 func (page *SecretListPage) NextWithContext(ctx context.Context) (err error) {
7919 if tracing.IsEnabled() {
7920 ctx = tracing.StartSpan(ctx, fqdn+"/SecretListPage.NextWithContext")
7921 defer func() {
7922 sc := -1
7923 if page.Response().Response.Response != nil {
7924 sc = page.Response().Response.Response.StatusCode
7925 }
7926 tracing.EndSpan(ctx, sc, err)
7927 }()
7928 }
7929 for {
7930 next, err := page.fn(ctx, page.sl)
7931 if err != nil {
7932 return err
7933 }
7934 page.sl = next
7935 if !next.hasNextLink() || !next.IsEmpty() {
7936 break
7937 }
7938 }
7939 return nil
7940 }
7941
7942
7943
7944
7945 func (page *SecretListPage) Next() error {
7946 return page.NextWithContext(context.Background())
7947 }
7948
7949
7950 func (page SecretListPage) NotDone() bool {
7951 return !page.sl.IsEmpty()
7952 }
7953
7954
7955 func (page SecretListPage) Response() SecretList {
7956 return page.sl
7957 }
7958
7959
7960 func (page SecretListPage) Values() []Secret {
7961 if page.sl.IsEmpty() {
7962 return nil
7963 }
7964 return *page.sl.Value
7965 }
7966
7967
7968 func NewSecretListPage(cur SecretList, getNextPage func(context.Context, SecretList) (SecretList, error)) SecretListPage {
7969 return SecretListPage{
7970 fn: getNextPage,
7971 sl: cur,
7972 }
7973 }
7974
7975
7976 type SecretProperties struct {
7977
7978 Value *string `json:"value,omitempty"`
7979
7980 ProvisioningState *string `json:"provisioningState,omitempty"`
7981
7982 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
7983 }
7984
7985
7986 func (sp SecretProperties) MarshalJSON() ([]byte, error) {
7987 objectMap := make(map[string]interface{})
7988 if sp.Value != nil {
7989 objectMap["value"] = sp.Value
7990 }
7991 return json.Marshal(objectMap)
7992 }
7993
7994
7995 type SecretPropertiesFragment struct {
7996
7997 Value *string `json:"value,omitempty"`
7998 }
7999
8000
8001
8002 type SecretsCreateOrUpdateFuture struct {
8003 azure.FutureAPI
8004
8005
8006 Result func(SecretsClient) (Secret, error)
8007 }
8008
8009
8010 func (future *SecretsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8011 var azFuture azure.Future
8012 if err := json.Unmarshal(body, &azFuture); err != nil {
8013 return err
8014 }
8015 future.FutureAPI = &azFuture
8016 future.Result = future.result
8017 return nil
8018 }
8019
8020
8021 func (future *SecretsCreateOrUpdateFuture) result(client SecretsClient) (s Secret, err error) {
8022 var done bool
8023 done, err = future.DoneWithContext(context.Background(), client)
8024 if err != nil {
8025 err = autorest.NewErrorWithError(err, "dtl.SecretsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8026 return
8027 }
8028 if !done {
8029 s.Response.Response = future.Response()
8030 err = azure.NewAsyncOpIncompleteError("dtl.SecretsCreateOrUpdateFuture")
8031 return
8032 }
8033 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8034 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
8035 s, err = client.CreateOrUpdateResponder(s.Response.Response)
8036 if err != nil {
8037 err = autorest.NewErrorWithError(err, "dtl.SecretsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
8038 }
8039 }
8040 return
8041 }
8042
8043
8044 type ServiceFabric struct {
8045 autorest.Response `json:"-"`
8046
8047 *ServiceFabricProperties `json:"properties,omitempty"`
8048
8049 ID *string `json:"id,omitempty"`
8050
8051 Name *string `json:"name,omitempty"`
8052
8053 Type *string `json:"type,omitempty"`
8054
8055 Location *string `json:"location,omitempty"`
8056
8057 Tags map[string]*string `json:"tags"`
8058 }
8059
8060
8061 func (sf ServiceFabric) MarshalJSON() ([]byte, error) {
8062 objectMap := make(map[string]interface{})
8063 if sf.ServiceFabricProperties != nil {
8064 objectMap["properties"] = sf.ServiceFabricProperties
8065 }
8066 if sf.Location != nil {
8067 objectMap["location"] = sf.Location
8068 }
8069 if sf.Tags != nil {
8070 objectMap["tags"] = sf.Tags
8071 }
8072 return json.Marshal(objectMap)
8073 }
8074
8075
8076 func (sf *ServiceFabric) UnmarshalJSON(body []byte) error {
8077 var m map[string]*json.RawMessage
8078 err := json.Unmarshal(body, &m)
8079 if err != nil {
8080 return err
8081 }
8082 for k, v := range m {
8083 switch k {
8084 case "properties":
8085 if v != nil {
8086 var serviceFabricProperties ServiceFabricProperties
8087 err = json.Unmarshal(*v, &serviceFabricProperties)
8088 if err != nil {
8089 return err
8090 }
8091 sf.ServiceFabricProperties = &serviceFabricProperties
8092 }
8093 case "id":
8094 if v != nil {
8095 var ID string
8096 err = json.Unmarshal(*v, &ID)
8097 if err != nil {
8098 return err
8099 }
8100 sf.ID = &ID
8101 }
8102 case "name":
8103 if v != nil {
8104 var name string
8105 err = json.Unmarshal(*v, &name)
8106 if err != nil {
8107 return err
8108 }
8109 sf.Name = &name
8110 }
8111 case "type":
8112 if v != nil {
8113 var typeVar string
8114 err = json.Unmarshal(*v, &typeVar)
8115 if err != nil {
8116 return err
8117 }
8118 sf.Type = &typeVar
8119 }
8120 case "location":
8121 if v != nil {
8122 var location string
8123 err = json.Unmarshal(*v, &location)
8124 if err != nil {
8125 return err
8126 }
8127 sf.Location = &location
8128 }
8129 case "tags":
8130 if v != nil {
8131 var tags map[string]*string
8132 err = json.Unmarshal(*v, &tags)
8133 if err != nil {
8134 return err
8135 }
8136 sf.Tags = tags
8137 }
8138 }
8139 }
8140
8141 return nil
8142 }
8143
8144
8145 type ServiceFabricFragment struct {
8146
8147 *ServiceFabricPropertiesFragment `json:"properties,omitempty"`
8148
8149 Tags map[string]*string `json:"tags"`
8150 }
8151
8152
8153 func (sff ServiceFabricFragment) MarshalJSON() ([]byte, error) {
8154 objectMap := make(map[string]interface{})
8155 if sff.ServiceFabricPropertiesFragment != nil {
8156 objectMap["properties"] = sff.ServiceFabricPropertiesFragment
8157 }
8158 if sff.Tags != nil {
8159 objectMap["tags"] = sff.Tags
8160 }
8161 return json.Marshal(objectMap)
8162 }
8163
8164
8165 func (sff *ServiceFabricFragment) UnmarshalJSON(body []byte) error {
8166 var m map[string]*json.RawMessage
8167 err := json.Unmarshal(body, &m)
8168 if err != nil {
8169 return err
8170 }
8171 for k, v := range m {
8172 switch k {
8173 case "properties":
8174 if v != nil {
8175 var serviceFabricPropertiesFragment ServiceFabricPropertiesFragment
8176 err = json.Unmarshal(*v, &serviceFabricPropertiesFragment)
8177 if err != nil {
8178 return err
8179 }
8180 sff.ServiceFabricPropertiesFragment = &serviceFabricPropertiesFragment
8181 }
8182 case "tags":
8183 if v != nil {
8184 var tags map[string]*string
8185 err = json.Unmarshal(*v, &tags)
8186 if err != nil {
8187 return err
8188 }
8189 sff.Tags = tags
8190 }
8191 }
8192 }
8193
8194 return nil
8195 }
8196
8197
8198 type ServiceFabricList struct {
8199 autorest.Response `json:"-"`
8200
8201 Value *[]ServiceFabric `json:"value,omitempty"`
8202
8203 NextLink *string `json:"nextLink,omitempty"`
8204 }
8205
8206
8207 type ServiceFabricListIterator struct {
8208 i int
8209 page ServiceFabricListPage
8210 }
8211
8212
8213
8214 func (iter *ServiceFabricListIterator) NextWithContext(ctx context.Context) (err error) {
8215 if tracing.IsEnabled() {
8216 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricListIterator.NextWithContext")
8217 defer func() {
8218 sc := -1
8219 if iter.Response().Response.Response != nil {
8220 sc = iter.Response().Response.Response.StatusCode
8221 }
8222 tracing.EndSpan(ctx, sc, err)
8223 }()
8224 }
8225 iter.i++
8226 if iter.i < len(iter.page.Values()) {
8227 return nil
8228 }
8229 err = iter.page.NextWithContext(ctx)
8230 if err != nil {
8231 iter.i--
8232 return err
8233 }
8234 iter.i = 0
8235 return nil
8236 }
8237
8238
8239
8240
8241 func (iter *ServiceFabricListIterator) Next() error {
8242 return iter.NextWithContext(context.Background())
8243 }
8244
8245
8246 func (iter ServiceFabricListIterator) NotDone() bool {
8247 return iter.page.NotDone() && iter.i < len(iter.page.Values())
8248 }
8249
8250
8251 func (iter ServiceFabricListIterator) Response() ServiceFabricList {
8252 return iter.page.Response()
8253 }
8254
8255
8256
8257 func (iter ServiceFabricListIterator) Value() ServiceFabric {
8258 if !iter.page.NotDone() {
8259 return ServiceFabric{}
8260 }
8261 return iter.page.Values()[iter.i]
8262 }
8263
8264
8265 func NewServiceFabricListIterator(page ServiceFabricListPage) ServiceFabricListIterator {
8266 return ServiceFabricListIterator{page: page}
8267 }
8268
8269
8270 func (sfl ServiceFabricList) IsEmpty() bool {
8271 return sfl.Value == nil || len(*sfl.Value) == 0
8272 }
8273
8274
8275 func (sfl ServiceFabricList) hasNextLink() bool {
8276 return sfl.NextLink != nil && len(*sfl.NextLink) != 0
8277 }
8278
8279
8280
8281 func (sfl ServiceFabricList) serviceFabricListPreparer(ctx context.Context) (*http.Request, error) {
8282 if !sfl.hasNextLink() {
8283 return nil, nil
8284 }
8285 return autorest.Prepare((&http.Request{}).WithContext(ctx),
8286 autorest.AsJSON(),
8287 autorest.AsGet(),
8288 autorest.WithBaseURL(to.String(sfl.NextLink)))
8289 }
8290
8291
8292 type ServiceFabricListPage struct {
8293 fn func(context.Context, ServiceFabricList) (ServiceFabricList, error)
8294 sfl ServiceFabricList
8295 }
8296
8297
8298
8299 func (page *ServiceFabricListPage) NextWithContext(ctx context.Context) (err error) {
8300 if tracing.IsEnabled() {
8301 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricListPage.NextWithContext")
8302 defer func() {
8303 sc := -1
8304 if page.Response().Response.Response != nil {
8305 sc = page.Response().Response.Response.StatusCode
8306 }
8307 tracing.EndSpan(ctx, sc, err)
8308 }()
8309 }
8310 for {
8311 next, err := page.fn(ctx, page.sfl)
8312 if err != nil {
8313 return err
8314 }
8315 page.sfl = next
8316 if !next.hasNextLink() || !next.IsEmpty() {
8317 break
8318 }
8319 }
8320 return nil
8321 }
8322
8323
8324
8325
8326 func (page *ServiceFabricListPage) Next() error {
8327 return page.NextWithContext(context.Background())
8328 }
8329
8330
8331 func (page ServiceFabricListPage) NotDone() bool {
8332 return !page.sfl.IsEmpty()
8333 }
8334
8335
8336 func (page ServiceFabricListPage) Response() ServiceFabricList {
8337 return page.sfl
8338 }
8339
8340
8341 func (page ServiceFabricListPage) Values() []ServiceFabric {
8342 if page.sfl.IsEmpty() {
8343 return nil
8344 }
8345 return *page.sfl.Value
8346 }
8347
8348
8349 func NewServiceFabricListPage(cur ServiceFabricList, getNextPage func(context.Context, ServiceFabricList) (ServiceFabricList, error)) ServiceFabricListPage {
8350 return ServiceFabricListPage{
8351 fn: getNextPage,
8352 sfl: cur,
8353 }
8354 }
8355
8356
8357 type ServiceFabricProperties struct {
8358
8359 ExternalServiceFabricID *string `json:"externalServiceFabricId,omitempty"`
8360
8361 EnvironmentID *string `json:"environmentId,omitempty"`
8362
8363 ApplicableSchedule *ApplicableSchedule `json:"applicableSchedule,omitempty"`
8364
8365 ProvisioningState *string `json:"provisioningState,omitempty"`
8366
8367 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
8368 }
8369
8370
8371 func (sfp ServiceFabricProperties) MarshalJSON() ([]byte, error) {
8372 objectMap := make(map[string]interface{})
8373 if sfp.ExternalServiceFabricID != nil {
8374 objectMap["externalServiceFabricId"] = sfp.ExternalServiceFabricID
8375 }
8376 if sfp.EnvironmentID != nil {
8377 objectMap["environmentId"] = sfp.EnvironmentID
8378 }
8379 return json.Marshal(objectMap)
8380 }
8381
8382
8383 type ServiceFabricPropertiesFragment struct {
8384
8385 ExternalServiceFabricID *string `json:"externalServiceFabricId,omitempty"`
8386
8387 EnvironmentID *string `json:"environmentId,omitempty"`
8388 }
8389
8390
8391
8392 type ServiceFabricSchedulesExecuteFuture struct {
8393 azure.FutureAPI
8394
8395
8396 Result func(ServiceFabricSchedulesClient) (autorest.Response, error)
8397 }
8398
8399
8400 func (future *ServiceFabricSchedulesExecuteFuture) UnmarshalJSON(body []byte) error {
8401 var azFuture azure.Future
8402 if err := json.Unmarshal(body, &azFuture); err != nil {
8403 return err
8404 }
8405 future.FutureAPI = &azFuture
8406 future.Result = future.result
8407 return nil
8408 }
8409
8410
8411 func (future *ServiceFabricSchedulesExecuteFuture) result(client ServiceFabricSchedulesClient) (ar autorest.Response, err error) {
8412 var done bool
8413 done, err = future.DoneWithContext(context.Background(), client)
8414 if err != nil {
8415 err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesExecuteFuture", "Result", future.Response(), "Polling failure")
8416 return
8417 }
8418 if !done {
8419 ar.Response = future.Response()
8420 err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricSchedulesExecuteFuture")
8421 return
8422 }
8423 ar.Response = future.Response()
8424 return
8425 }
8426
8427
8428
8429 type ServiceFabricsCreateOrUpdateFuture struct {
8430 azure.FutureAPI
8431
8432
8433 Result func(ServiceFabricsClient) (ServiceFabric, error)
8434 }
8435
8436
8437 func (future *ServiceFabricsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8438 var azFuture azure.Future
8439 if err := json.Unmarshal(body, &azFuture); err != nil {
8440 return err
8441 }
8442 future.FutureAPI = &azFuture
8443 future.Result = future.result
8444 return nil
8445 }
8446
8447
8448 func (future *ServiceFabricsCreateOrUpdateFuture) result(client ServiceFabricsClient) (sf ServiceFabric, err error) {
8449 var done bool
8450 done, err = future.DoneWithContext(context.Background(), client)
8451 if err != nil {
8452 err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8453 return
8454 }
8455 if !done {
8456 sf.Response.Response = future.Response()
8457 err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricsCreateOrUpdateFuture")
8458 return
8459 }
8460 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8461 if sf.Response.Response, err = future.GetResult(sender); err == nil && sf.Response.Response.StatusCode != http.StatusNoContent {
8462 sf, err = client.CreateOrUpdateResponder(sf.Response.Response)
8463 if err != nil {
8464 err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsCreateOrUpdateFuture", "Result", sf.Response.Response, "Failure responding to request")
8465 }
8466 }
8467 return
8468 }
8469
8470
8471
8472 type ServiceFabricsDeleteFuture struct {
8473 azure.FutureAPI
8474
8475
8476 Result func(ServiceFabricsClient) (autorest.Response, error)
8477 }
8478
8479
8480 func (future *ServiceFabricsDeleteFuture) UnmarshalJSON(body []byte) error {
8481 var azFuture azure.Future
8482 if err := json.Unmarshal(body, &azFuture); err != nil {
8483 return err
8484 }
8485 future.FutureAPI = &azFuture
8486 future.Result = future.result
8487 return nil
8488 }
8489
8490
8491 func (future *ServiceFabricsDeleteFuture) result(client ServiceFabricsClient) (ar autorest.Response, err error) {
8492 var done bool
8493 done, err = future.DoneWithContext(context.Background(), client)
8494 if err != nil {
8495 err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsDeleteFuture", "Result", future.Response(), "Polling failure")
8496 return
8497 }
8498 if !done {
8499 ar.Response = future.Response()
8500 err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricsDeleteFuture")
8501 return
8502 }
8503 ar.Response = future.Response()
8504 return
8505 }
8506
8507
8508
8509 type ServiceFabricsStartFuture struct {
8510 azure.FutureAPI
8511
8512
8513 Result func(ServiceFabricsClient) (autorest.Response, error)
8514 }
8515
8516
8517 func (future *ServiceFabricsStartFuture) UnmarshalJSON(body []byte) error {
8518 var azFuture azure.Future
8519 if err := json.Unmarshal(body, &azFuture); err != nil {
8520 return err
8521 }
8522 future.FutureAPI = &azFuture
8523 future.Result = future.result
8524 return nil
8525 }
8526
8527
8528 func (future *ServiceFabricsStartFuture) result(client ServiceFabricsClient) (ar autorest.Response, err error) {
8529 var done bool
8530 done, err = future.DoneWithContext(context.Background(), client)
8531 if err != nil {
8532 err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsStartFuture", "Result", future.Response(), "Polling failure")
8533 return
8534 }
8535 if !done {
8536 ar.Response = future.Response()
8537 err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricsStartFuture")
8538 return
8539 }
8540 ar.Response = future.Response()
8541 return
8542 }
8543
8544
8545
8546 type ServiceFabricsStopFuture struct {
8547 azure.FutureAPI
8548
8549
8550 Result func(ServiceFabricsClient) (autorest.Response, error)
8551 }
8552
8553
8554 func (future *ServiceFabricsStopFuture) UnmarshalJSON(body []byte) error {
8555 var azFuture azure.Future
8556 if err := json.Unmarshal(body, &azFuture); err != nil {
8557 return err
8558 }
8559 future.FutureAPI = &azFuture
8560 future.Result = future.result
8561 return nil
8562 }
8563
8564
8565 func (future *ServiceFabricsStopFuture) result(client ServiceFabricsClient) (ar autorest.Response, err error) {
8566 var done bool
8567 done, err = future.DoneWithContext(context.Background(), client)
8568 if err != nil {
8569 err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsStopFuture", "Result", future.Response(), "Polling failure")
8570 return
8571 }
8572 if !done {
8573 ar.Response = future.Response()
8574 err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricsStopFuture")
8575 return
8576 }
8577 ar.Response = future.Response()
8578 return
8579 }
8580
8581
8582 type ServiceRunner struct {
8583 autorest.Response `json:"-"`
8584
8585 Identity *IdentityProperties `json:"identity,omitempty"`
8586
8587 ID *string `json:"id,omitempty"`
8588
8589 Name *string `json:"name,omitempty"`
8590
8591 Type *string `json:"type,omitempty"`
8592
8593 Location *string `json:"location,omitempty"`
8594
8595 Tags map[string]*string `json:"tags"`
8596 }
8597
8598
8599 func (sr ServiceRunner) MarshalJSON() ([]byte, error) {
8600 objectMap := make(map[string]interface{})
8601 if sr.Identity != nil {
8602 objectMap["identity"] = sr.Identity
8603 }
8604 if sr.Location != nil {
8605 objectMap["location"] = sr.Location
8606 }
8607 if sr.Tags != nil {
8608 objectMap["tags"] = sr.Tags
8609 }
8610 return json.Marshal(objectMap)
8611 }
8612
8613
8614
8615 type SharedPublicIPAddressConfiguration struct {
8616
8617 InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"`
8618 }
8619
8620
8621
8622 type SharedPublicIPAddressConfigurationFragment struct {
8623
8624 InboundNatRules *[]InboundNatRuleFragment `json:"inboundNatRules,omitempty"`
8625 }
8626
8627
8628
8629 type ShutdownNotificationContent struct {
8630
8631 SkipURL *string `json:"skipUrl,omitempty"`
8632
8633 DelayURL60 *string `json:"delayUrl60,omitempty"`
8634
8635 DelayURL120 *string `json:"delayUrl120,omitempty"`
8636
8637 VMName *string `json:"vmName,omitempty"`
8638
8639 GUID *string `json:"guid,omitempty"`
8640
8641 Owner *string `json:"owner,omitempty"`
8642
8643 VMURL *string `json:"vmUrl,omitempty"`
8644
8645 MinutesUntilShutdown *string `json:"minutesUntilShutdown,omitempty"`
8646
8647 EventType *string `json:"eventType,omitempty"`
8648
8649 Text *string `json:"text,omitempty"`
8650
8651 SubscriptionID *string `json:"subscriptionId,omitempty"`
8652
8653 ResourceGroupName *string `json:"resourceGroupName,omitempty"`
8654
8655 LabName *string `json:"labName,omitempty"`
8656 }
8657
8658
8659 type Subnet struct {
8660
8661 ResourceID *string `json:"resourceId,omitempty"`
8662
8663 LabSubnetName *string `json:"labSubnetName,omitempty"`
8664
8665 AllowPublicIP UsagePermissionType `json:"allowPublicIp,omitempty"`
8666 }
8667
8668
8669 type SubnetFragment struct {
8670
8671 ResourceID *string `json:"resourceId,omitempty"`
8672
8673 LabSubnetName *string `json:"labSubnetName,omitempty"`
8674
8675 AllowPublicIP UsagePermissionType `json:"allowPublicIp,omitempty"`
8676 }
8677
8678
8679 type SubnetOverride struct {
8680
8681 ResourceID *string `json:"resourceId,omitempty"`
8682
8683 LabSubnetName *string `json:"labSubnetName,omitempty"`
8684
8685 UseInVMCreationPermission UsagePermissionType `json:"useInVmCreationPermission,omitempty"`
8686
8687 UsePublicIPAddressPermission UsagePermissionType `json:"usePublicIpAddressPermission,omitempty"`
8688
8689 SharedPublicIPAddressConfiguration *SubnetSharedPublicIPAddressConfiguration `json:"sharedPublicIpAddressConfiguration,omitempty"`
8690
8691 VirtualNetworkPoolName *string `json:"virtualNetworkPoolName,omitempty"`
8692 }
8693
8694
8695 type SubnetOverrideFragment struct {
8696
8697 ResourceID *string `json:"resourceId,omitempty"`
8698
8699 LabSubnetName *string `json:"labSubnetName,omitempty"`
8700
8701 UseInVMCreationPermission UsagePermissionType `json:"useInVmCreationPermission,omitempty"`
8702
8703 UsePublicIPAddressPermission UsagePermissionType `json:"usePublicIpAddressPermission,omitempty"`
8704
8705 SharedPublicIPAddressConfiguration *SubnetSharedPublicIPAddressConfigurationFragment `json:"sharedPublicIpAddressConfiguration,omitempty"`
8706
8707 VirtualNetworkPoolName *string `json:"virtualNetworkPoolName,omitempty"`
8708 }
8709
8710
8711 type SubnetSharedPublicIPAddressConfiguration struct {
8712
8713 AllowedPorts *[]Port `json:"allowedPorts,omitempty"`
8714 }
8715
8716
8717 type SubnetSharedPublicIPAddressConfigurationFragment struct {
8718
8719 AllowedPorts *[]PortFragment `json:"allowedPorts,omitempty"`
8720 }
8721
8722
8723 type TargetCostProperties struct {
8724
8725 Status TargetCostStatus `json:"status,omitempty"`
8726
8727 Target *int32 `json:"target,omitempty"`
8728
8729 CostThresholds *[]CostThresholdProperties `json:"costThresholds,omitempty"`
8730
8731 CycleStartDateTime *date.Time `json:"cycleStartDateTime,omitempty"`
8732
8733 CycleEndDateTime *date.Time `json:"cycleEndDateTime,omitempty"`
8734
8735 CycleType ReportingCycleType `json:"cycleType,omitempty"`
8736 }
8737
8738
8739 type UpdateResource struct {
8740
8741 Tags map[string]*string `json:"tags"`
8742 }
8743
8744
8745 func (ur UpdateResource) MarshalJSON() ([]byte, error) {
8746 objectMap := make(map[string]interface{})
8747 if ur.Tags != nil {
8748 objectMap["tags"] = ur.Tags
8749 }
8750 return json.Marshal(objectMap)
8751 }
8752
8753
8754 type User struct {
8755 autorest.Response `json:"-"`
8756
8757 *UserProperties `json:"properties,omitempty"`
8758
8759 ID *string `json:"id,omitempty"`
8760
8761 Name *string `json:"name,omitempty"`
8762
8763 Type *string `json:"type,omitempty"`
8764
8765 Location *string `json:"location,omitempty"`
8766
8767 Tags map[string]*string `json:"tags"`
8768 }
8769
8770
8771 func (u User) MarshalJSON() ([]byte, error) {
8772 objectMap := make(map[string]interface{})
8773 if u.UserProperties != nil {
8774 objectMap["properties"] = u.UserProperties
8775 }
8776 if u.Location != nil {
8777 objectMap["location"] = u.Location
8778 }
8779 if u.Tags != nil {
8780 objectMap["tags"] = u.Tags
8781 }
8782 return json.Marshal(objectMap)
8783 }
8784
8785
8786 func (u *User) UnmarshalJSON(body []byte) error {
8787 var m map[string]*json.RawMessage
8788 err := json.Unmarshal(body, &m)
8789 if err != nil {
8790 return err
8791 }
8792 for k, v := range m {
8793 switch k {
8794 case "properties":
8795 if v != nil {
8796 var userProperties UserProperties
8797 err = json.Unmarshal(*v, &userProperties)
8798 if err != nil {
8799 return err
8800 }
8801 u.UserProperties = &userProperties
8802 }
8803 case "id":
8804 if v != nil {
8805 var ID string
8806 err = json.Unmarshal(*v, &ID)
8807 if err != nil {
8808 return err
8809 }
8810 u.ID = &ID
8811 }
8812 case "name":
8813 if v != nil {
8814 var name string
8815 err = json.Unmarshal(*v, &name)
8816 if err != nil {
8817 return err
8818 }
8819 u.Name = &name
8820 }
8821 case "type":
8822 if v != nil {
8823 var typeVar string
8824 err = json.Unmarshal(*v, &typeVar)
8825 if err != nil {
8826 return err
8827 }
8828 u.Type = &typeVar
8829 }
8830 case "location":
8831 if v != nil {
8832 var location string
8833 err = json.Unmarshal(*v, &location)
8834 if err != nil {
8835 return err
8836 }
8837 u.Location = &location
8838 }
8839 case "tags":
8840 if v != nil {
8841 var tags map[string]*string
8842 err = json.Unmarshal(*v, &tags)
8843 if err != nil {
8844 return err
8845 }
8846 u.Tags = tags
8847 }
8848 }
8849 }
8850
8851 return nil
8852 }
8853
8854
8855 type UserFragment struct {
8856
8857 *UserPropertiesFragment `json:"properties,omitempty"`
8858
8859 Tags map[string]*string `json:"tags"`
8860 }
8861
8862
8863 func (uf UserFragment) MarshalJSON() ([]byte, error) {
8864 objectMap := make(map[string]interface{})
8865 if uf.UserPropertiesFragment != nil {
8866 objectMap["properties"] = uf.UserPropertiesFragment
8867 }
8868 if uf.Tags != nil {
8869 objectMap["tags"] = uf.Tags
8870 }
8871 return json.Marshal(objectMap)
8872 }
8873
8874
8875 func (uf *UserFragment) UnmarshalJSON(body []byte) error {
8876 var m map[string]*json.RawMessage
8877 err := json.Unmarshal(body, &m)
8878 if err != nil {
8879 return err
8880 }
8881 for k, v := range m {
8882 switch k {
8883 case "properties":
8884 if v != nil {
8885 var userPropertiesFragment UserPropertiesFragment
8886 err = json.Unmarshal(*v, &userPropertiesFragment)
8887 if err != nil {
8888 return err
8889 }
8890 uf.UserPropertiesFragment = &userPropertiesFragment
8891 }
8892 case "tags":
8893 if v != nil {
8894 var tags map[string]*string
8895 err = json.Unmarshal(*v, &tags)
8896 if err != nil {
8897 return err
8898 }
8899 uf.Tags = tags
8900 }
8901 }
8902 }
8903
8904 return nil
8905 }
8906
8907
8908 type UserIdentity struct {
8909
8910 PrincipalName *string `json:"principalName,omitempty"`
8911
8912 PrincipalID *string `json:"principalId,omitempty"`
8913
8914 TenantID *string `json:"tenantId,omitempty"`
8915
8916 ObjectID *string `json:"objectId,omitempty"`
8917
8918 AppID *string `json:"appId,omitempty"`
8919 }
8920
8921
8922 type UserIdentityFragment struct {
8923
8924 PrincipalName *string `json:"principalName,omitempty"`
8925
8926 PrincipalID *string `json:"principalId,omitempty"`
8927
8928 TenantID *string `json:"tenantId,omitempty"`
8929
8930 ObjectID *string `json:"objectId,omitempty"`
8931
8932 AppID *string `json:"appId,omitempty"`
8933 }
8934
8935
8936 type UserList struct {
8937 autorest.Response `json:"-"`
8938
8939 Value *[]User `json:"value,omitempty"`
8940
8941 NextLink *string `json:"nextLink,omitempty"`
8942 }
8943
8944
8945 type UserListIterator struct {
8946 i int
8947 page UserListPage
8948 }
8949
8950
8951
8952 func (iter *UserListIterator) NextWithContext(ctx context.Context) (err error) {
8953 if tracing.IsEnabled() {
8954 ctx = tracing.StartSpan(ctx, fqdn+"/UserListIterator.NextWithContext")
8955 defer func() {
8956 sc := -1
8957 if iter.Response().Response.Response != nil {
8958 sc = iter.Response().Response.Response.StatusCode
8959 }
8960 tracing.EndSpan(ctx, sc, err)
8961 }()
8962 }
8963 iter.i++
8964 if iter.i < len(iter.page.Values()) {
8965 return nil
8966 }
8967 err = iter.page.NextWithContext(ctx)
8968 if err != nil {
8969 iter.i--
8970 return err
8971 }
8972 iter.i = 0
8973 return nil
8974 }
8975
8976
8977
8978
8979 func (iter *UserListIterator) Next() error {
8980 return iter.NextWithContext(context.Background())
8981 }
8982
8983
8984 func (iter UserListIterator) NotDone() bool {
8985 return iter.page.NotDone() && iter.i < len(iter.page.Values())
8986 }
8987
8988
8989 func (iter UserListIterator) Response() UserList {
8990 return iter.page.Response()
8991 }
8992
8993
8994
8995 func (iter UserListIterator) Value() User {
8996 if !iter.page.NotDone() {
8997 return User{}
8998 }
8999 return iter.page.Values()[iter.i]
9000 }
9001
9002
9003 func NewUserListIterator(page UserListPage) UserListIterator {
9004 return UserListIterator{page: page}
9005 }
9006
9007
9008 func (ul UserList) IsEmpty() bool {
9009 return ul.Value == nil || len(*ul.Value) == 0
9010 }
9011
9012
9013 func (ul UserList) hasNextLink() bool {
9014 return ul.NextLink != nil && len(*ul.NextLink) != 0
9015 }
9016
9017
9018
9019 func (ul UserList) userListPreparer(ctx context.Context) (*http.Request, error) {
9020 if !ul.hasNextLink() {
9021 return nil, nil
9022 }
9023 return autorest.Prepare((&http.Request{}).WithContext(ctx),
9024 autorest.AsJSON(),
9025 autorest.AsGet(),
9026 autorest.WithBaseURL(to.String(ul.NextLink)))
9027 }
9028
9029
9030 type UserListPage struct {
9031 fn func(context.Context, UserList) (UserList, error)
9032 ul UserList
9033 }
9034
9035
9036
9037 func (page *UserListPage) NextWithContext(ctx context.Context) (err error) {
9038 if tracing.IsEnabled() {
9039 ctx = tracing.StartSpan(ctx, fqdn+"/UserListPage.NextWithContext")
9040 defer func() {
9041 sc := -1
9042 if page.Response().Response.Response != nil {
9043 sc = page.Response().Response.Response.StatusCode
9044 }
9045 tracing.EndSpan(ctx, sc, err)
9046 }()
9047 }
9048 for {
9049 next, err := page.fn(ctx, page.ul)
9050 if err != nil {
9051 return err
9052 }
9053 page.ul = next
9054 if !next.hasNextLink() || !next.IsEmpty() {
9055 break
9056 }
9057 }
9058 return nil
9059 }
9060
9061
9062
9063
9064 func (page *UserListPage) Next() error {
9065 return page.NextWithContext(context.Background())
9066 }
9067
9068
9069 func (page UserListPage) NotDone() bool {
9070 return !page.ul.IsEmpty()
9071 }
9072
9073
9074 func (page UserListPage) Response() UserList {
9075 return page.ul
9076 }
9077
9078
9079 func (page UserListPage) Values() []User {
9080 if page.ul.IsEmpty() {
9081 return nil
9082 }
9083 return *page.ul.Value
9084 }
9085
9086
9087 func NewUserListPage(cur UserList, getNextPage func(context.Context, UserList) (UserList, error)) UserListPage {
9088 return UserListPage{
9089 fn: getNextPage,
9090 ul: cur,
9091 }
9092 }
9093
9094
9095 type UserProperties struct {
9096
9097 Identity *UserIdentity `json:"identity,omitempty"`
9098
9099 SecretStore *UserSecretStore `json:"secretStore,omitempty"`
9100
9101 CreatedDate *date.Time `json:"createdDate,omitempty"`
9102
9103 ProvisioningState *string `json:"provisioningState,omitempty"`
9104
9105 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
9106 }
9107
9108
9109 func (up UserProperties) MarshalJSON() ([]byte, error) {
9110 objectMap := make(map[string]interface{})
9111 if up.Identity != nil {
9112 objectMap["identity"] = up.Identity
9113 }
9114 if up.SecretStore != nil {
9115 objectMap["secretStore"] = up.SecretStore
9116 }
9117 return json.Marshal(objectMap)
9118 }
9119
9120
9121 type UserPropertiesFragment struct {
9122
9123 Identity *UserIdentityFragment `json:"identity,omitempty"`
9124
9125 SecretStore *UserSecretStoreFragment `json:"secretStore,omitempty"`
9126 }
9127
9128
9129
9130 type UsersCreateOrUpdateFuture struct {
9131 azure.FutureAPI
9132
9133
9134 Result func(UsersClient) (User, error)
9135 }
9136
9137
9138 func (future *UsersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
9139 var azFuture azure.Future
9140 if err := json.Unmarshal(body, &azFuture); err != nil {
9141 return err
9142 }
9143 future.FutureAPI = &azFuture
9144 future.Result = future.result
9145 return nil
9146 }
9147
9148
9149 func (future *UsersCreateOrUpdateFuture) result(client UsersClient) (u User, err error) {
9150 var done bool
9151 done, err = future.DoneWithContext(context.Background(), client)
9152 if err != nil {
9153 err = autorest.NewErrorWithError(err, "dtl.UsersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9154 return
9155 }
9156 if !done {
9157 u.Response.Response = future.Response()
9158 err = azure.NewAsyncOpIncompleteError("dtl.UsersCreateOrUpdateFuture")
9159 return
9160 }
9161 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9162 if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent {
9163 u, err = client.CreateOrUpdateResponder(u.Response.Response)
9164 if err != nil {
9165 err = autorest.NewErrorWithError(err, "dtl.UsersCreateOrUpdateFuture", "Result", u.Response.Response, "Failure responding to request")
9166 }
9167 }
9168 return
9169 }
9170
9171
9172 type UsersDeleteFuture struct {
9173 azure.FutureAPI
9174
9175
9176 Result func(UsersClient) (autorest.Response, error)
9177 }
9178
9179
9180 func (future *UsersDeleteFuture) UnmarshalJSON(body []byte) error {
9181 var azFuture azure.Future
9182 if err := json.Unmarshal(body, &azFuture); err != nil {
9183 return err
9184 }
9185 future.FutureAPI = &azFuture
9186 future.Result = future.result
9187 return nil
9188 }
9189
9190
9191 func (future *UsersDeleteFuture) result(client UsersClient) (ar autorest.Response, err error) {
9192 var done bool
9193 done, err = future.DoneWithContext(context.Background(), client)
9194 if err != nil {
9195 err = autorest.NewErrorWithError(err, "dtl.UsersDeleteFuture", "Result", future.Response(), "Polling failure")
9196 return
9197 }
9198 if !done {
9199 ar.Response = future.Response()
9200 err = azure.NewAsyncOpIncompleteError("dtl.UsersDeleteFuture")
9201 return
9202 }
9203 ar.Response = future.Response()
9204 return
9205 }
9206
9207
9208 type UserSecretStore struct {
9209
9210 KeyVaultURI *string `json:"keyVaultUri,omitempty"`
9211
9212 KeyVaultID *string `json:"keyVaultId,omitempty"`
9213 }
9214
9215
9216 type UserSecretStoreFragment struct {
9217
9218 KeyVaultURI *string `json:"keyVaultUri,omitempty"`
9219
9220 KeyVaultID *string `json:"keyVaultId,omitempty"`
9221 }
9222
9223
9224
9225 type VirtualMachinesAddDataDiskFuture struct {
9226 azure.FutureAPI
9227
9228
9229 Result func(VirtualMachinesClient) (autorest.Response, error)
9230 }
9231
9232
9233 func (future *VirtualMachinesAddDataDiskFuture) UnmarshalJSON(body []byte) error {
9234 var azFuture azure.Future
9235 if err := json.Unmarshal(body, &azFuture); err != nil {
9236 return err
9237 }
9238 future.FutureAPI = &azFuture
9239 future.Result = future.result
9240 return nil
9241 }
9242
9243
9244 func (future *VirtualMachinesAddDataDiskFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9245 var done bool
9246 done, err = future.DoneWithContext(context.Background(), client)
9247 if err != nil {
9248 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesAddDataDiskFuture", "Result", future.Response(), "Polling failure")
9249 return
9250 }
9251 if !done {
9252 ar.Response = future.Response()
9253 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesAddDataDiskFuture")
9254 return
9255 }
9256 ar.Response = future.Response()
9257 return
9258 }
9259
9260
9261
9262 type VirtualMachinesApplyArtifactsFuture struct {
9263 azure.FutureAPI
9264
9265
9266 Result func(VirtualMachinesClient) (autorest.Response, error)
9267 }
9268
9269
9270 func (future *VirtualMachinesApplyArtifactsFuture) UnmarshalJSON(body []byte) error {
9271 var azFuture azure.Future
9272 if err := json.Unmarshal(body, &azFuture); err != nil {
9273 return err
9274 }
9275 future.FutureAPI = &azFuture
9276 future.Result = future.result
9277 return nil
9278 }
9279
9280
9281 func (future *VirtualMachinesApplyArtifactsFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9282 var done bool
9283 done, err = future.DoneWithContext(context.Background(), client)
9284 if err != nil {
9285 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesApplyArtifactsFuture", "Result", future.Response(), "Polling failure")
9286 return
9287 }
9288 if !done {
9289 ar.Response = future.Response()
9290 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesApplyArtifactsFuture")
9291 return
9292 }
9293 ar.Response = future.Response()
9294 return
9295 }
9296
9297
9298
9299 type VirtualMachineSchedulesExecuteFuture struct {
9300 azure.FutureAPI
9301
9302
9303 Result func(VirtualMachineSchedulesClient) (autorest.Response, error)
9304 }
9305
9306
9307 func (future *VirtualMachineSchedulesExecuteFuture) UnmarshalJSON(body []byte) error {
9308 var azFuture azure.Future
9309 if err := json.Unmarshal(body, &azFuture); err != nil {
9310 return err
9311 }
9312 future.FutureAPI = &azFuture
9313 future.Result = future.result
9314 return nil
9315 }
9316
9317
9318 func (future *VirtualMachineSchedulesExecuteFuture) result(client VirtualMachineSchedulesClient) (ar autorest.Response, err error) {
9319 var done bool
9320 done, err = future.DoneWithContext(context.Background(), client)
9321 if err != nil {
9322 err = autorest.NewErrorWithError(err, "dtl.VirtualMachineSchedulesExecuteFuture", "Result", future.Response(), "Polling failure")
9323 return
9324 }
9325 if !done {
9326 ar.Response = future.Response()
9327 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachineSchedulesExecuteFuture")
9328 return
9329 }
9330 ar.Response = future.Response()
9331 return
9332 }
9333
9334
9335
9336 type VirtualMachinesClaimFuture struct {
9337 azure.FutureAPI
9338
9339
9340 Result func(VirtualMachinesClient) (autorest.Response, error)
9341 }
9342
9343
9344 func (future *VirtualMachinesClaimFuture) UnmarshalJSON(body []byte) error {
9345 var azFuture azure.Future
9346 if err := json.Unmarshal(body, &azFuture); err != nil {
9347 return err
9348 }
9349 future.FutureAPI = &azFuture
9350 future.Result = future.result
9351 return nil
9352 }
9353
9354
9355 func (future *VirtualMachinesClaimFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9356 var done bool
9357 done, err = future.DoneWithContext(context.Background(), client)
9358 if err != nil {
9359 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClaimFuture", "Result", future.Response(), "Polling failure")
9360 return
9361 }
9362 if !done {
9363 ar.Response = future.Response()
9364 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesClaimFuture")
9365 return
9366 }
9367 ar.Response = future.Response()
9368 return
9369 }
9370
9371
9372
9373 type VirtualMachinesCreateOrUpdateFuture struct {
9374 azure.FutureAPI
9375
9376
9377 Result func(VirtualMachinesClient) (LabVirtualMachine, error)
9378 }
9379
9380
9381 func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
9382 var azFuture azure.Future
9383 if err := json.Unmarshal(body, &azFuture); err != nil {
9384 return err
9385 }
9386 future.FutureAPI = &azFuture
9387 future.Result = future.result
9388 return nil
9389 }
9390
9391
9392 func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (lvm LabVirtualMachine, err error) {
9393 var done bool
9394 done, err = future.DoneWithContext(context.Background(), client)
9395 if err != nil {
9396 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9397 return
9398 }
9399 if !done {
9400 lvm.Response.Response = future.Response()
9401 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesCreateOrUpdateFuture")
9402 return
9403 }
9404 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9405 if lvm.Response.Response, err = future.GetResult(sender); err == nil && lvm.Response.Response.StatusCode != http.StatusNoContent {
9406 lvm, err = client.CreateOrUpdateResponder(lvm.Response.Response)
9407 if err != nil {
9408 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesCreateOrUpdateFuture", "Result", lvm.Response.Response, "Failure responding to request")
9409 }
9410 }
9411 return
9412 }
9413
9414
9415
9416 type VirtualMachinesDeleteFuture struct {
9417 azure.FutureAPI
9418
9419
9420 Result func(VirtualMachinesClient) (autorest.Response, error)
9421 }
9422
9423
9424 func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error {
9425 var azFuture azure.Future
9426 if err := json.Unmarshal(body, &azFuture); err != nil {
9427 return err
9428 }
9429 future.FutureAPI = &azFuture
9430 future.Result = future.result
9431 return nil
9432 }
9433
9434
9435 func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9436 var done bool
9437 done, err = future.DoneWithContext(context.Background(), client)
9438 if err != nil {
9439 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure")
9440 return
9441 }
9442 if !done {
9443 ar.Response = future.Response()
9444 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesDeleteFuture")
9445 return
9446 }
9447 ar.Response = future.Response()
9448 return
9449 }
9450
9451
9452
9453 type VirtualMachinesDetachDataDiskFuture struct {
9454 azure.FutureAPI
9455
9456
9457 Result func(VirtualMachinesClient) (autorest.Response, error)
9458 }
9459
9460
9461 func (future *VirtualMachinesDetachDataDiskFuture) UnmarshalJSON(body []byte) error {
9462 var azFuture azure.Future
9463 if err := json.Unmarshal(body, &azFuture); err != nil {
9464 return err
9465 }
9466 future.FutureAPI = &azFuture
9467 future.Result = future.result
9468 return nil
9469 }
9470
9471
9472 func (future *VirtualMachinesDetachDataDiskFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9473 var done bool
9474 done, err = future.DoneWithContext(context.Background(), client)
9475 if err != nil {
9476 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesDetachDataDiskFuture", "Result", future.Response(), "Polling failure")
9477 return
9478 }
9479 if !done {
9480 ar.Response = future.Response()
9481 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesDetachDataDiskFuture")
9482 return
9483 }
9484 ar.Response = future.Response()
9485 return
9486 }
9487
9488
9489
9490 type VirtualMachinesRedeployFuture struct {
9491 azure.FutureAPI
9492
9493
9494 Result func(VirtualMachinesClient) (autorest.Response, error)
9495 }
9496
9497
9498 func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error {
9499 var azFuture azure.Future
9500 if err := json.Unmarshal(body, &azFuture); err != nil {
9501 return err
9502 }
9503 future.FutureAPI = &azFuture
9504 future.Result = future.result
9505 return nil
9506 }
9507
9508
9509 func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9510 var done bool
9511 done, err = future.DoneWithContext(context.Background(), client)
9512 if err != nil {
9513 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure")
9514 return
9515 }
9516 if !done {
9517 ar.Response = future.Response()
9518 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesRedeployFuture")
9519 return
9520 }
9521 ar.Response = future.Response()
9522 return
9523 }
9524
9525
9526
9527 type VirtualMachinesResizeFuture struct {
9528 azure.FutureAPI
9529
9530
9531 Result func(VirtualMachinesClient) (autorest.Response, error)
9532 }
9533
9534
9535 func (future *VirtualMachinesResizeFuture) UnmarshalJSON(body []byte) error {
9536 var azFuture azure.Future
9537 if err := json.Unmarshal(body, &azFuture); err != nil {
9538 return err
9539 }
9540 future.FutureAPI = &azFuture
9541 future.Result = future.result
9542 return nil
9543 }
9544
9545
9546 func (future *VirtualMachinesResizeFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9547 var done bool
9548 done, err = future.DoneWithContext(context.Background(), client)
9549 if err != nil {
9550 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesResizeFuture", "Result", future.Response(), "Polling failure")
9551 return
9552 }
9553 if !done {
9554 ar.Response = future.Response()
9555 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesResizeFuture")
9556 return
9557 }
9558 ar.Response = future.Response()
9559 return
9560 }
9561
9562
9563
9564 type VirtualMachinesRestartFuture struct {
9565 azure.FutureAPI
9566
9567
9568 Result func(VirtualMachinesClient) (autorest.Response, error)
9569 }
9570
9571
9572 func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error {
9573 var azFuture azure.Future
9574 if err := json.Unmarshal(body, &azFuture); err != nil {
9575 return err
9576 }
9577 future.FutureAPI = &azFuture
9578 future.Result = future.result
9579 return nil
9580 }
9581
9582
9583 func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9584 var done bool
9585 done, err = future.DoneWithContext(context.Background(), client)
9586 if err != nil {
9587 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure")
9588 return
9589 }
9590 if !done {
9591 ar.Response = future.Response()
9592 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesRestartFuture")
9593 return
9594 }
9595 ar.Response = future.Response()
9596 return
9597 }
9598
9599
9600
9601 type VirtualMachinesStartFuture struct {
9602 azure.FutureAPI
9603
9604
9605 Result func(VirtualMachinesClient) (autorest.Response, error)
9606 }
9607
9608
9609 func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error {
9610 var azFuture azure.Future
9611 if err := json.Unmarshal(body, &azFuture); err != nil {
9612 return err
9613 }
9614 future.FutureAPI = &azFuture
9615 future.Result = future.result
9616 return nil
9617 }
9618
9619
9620 func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9621 var done bool
9622 done, err = future.DoneWithContext(context.Background(), client)
9623 if err != nil {
9624 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure")
9625 return
9626 }
9627 if !done {
9628 ar.Response = future.Response()
9629 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesStartFuture")
9630 return
9631 }
9632 ar.Response = future.Response()
9633 return
9634 }
9635
9636
9637
9638 type VirtualMachinesStopFuture struct {
9639 azure.FutureAPI
9640
9641
9642 Result func(VirtualMachinesClient) (autorest.Response, error)
9643 }
9644
9645
9646 func (future *VirtualMachinesStopFuture) UnmarshalJSON(body []byte) error {
9647 var azFuture azure.Future
9648 if err := json.Unmarshal(body, &azFuture); err != nil {
9649 return err
9650 }
9651 future.FutureAPI = &azFuture
9652 future.Result = future.result
9653 return nil
9654 }
9655
9656
9657 func (future *VirtualMachinesStopFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9658 var done bool
9659 done, err = future.DoneWithContext(context.Background(), client)
9660 if err != nil {
9661 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesStopFuture", "Result", future.Response(), "Polling failure")
9662 return
9663 }
9664 if !done {
9665 ar.Response = future.Response()
9666 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesStopFuture")
9667 return
9668 }
9669 ar.Response = future.Response()
9670 return
9671 }
9672
9673
9674
9675 type VirtualMachinesTransferDisksFuture struct {
9676 azure.FutureAPI
9677
9678
9679 Result func(VirtualMachinesClient) (autorest.Response, error)
9680 }
9681
9682
9683 func (future *VirtualMachinesTransferDisksFuture) UnmarshalJSON(body []byte) error {
9684 var azFuture azure.Future
9685 if err := json.Unmarshal(body, &azFuture); err != nil {
9686 return err
9687 }
9688 future.FutureAPI = &azFuture
9689 future.Result = future.result
9690 return nil
9691 }
9692
9693
9694 func (future *VirtualMachinesTransferDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9695 var done bool
9696 done, err = future.DoneWithContext(context.Background(), client)
9697 if err != nil {
9698 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesTransferDisksFuture", "Result", future.Response(), "Polling failure")
9699 return
9700 }
9701 if !done {
9702 ar.Response = future.Response()
9703 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesTransferDisksFuture")
9704 return
9705 }
9706 ar.Response = future.Response()
9707 return
9708 }
9709
9710
9711
9712 type VirtualMachinesUnClaimFuture struct {
9713 azure.FutureAPI
9714
9715
9716 Result func(VirtualMachinesClient) (autorest.Response, error)
9717 }
9718
9719
9720 func (future *VirtualMachinesUnClaimFuture) UnmarshalJSON(body []byte) error {
9721 var azFuture azure.Future
9722 if err := json.Unmarshal(body, &azFuture); err != nil {
9723 return err
9724 }
9725 future.FutureAPI = &azFuture
9726 future.Result = future.result
9727 return nil
9728 }
9729
9730
9731 func (future *VirtualMachinesUnClaimFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) {
9732 var done bool
9733 done, err = future.DoneWithContext(context.Background(), client)
9734 if err != nil {
9735 err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesUnClaimFuture", "Result", future.Response(), "Polling failure")
9736 return
9737 }
9738 if !done {
9739 ar.Response = future.Response()
9740 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesUnClaimFuture")
9741 return
9742 }
9743 ar.Response = future.Response()
9744 return
9745 }
9746
9747
9748 type VirtualNetwork struct {
9749 autorest.Response `json:"-"`
9750
9751 *VirtualNetworkProperties `json:"properties,omitempty"`
9752
9753 ID *string `json:"id,omitempty"`
9754
9755 Name *string `json:"name,omitempty"`
9756
9757 Type *string `json:"type,omitempty"`
9758
9759 Location *string `json:"location,omitempty"`
9760
9761 Tags map[string]*string `json:"tags"`
9762 }
9763
9764
9765 func (vn VirtualNetwork) MarshalJSON() ([]byte, error) {
9766 objectMap := make(map[string]interface{})
9767 if vn.VirtualNetworkProperties != nil {
9768 objectMap["properties"] = vn.VirtualNetworkProperties
9769 }
9770 if vn.Location != nil {
9771 objectMap["location"] = vn.Location
9772 }
9773 if vn.Tags != nil {
9774 objectMap["tags"] = vn.Tags
9775 }
9776 return json.Marshal(objectMap)
9777 }
9778
9779
9780 func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error {
9781 var m map[string]*json.RawMessage
9782 err := json.Unmarshal(body, &m)
9783 if err != nil {
9784 return err
9785 }
9786 for k, v := range m {
9787 switch k {
9788 case "properties":
9789 if v != nil {
9790 var virtualNetworkProperties VirtualNetworkProperties
9791 err = json.Unmarshal(*v, &virtualNetworkProperties)
9792 if err != nil {
9793 return err
9794 }
9795 vn.VirtualNetworkProperties = &virtualNetworkProperties
9796 }
9797 case "id":
9798 if v != nil {
9799 var ID string
9800 err = json.Unmarshal(*v, &ID)
9801 if err != nil {
9802 return err
9803 }
9804 vn.ID = &ID
9805 }
9806 case "name":
9807 if v != nil {
9808 var name string
9809 err = json.Unmarshal(*v, &name)
9810 if err != nil {
9811 return err
9812 }
9813 vn.Name = &name
9814 }
9815 case "type":
9816 if v != nil {
9817 var typeVar string
9818 err = json.Unmarshal(*v, &typeVar)
9819 if err != nil {
9820 return err
9821 }
9822 vn.Type = &typeVar
9823 }
9824 case "location":
9825 if v != nil {
9826 var location string
9827 err = json.Unmarshal(*v, &location)
9828 if err != nil {
9829 return err
9830 }
9831 vn.Location = &location
9832 }
9833 case "tags":
9834 if v != nil {
9835 var tags map[string]*string
9836 err = json.Unmarshal(*v, &tags)
9837 if err != nil {
9838 return err
9839 }
9840 vn.Tags = tags
9841 }
9842 }
9843 }
9844
9845 return nil
9846 }
9847
9848
9849 type VirtualNetworkFragment struct {
9850
9851 *VirtualNetworkPropertiesFragment `json:"properties,omitempty"`
9852
9853 Tags map[string]*string `json:"tags"`
9854 }
9855
9856
9857 func (vnf VirtualNetworkFragment) MarshalJSON() ([]byte, error) {
9858 objectMap := make(map[string]interface{})
9859 if vnf.VirtualNetworkPropertiesFragment != nil {
9860 objectMap["properties"] = vnf.VirtualNetworkPropertiesFragment
9861 }
9862 if vnf.Tags != nil {
9863 objectMap["tags"] = vnf.Tags
9864 }
9865 return json.Marshal(objectMap)
9866 }
9867
9868
9869 func (vnf *VirtualNetworkFragment) UnmarshalJSON(body []byte) error {
9870 var m map[string]*json.RawMessage
9871 err := json.Unmarshal(body, &m)
9872 if err != nil {
9873 return err
9874 }
9875 for k, v := range m {
9876 switch k {
9877 case "properties":
9878 if v != nil {
9879 var virtualNetworkPropertiesFragment VirtualNetworkPropertiesFragment
9880 err = json.Unmarshal(*v, &virtualNetworkPropertiesFragment)
9881 if err != nil {
9882 return err
9883 }
9884 vnf.VirtualNetworkPropertiesFragment = &virtualNetworkPropertiesFragment
9885 }
9886 case "tags":
9887 if v != nil {
9888 var tags map[string]*string
9889 err = json.Unmarshal(*v, &tags)
9890 if err != nil {
9891 return err
9892 }
9893 vnf.Tags = tags
9894 }
9895 }
9896 }
9897
9898 return nil
9899 }
9900
9901
9902 type VirtualNetworkList struct {
9903 autorest.Response `json:"-"`
9904
9905 Value *[]VirtualNetwork `json:"value,omitempty"`
9906
9907 NextLink *string `json:"nextLink,omitempty"`
9908 }
9909
9910
9911 type VirtualNetworkListIterator struct {
9912 i int
9913 page VirtualNetworkListPage
9914 }
9915
9916
9917
9918 func (iter *VirtualNetworkListIterator) NextWithContext(ctx context.Context) (err error) {
9919 if tracing.IsEnabled() {
9920 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListIterator.NextWithContext")
9921 defer func() {
9922 sc := -1
9923 if iter.Response().Response.Response != nil {
9924 sc = iter.Response().Response.Response.StatusCode
9925 }
9926 tracing.EndSpan(ctx, sc, err)
9927 }()
9928 }
9929 iter.i++
9930 if iter.i < len(iter.page.Values()) {
9931 return nil
9932 }
9933 err = iter.page.NextWithContext(ctx)
9934 if err != nil {
9935 iter.i--
9936 return err
9937 }
9938 iter.i = 0
9939 return nil
9940 }
9941
9942
9943
9944
9945 func (iter *VirtualNetworkListIterator) Next() error {
9946 return iter.NextWithContext(context.Background())
9947 }
9948
9949
9950 func (iter VirtualNetworkListIterator) NotDone() bool {
9951 return iter.page.NotDone() && iter.i < len(iter.page.Values())
9952 }
9953
9954
9955 func (iter VirtualNetworkListIterator) Response() VirtualNetworkList {
9956 return iter.page.Response()
9957 }
9958
9959
9960
9961 func (iter VirtualNetworkListIterator) Value() VirtualNetwork {
9962 if !iter.page.NotDone() {
9963 return VirtualNetwork{}
9964 }
9965 return iter.page.Values()[iter.i]
9966 }
9967
9968
9969 func NewVirtualNetworkListIterator(page VirtualNetworkListPage) VirtualNetworkListIterator {
9970 return VirtualNetworkListIterator{page: page}
9971 }
9972
9973
9974 func (vnl VirtualNetworkList) IsEmpty() bool {
9975 return vnl.Value == nil || len(*vnl.Value) == 0
9976 }
9977
9978
9979 func (vnl VirtualNetworkList) hasNextLink() bool {
9980 return vnl.NextLink != nil && len(*vnl.NextLink) != 0
9981 }
9982
9983
9984
9985 func (vnl VirtualNetworkList) virtualNetworkListPreparer(ctx context.Context) (*http.Request, error) {
9986 if !vnl.hasNextLink() {
9987 return nil, nil
9988 }
9989 return autorest.Prepare((&http.Request{}).WithContext(ctx),
9990 autorest.AsJSON(),
9991 autorest.AsGet(),
9992 autorest.WithBaseURL(to.String(vnl.NextLink)))
9993 }
9994
9995
9996 type VirtualNetworkListPage struct {
9997 fn func(context.Context, VirtualNetworkList) (VirtualNetworkList, error)
9998 vnl VirtualNetworkList
9999 }
10000
10001
10002
10003 func (page *VirtualNetworkListPage) NextWithContext(ctx context.Context) (err error) {
10004 if tracing.IsEnabled() {
10005 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListPage.NextWithContext")
10006 defer func() {
10007 sc := -1
10008 if page.Response().Response.Response != nil {
10009 sc = page.Response().Response.Response.StatusCode
10010 }
10011 tracing.EndSpan(ctx, sc, err)
10012 }()
10013 }
10014 for {
10015 next, err := page.fn(ctx, page.vnl)
10016 if err != nil {
10017 return err
10018 }
10019 page.vnl = next
10020 if !next.hasNextLink() || !next.IsEmpty() {
10021 break
10022 }
10023 }
10024 return nil
10025 }
10026
10027
10028
10029
10030 func (page *VirtualNetworkListPage) Next() error {
10031 return page.NextWithContext(context.Background())
10032 }
10033
10034
10035 func (page VirtualNetworkListPage) NotDone() bool {
10036 return !page.vnl.IsEmpty()
10037 }
10038
10039
10040 func (page VirtualNetworkListPage) Response() VirtualNetworkList {
10041 return page.vnl
10042 }
10043
10044
10045 func (page VirtualNetworkListPage) Values() []VirtualNetwork {
10046 if page.vnl.IsEmpty() {
10047 return nil
10048 }
10049 return *page.vnl.Value
10050 }
10051
10052
10053 func NewVirtualNetworkListPage(cur VirtualNetworkList, getNextPage func(context.Context, VirtualNetworkList) (VirtualNetworkList, error)) VirtualNetworkListPage {
10054 return VirtualNetworkListPage{
10055 fn: getNextPage,
10056 vnl: cur,
10057 }
10058 }
10059
10060
10061 type VirtualNetworkProperties struct {
10062
10063 AllowedSubnets *[]Subnet `json:"allowedSubnets,omitempty"`
10064
10065 Description *string `json:"description,omitempty"`
10066
10067 ExternalProviderResourceID *string `json:"externalProviderResourceId,omitempty"`
10068
10069 ExternalSubnets *[]ExternalSubnet `json:"externalSubnets,omitempty"`
10070
10071 SubnetOverrides *[]SubnetOverride `json:"subnetOverrides,omitempty"`
10072
10073 CreatedDate *date.Time `json:"createdDate,omitempty"`
10074
10075 ProvisioningState *string `json:"provisioningState,omitempty"`
10076
10077 UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
10078 }
10079
10080
10081 func (vnp VirtualNetworkProperties) MarshalJSON() ([]byte, error) {
10082 objectMap := make(map[string]interface{})
10083 if vnp.AllowedSubnets != nil {
10084 objectMap["allowedSubnets"] = vnp.AllowedSubnets
10085 }
10086 if vnp.Description != nil {
10087 objectMap["description"] = vnp.Description
10088 }
10089 if vnp.ExternalProviderResourceID != nil {
10090 objectMap["externalProviderResourceId"] = vnp.ExternalProviderResourceID
10091 }
10092 if vnp.SubnetOverrides != nil {
10093 objectMap["subnetOverrides"] = vnp.SubnetOverrides
10094 }
10095 return json.Marshal(objectMap)
10096 }
10097
10098
10099 type VirtualNetworkPropertiesFragment struct {
10100
10101 AllowedSubnets *[]SubnetFragment `json:"allowedSubnets,omitempty"`
10102
10103 Description *string `json:"description,omitempty"`
10104
10105 ExternalProviderResourceID *string `json:"externalProviderResourceId,omitempty"`
10106
10107 SubnetOverrides *[]SubnetOverrideFragment `json:"subnetOverrides,omitempty"`
10108 }
10109
10110
10111
10112 type VirtualNetworksCreateOrUpdateFuture struct {
10113 azure.FutureAPI
10114
10115
10116 Result func(VirtualNetworksClient) (VirtualNetwork, error)
10117 }
10118
10119
10120 func (future *VirtualNetworksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10121 var azFuture azure.Future
10122 if err := json.Unmarshal(body, &azFuture); err != nil {
10123 return err
10124 }
10125 future.FutureAPI = &azFuture
10126 future.Result = future.result
10127 return nil
10128 }
10129
10130
10131 func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) {
10132 var done bool
10133 done, err = future.DoneWithContext(context.Background(), client)
10134 if err != nil {
10135 err = autorest.NewErrorWithError(err, "dtl.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10136 return
10137 }
10138 if !done {
10139 vn.Response.Response = future.Response()
10140 err = azure.NewAsyncOpIncompleteError("dtl.VirtualNetworksCreateOrUpdateFuture")
10141 return
10142 }
10143 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10144 if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent {
10145 vn, err = client.CreateOrUpdateResponder(vn.Response.Response)
10146 if err != nil {
10147 err = autorest.NewErrorWithError(err, "dtl.VirtualNetworksCreateOrUpdateFuture", "Result", vn.Response.Response, "Failure responding to request")
10148 }
10149 }
10150 return
10151 }
10152
10153
10154
10155 type VirtualNetworksDeleteFuture struct {
10156 azure.FutureAPI
10157
10158
10159 Result func(VirtualNetworksClient) (autorest.Response, error)
10160 }
10161
10162
10163 func (future *VirtualNetworksDeleteFuture) UnmarshalJSON(body []byte) error {
10164 var azFuture azure.Future
10165 if err := json.Unmarshal(body, &azFuture); err != nil {
10166 return err
10167 }
10168 future.FutureAPI = &azFuture
10169 future.Result = future.result
10170 return nil
10171 }
10172
10173
10174 func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) (ar autorest.Response, err error) {
10175 var done bool
10176 done, err = future.DoneWithContext(context.Background(), client)
10177 if err != nil {
10178 err = autorest.NewErrorWithError(err, "dtl.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure")
10179 return
10180 }
10181 if !done {
10182 ar.Response = future.Response()
10183 err = azure.NewAsyncOpIncompleteError("dtl.VirtualNetworksDeleteFuture")
10184 return
10185 }
10186 ar.Response = future.Response()
10187 return
10188 }
10189
10190
10191 type WeekDetails struct {
10192
10193 Weekdays *[]string `json:"weekdays,omitempty"`
10194
10195 Time *string `json:"time,omitempty"`
10196 }
10197
10198
10199 type WeekDetailsFragment struct {
10200
10201 Weekdays *[]string `json:"weekdays,omitempty"`
10202
10203 Time *string `json:"time,omitempty"`
10204 }
10205
10206
10207 type WindowsOsInfo struct {
10208
10209 WindowsOsState WindowsOsState `json:"windowsOsState,omitempty"`
10210 }
10211
10212
10213 type WindowsOsInfoFragment struct {
10214
10215 WindowsOsState WindowsOsState `json:"windowsOsState,omitempty"`
10216 }
10217
View as plain text