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/preview/devtestlabs/mgmt/2015-05-21-preview/dtl"
22
23
24 type ApplyArtifactsRequest struct {
25
26 Artifacts *[]ArtifactInstallProperties `json:"artifacts,omitempty"`
27 }
28
29
30 type ArmTemplateInfo struct {
31 autorest.Response `json:"-"`
32
33 Template interface{} `json:"template,omitempty"`
34
35 Parameters interface{} `json:"parameters,omitempty"`
36 }
37
38
39 type Artifact struct {
40 autorest.Response `json:"-"`
41
42 *ArtifactProperties `json:"properties,omitempty"`
43
44 ID *string `json:"id,omitempty"`
45
46 Name *string `json:"name,omitempty"`
47
48 Type *string `json:"type,omitempty"`
49
50 Location *string `json:"location,omitempty"`
51
52 Tags map[string]*string `json:"tags"`
53 }
54
55
56 func (a Artifact) MarshalJSON() ([]byte, error) {
57 objectMap := make(map[string]interface{})
58 if a.ArtifactProperties != nil {
59 objectMap["properties"] = a.ArtifactProperties
60 }
61 if a.ID != nil {
62 objectMap["id"] = a.ID
63 }
64 if a.Name != nil {
65 objectMap["name"] = a.Name
66 }
67 if a.Type != nil {
68 objectMap["type"] = a.Type
69 }
70 if a.Location != nil {
71 objectMap["location"] = a.Location
72 }
73 if a.Tags != nil {
74 objectMap["tags"] = a.Tags
75 }
76 return json.Marshal(objectMap)
77 }
78
79
80 func (a *Artifact) UnmarshalJSON(body []byte) error {
81 var m map[string]*json.RawMessage
82 err := json.Unmarshal(body, &m)
83 if err != nil {
84 return err
85 }
86 for k, v := range m {
87 switch k {
88 case "properties":
89 if v != nil {
90 var artifactProperties ArtifactProperties
91 err = json.Unmarshal(*v, &artifactProperties)
92 if err != nil {
93 return err
94 }
95 a.ArtifactProperties = &artifactProperties
96 }
97 case "id":
98 if v != nil {
99 var ID string
100 err = json.Unmarshal(*v, &ID)
101 if err != nil {
102 return err
103 }
104 a.ID = &ID
105 }
106 case "name":
107 if v != nil {
108 var name string
109 err = json.Unmarshal(*v, &name)
110 if err != nil {
111 return err
112 }
113 a.Name = &name
114 }
115 case "type":
116 if v != nil {
117 var typeVar string
118 err = json.Unmarshal(*v, &typeVar)
119 if err != nil {
120 return err
121 }
122 a.Type = &typeVar
123 }
124 case "location":
125 if v != nil {
126 var location string
127 err = json.Unmarshal(*v, &location)
128 if err != nil {
129 return err
130 }
131 a.Location = &location
132 }
133 case "tags":
134 if v != nil {
135 var tags map[string]*string
136 err = json.Unmarshal(*v, &tags)
137 if err != nil {
138 return err
139 }
140 a.Tags = tags
141 }
142 }
143 }
144
145 return nil
146 }
147
148
149 type ArtifactDeploymentStatusProperties struct {
150
151 DeploymentStatus *string `json:"deploymentStatus,omitempty"`
152
153 ArtifactsApplied *int32 `json:"artifactsApplied,omitempty"`
154
155 TotalArtifacts *int32 `json:"totalArtifacts,omitempty"`
156 }
157
158
159 type ArtifactInstallProperties struct {
160
161 ArtifactID *string `json:"artifactId,omitempty"`
162
163 Parameters *[]ArtifactParameterProperties `json:"parameters,omitempty"`
164 }
165
166
167 type ArtifactParameterProperties struct {
168
169 Name *string `json:"name,omitempty"`
170
171 Value *string `json:"value,omitempty"`
172 }
173
174
175 type ArtifactProperties struct {
176
177 Title *string `json:"title,omitempty"`
178
179 Description *string `json:"description,omitempty"`
180
181 FilePath *string `json:"filePath,omitempty"`
182
183 Icon *string `json:"icon,omitempty"`
184
185 TargetOsType *string `json:"targetOsType,omitempty"`
186
187 Parameters interface{} `json:"parameters,omitempty"`
188 }
189
190
191 type ArtifactSource struct {
192 autorest.Response `json:"-"`
193
194 *ArtifactSourceProperties `json:"properties,omitempty"`
195
196 ID *string `json:"id,omitempty"`
197
198 Name *string `json:"name,omitempty"`
199
200 Type *string `json:"type,omitempty"`
201
202 Location *string `json:"location,omitempty"`
203
204 Tags map[string]*string `json:"tags"`
205 }
206
207
208 func (as ArtifactSource) MarshalJSON() ([]byte, error) {
209 objectMap := make(map[string]interface{})
210 if as.ArtifactSourceProperties != nil {
211 objectMap["properties"] = as.ArtifactSourceProperties
212 }
213 if as.ID != nil {
214 objectMap["id"] = as.ID
215 }
216 if as.Name != nil {
217 objectMap["name"] = as.Name
218 }
219 if as.Type != nil {
220 objectMap["type"] = as.Type
221 }
222 if as.Location != nil {
223 objectMap["location"] = as.Location
224 }
225 if as.Tags != nil {
226 objectMap["tags"] = as.Tags
227 }
228 return json.Marshal(objectMap)
229 }
230
231
232 func (as *ArtifactSource) UnmarshalJSON(body []byte) error {
233 var m map[string]*json.RawMessage
234 err := json.Unmarshal(body, &m)
235 if err != nil {
236 return err
237 }
238 for k, v := range m {
239 switch k {
240 case "properties":
241 if v != nil {
242 var artifactSourceProperties ArtifactSourceProperties
243 err = json.Unmarshal(*v, &artifactSourceProperties)
244 if err != nil {
245 return err
246 }
247 as.ArtifactSourceProperties = &artifactSourceProperties
248 }
249 case "id":
250 if v != nil {
251 var ID string
252 err = json.Unmarshal(*v, &ID)
253 if err != nil {
254 return err
255 }
256 as.ID = &ID
257 }
258 case "name":
259 if v != nil {
260 var name string
261 err = json.Unmarshal(*v, &name)
262 if err != nil {
263 return err
264 }
265 as.Name = &name
266 }
267 case "type":
268 if v != nil {
269 var typeVar string
270 err = json.Unmarshal(*v, &typeVar)
271 if err != nil {
272 return err
273 }
274 as.Type = &typeVar
275 }
276 case "location":
277 if v != nil {
278 var location string
279 err = json.Unmarshal(*v, &location)
280 if err != nil {
281 return err
282 }
283 as.Location = &location
284 }
285 case "tags":
286 if v != nil {
287 var tags map[string]*string
288 err = json.Unmarshal(*v, &tags)
289 if err != nil {
290 return err
291 }
292 as.Tags = tags
293 }
294 }
295 }
296
297 return nil
298 }
299
300
301 type ArtifactSourceProperties struct {
302
303 DisplayName *string `json:"displayName,omitempty"`
304
305 URI *string `json:"uri,omitempty"`
306
307 SourceType SourceControlType `json:"sourceType,omitempty"`
308
309 FolderPath *string `json:"folderPath,omitempty"`
310
311 BranchRef *string `json:"branchRef,omitempty"`
312
313 SecurityToken *string `json:"securityToken,omitempty"`
314
315 Status EnableStatus `json:"status,omitempty"`
316
317 ProvisioningState *string `json:"provisioningState,omitempty"`
318 }
319
320
321 type CloudError struct {
322 Error *CloudErrorBody `json:"error,omitempty"`
323 }
324
325
326 type CloudErrorBody struct {
327 Code *string `json:"code,omitempty"`
328 Message *string `json:"message,omitempty"`
329 Target *string `json:"target,omitempty"`
330 Details *[]CloudErrorBody `json:"details,omitempty"`
331 }
332
333
334 type Cost struct {
335 autorest.Response `json:"-"`
336
337 *CostProperties `json:"properties,omitempty"`
338
339 ID *string `json:"id,omitempty"`
340
341 Name *string `json:"name,omitempty"`
342
343 Type *string `json:"type,omitempty"`
344
345 Location *string `json:"location,omitempty"`
346
347 Tags map[string]*string `json:"tags"`
348 }
349
350
351 func (c Cost) MarshalJSON() ([]byte, error) {
352 objectMap := make(map[string]interface{})
353 if c.CostProperties != nil {
354 objectMap["properties"] = c.CostProperties
355 }
356 if c.ID != nil {
357 objectMap["id"] = c.ID
358 }
359 if c.Name != nil {
360 objectMap["name"] = c.Name
361 }
362 if c.Type != nil {
363 objectMap["type"] = c.Type
364 }
365 if c.Location != nil {
366 objectMap["location"] = c.Location
367 }
368 if c.Tags != nil {
369 objectMap["tags"] = c.Tags
370 }
371 return json.Marshal(objectMap)
372 }
373
374
375 func (c *Cost) UnmarshalJSON(body []byte) error {
376 var m map[string]*json.RawMessage
377 err := json.Unmarshal(body, &m)
378 if err != nil {
379 return err
380 }
381 for k, v := range m {
382 switch k {
383 case "properties":
384 if v != nil {
385 var costProperties CostProperties
386 err = json.Unmarshal(*v, &costProperties)
387 if err != nil {
388 return err
389 }
390 c.CostProperties = &costProperties
391 }
392 case "id":
393 if v != nil {
394 var ID string
395 err = json.Unmarshal(*v, &ID)
396 if err != nil {
397 return err
398 }
399 c.ID = &ID
400 }
401 case "name":
402 if v != nil {
403 var name string
404 err = json.Unmarshal(*v, &name)
405 if err != nil {
406 return err
407 }
408 c.Name = &name
409 }
410 case "type":
411 if v != nil {
412 var typeVar string
413 err = json.Unmarshal(*v, &typeVar)
414 if err != nil {
415 return err
416 }
417 c.Type = &typeVar
418 }
419 case "location":
420 if v != nil {
421 var location string
422 err = json.Unmarshal(*v, &location)
423 if err != nil {
424 return err
425 }
426 c.Location = &location
427 }
428 case "tags":
429 if v != nil {
430 var tags map[string]*string
431 err = json.Unmarshal(*v, &tags)
432 if err != nil {
433 return err
434 }
435 c.Tags = tags
436 }
437 }
438 }
439
440 return nil
441 }
442
443
444 type CostInsight struct {
445 autorest.Response `json:"-"`
446
447 *CostInsightProperties `json:"properties,omitempty"`
448
449 ID *string `json:"id,omitempty"`
450
451 Name *string `json:"name,omitempty"`
452
453 Type *string `json:"type,omitempty"`
454
455 Location *string `json:"location,omitempty"`
456
457 Tags map[string]*string `json:"tags"`
458 }
459
460
461 func (ci CostInsight) MarshalJSON() ([]byte, error) {
462 objectMap := make(map[string]interface{})
463 if ci.CostInsightProperties != nil {
464 objectMap["properties"] = ci.CostInsightProperties
465 }
466 if ci.ID != nil {
467 objectMap["id"] = ci.ID
468 }
469 if ci.Name != nil {
470 objectMap["name"] = ci.Name
471 }
472 if ci.Type != nil {
473 objectMap["type"] = ci.Type
474 }
475 if ci.Location != nil {
476 objectMap["location"] = ci.Location
477 }
478 if ci.Tags != nil {
479 objectMap["tags"] = ci.Tags
480 }
481 return json.Marshal(objectMap)
482 }
483
484
485 func (ci *CostInsight) UnmarshalJSON(body []byte) error {
486 var m map[string]*json.RawMessage
487 err := json.Unmarshal(body, &m)
488 if err != nil {
489 return err
490 }
491 for k, v := range m {
492 switch k {
493 case "properties":
494 if v != nil {
495 var costInsightProperties CostInsightProperties
496 err = json.Unmarshal(*v, &costInsightProperties)
497 if err != nil {
498 return err
499 }
500 ci.CostInsightProperties = &costInsightProperties
501 }
502 case "id":
503 if v != nil {
504 var ID string
505 err = json.Unmarshal(*v, &ID)
506 if err != nil {
507 return err
508 }
509 ci.ID = &ID
510 }
511 case "name":
512 if v != nil {
513 var name string
514 err = json.Unmarshal(*v, &name)
515 if err != nil {
516 return err
517 }
518 ci.Name = &name
519 }
520 case "type":
521 if v != nil {
522 var typeVar string
523 err = json.Unmarshal(*v, &typeVar)
524 if err != nil {
525 return err
526 }
527 ci.Type = &typeVar
528 }
529 case "location":
530 if v != nil {
531 var location string
532 err = json.Unmarshal(*v, &location)
533 if err != nil {
534 return err
535 }
536 ci.Location = &location
537 }
538 case "tags":
539 if v != nil {
540 var tags map[string]*string
541 err = json.Unmarshal(*v, &tags)
542 if err != nil {
543 return err
544 }
545 ci.Tags = tags
546 }
547 }
548 }
549
550 return nil
551 }
552
553
554 type CostInsightProperties struct {
555 CurrencyCode *string `json:"currencyCode,omitempty"`
556 VMCosts *[]VMCostProperties `json:"vmCosts,omitempty"`
557
558 ProvisioningState *string `json:"provisioningState,omitempty"`
559 }
560
561
562
563 type CostInsightRefreshDataFuture struct {
564 azure.FutureAPI
565
566
567 Result func(CostInsightClient) (autorest.Response, error)
568 }
569
570
571 func (future *CostInsightRefreshDataFuture) UnmarshalJSON(body []byte) error {
572 var azFuture azure.Future
573 if err := json.Unmarshal(body, &azFuture); err != nil {
574 return err
575 }
576 future.FutureAPI = &azFuture
577 future.Result = future.result
578 return nil
579 }
580
581
582 func (future *CostInsightRefreshDataFuture) result(client CostInsightClient) (ar autorest.Response, err error) {
583 var done bool
584 done, err = future.DoneWithContext(context.Background(), client)
585 if err != nil {
586 err = autorest.NewErrorWithError(err, "dtl.CostInsightRefreshDataFuture", "Result", future.Response(), "Polling failure")
587 return
588 }
589 if !done {
590 ar.Response = future.Response()
591 err = azure.NewAsyncOpIncompleteError("dtl.CostInsightRefreshDataFuture")
592 return
593 }
594 ar.Response = future.Response()
595 return
596 }
597
598
599 type CostPerDayProperties struct {
600
601 Date *date.Time `json:"date,omitempty"`
602
603 Cost *float64 `json:"cost,omitempty"`
604
605 CostType CostPropertyType `json:"costType,omitempty"`
606 }
607
608
609 type CostProperties struct {
610
611 CurrencyCode *string `json:"currencyCode,omitempty"`
612
613 Costs *[]CostPerDayProperties `json:"costs,omitempty"`
614 }
615
616
617
618 type CostRefreshDataFuture struct {
619 azure.FutureAPI
620
621
622 Result func(CostClient) (autorest.Response, error)
623 }
624
625
626 func (future *CostRefreshDataFuture) UnmarshalJSON(body []byte) error {
627 var azFuture azure.Future
628 if err := json.Unmarshal(body, &azFuture); err != nil {
629 return err
630 }
631 future.FutureAPI = &azFuture
632 future.Result = future.result
633 return nil
634 }
635
636
637 func (future *CostRefreshDataFuture) result(client CostClient) (ar autorest.Response, err error) {
638 var done bool
639 done, err = future.DoneWithContext(context.Background(), client)
640 if err != nil {
641 err = autorest.NewErrorWithError(err, "dtl.CostRefreshDataFuture", "Result", future.Response(), "Polling failure")
642 return
643 }
644 if !done {
645 ar.Response = future.Response()
646 err = azure.NewAsyncOpIncompleteError("dtl.CostRefreshDataFuture")
647 return
648 }
649 ar.Response = future.Response()
650 return
651 }
652
653
654 type CustomImage struct {
655 autorest.Response `json:"-"`
656
657 *CustomImageProperties `json:"properties,omitempty"`
658
659 ID *string `json:"id,omitempty"`
660
661 Name *string `json:"name,omitempty"`
662
663 Type *string `json:"type,omitempty"`
664
665 Location *string `json:"location,omitempty"`
666
667 Tags map[string]*string `json:"tags"`
668 }
669
670
671 func (ci CustomImage) MarshalJSON() ([]byte, error) {
672 objectMap := make(map[string]interface{})
673 if ci.CustomImageProperties != nil {
674 objectMap["properties"] = ci.CustomImageProperties
675 }
676 if ci.ID != nil {
677 objectMap["id"] = ci.ID
678 }
679 if ci.Name != nil {
680 objectMap["name"] = ci.Name
681 }
682 if ci.Type != nil {
683 objectMap["type"] = ci.Type
684 }
685 if ci.Location != nil {
686 objectMap["location"] = ci.Location
687 }
688 if ci.Tags != nil {
689 objectMap["tags"] = ci.Tags
690 }
691 return json.Marshal(objectMap)
692 }
693
694
695 func (ci *CustomImage) UnmarshalJSON(body []byte) error {
696 var m map[string]*json.RawMessage
697 err := json.Unmarshal(body, &m)
698 if err != nil {
699 return err
700 }
701 for k, v := range m {
702 switch k {
703 case "properties":
704 if v != nil {
705 var customImageProperties CustomImageProperties
706 err = json.Unmarshal(*v, &customImageProperties)
707 if err != nil {
708 return err
709 }
710 ci.CustomImageProperties = &customImageProperties
711 }
712 case "id":
713 if v != nil {
714 var ID string
715 err = json.Unmarshal(*v, &ID)
716 if err != nil {
717 return err
718 }
719 ci.ID = &ID
720 }
721 case "name":
722 if v != nil {
723 var name string
724 err = json.Unmarshal(*v, &name)
725 if err != nil {
726 return err
727 }
728 ci.Name = &name
729 }
730 case "type":
731 if v != nil {
732 var typeVar string
733 err = json.Unmarshal(*v, &typeVar)
734 if err != nil {
735 return err
736 }
737 ci.Type = &typeVar
738 }
739 case "location":
740 if v != nil {
741 var location string
742 err = json.Unmarshal(*v, &location)
743 if err != nil {
744 return err
745 }
746 ci.Location = &location
747 }
748 case "tags":
749 if v != nil {
750 var tags map[string]*string
751 err = json.Unmarshal(*v, &tags)
752 if err != nil {
753 return err
754 }
755 ci.Tags = tags
756 }
757 }
758 }
759
760 return nil
761 }
762
763
764
765 type CustomImageCreateOrUpdateResourceFuture struct {
766 azure.FutureAPI
767
768
769 Result func(CustomImageClient) (CustomImage, error)
770 }
771
772
773 func (future *CustomImageCreateOrUpdateResourceFuture) UnmarshalJSON(body []byte) error {
774 var azFuture azure.Future
775 if err := json.Unmarshal(body, &azFuture); err != nil {
776 return err
777 }
778 future.FutureAPI = &azFuture
779 future.Result = future.result
780 return nil
781 }
782
783
784 func (future *CustomImageCreateOrUpdateResourceFuture) result(client CustomImageClient) (ci CustomImage, err error) {
785 var done bool
786 done, err = future.DoneWithContext(context.Background(), client)
787 if err != nil {
788 err = autorest.NewErrorWithError(err, "dtl.CustomImageCreateOrUpdateResourceFuture", "Result", future.Response(), "Polling failure")
789 return
790 }
791 if !done {
792 ci.Response.Response = future.Response()
793 err = azure.NewAsyncOpIncompleteError("dtl.CustomImageCreateOrUpdateResourceFuture")
794 return
795 }
796 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
797 if ci.Response.Response, err = future.GetResult(sender); err == nil && ci.Response.Response.StatusCode != http.StatusNoContent {
798 ci, err = client.CreateOrUpdateResourceResponder(ci.Response.Response)
799 if err != nil {
800 err = autorest.NewErrorWithError(err, "dtl.CustomImageCreateOrUpdateResourceFuture", "Result", ci.Response.Response, "Failure responding to request")
801 }
802 }
803 return
804 }
805
806
807
808 type CustomImageDeleteResourceFuture struct {
809 azure.FutureAPI
810
811
812 Result func(CustomImageClient) (autorest.Response, error)
813 }
814
815
816 func (future *CustomImageDeleteResourceFuture) UnmarshalJSON(body []byte) error {
817 var azFuture azure.Future
818 if err := json.Unmarshal(body, &azFuture); err != nil {
819 return err
820 }
821 future.FutureAPI = &azFuture
822 future.Result = future.result
823 return nil
824 }
825
826
827 func (future *CustomImageDeleteResourceFuture) result(client CustomImageClient) (ar autorest.Response, err error) {
828 var done bool
829 done, err = future.DoneWithContext(context.Background(), client)
830 if err != nil {
831 err = autorest.NewErrorWithError(err, "dtl.CustomImageDeleteResourceFuture", "Result", future.Response(), "Polling failure")
832 return
833 }
834 if !done {
835 ar.Response = future.Response()
836 err = azure.NewAsyncOpIncompleteError("dtl.CustomImageDeleteResourceFuture")
837 return
838 }
839 ar.Response = future.Response()
840 return
841 }
842
843
844 type CustomImageProperties struct {
845 VM *CustomImagePropertiesFromVM `json:"vm,omitempty"`
846
847 Vhd *CustomImagePropertiesCustom `json:"vhd,omitempty"`
848
849 Description *string `json:"description,omitempty"`
850
851 OsType CustomImageOsType `json:"osType,omitempty"`
852
853 Author *string `json:"author,omitempty"`
854
855 CreationDate *date.Time `json:"creationDate,omitempty"`
856
857 ProvisioningState *string `json:"provisioningState,omitempty"`
858 }
859
860
861 type CustomImagePropertiesCustom struct {
862
863 ImageName *string `json:"imageName,omitempty"`
864
865 SysPrep *bool `json:"sysPrep,omitempty"`
866 }
867
868
869 type CustomImagePropertiesFromVM struct {
870
871 SourceVMID *string `json:"sourceVmId,omitempty"`
872
873 SysPrep *bool `json:"sysPrep,omitempty"`
874
875 WindowsOsInfo *WindowsOsInfo `json:"windowsOsInfo,omitempty"`
876
877 LinuxOsInfo *LinuxOsInfo `json:"linuxOsInfo,omitempty"`
878 }
879
880
881 type DayDetails struct {
882 Time *string `json:"time,omitempty"`
883 }
884
885
886 type EvaluatePoliciesProperties struct {
887
888 FactName *string `json:"factName,omitempty"`
889
890 FactData *string `json:"factData,omitempty"`
891
892 ValueOffset *string `json:"valueOffset,omitempty"`
893 }
894
895
896 type EvaluatePoliciesRequest struct {
897
898 Policies *[]EvaluatePoliciesProperties `json:"policies,omitempty"`
899 }
900
901
902 type EvaluatePoliciesResponse struct {
903 autorest.Response `json:"-"`
904
905 Results *[]PolicySetResult `json:"results,omitempty"`
906 }
907
908
909 type Formula struct {
910 autorest.Response `json:"-"`
911
912 *FormulaProperties `json:"properties,omitempty"`
913
914 ID *string `json:"id,omitempty"`
915
916 Name *string `json:"name,omitempty"`
917
918 Type *string `json:"type,omitempty"`
919
920 Location *string `json:"location,omitempty"`
921
922 Tags map[string]*string `json:"tags"`
923 }
924
925
926 func (f Formula) MarshalJSON() ([]byte, error) {
927 objectMap := make(map[string]interface{})
928 if f.FormulaProperties != nil {
929 objectMap["properties"] = f.FormulaProperties
930 }
931 if f.ID != nil {
932 objectMap["id"] = f.ID
933 }
934 if f.Name != nil {
935 objectMap["name"] = f.Name
936 }
937 if f.Type != nil {
938 objectMap["type"] = f.Type
939 }
940 if f.Location != nil {
941 objectMap["location"] = f.Location
942 }
943 if f.Tags != nil {
944 objectMap["tags"] = f.Tags
945 }
946 return json.Marshal(objectMap)
947 }
948
949
950 func (f *Formula) UnmarshalJSON(body []byte) error {
951 var m map[string]*json.RawMessage
952 err := json.Unmarshal(body, &m)
953 if err != nil {
954 return err
955 }
956 for k, v := range m {
957 switch k {
958 case "properties":
959 if v != nil {
960 var formulaProperties FormulaProperties
961 err = json.Unmarshal(*v, &formulaProperties)
962 if err != nil {
963 return err
964 }
965 f.FormulaProperties = &formulaProperties
966 }
967 case "id":
968 if v != nil {
969 var ID string
970 err = json.Unmarshal(*v, &ID)
971 if err != nil {
972 return err
973 }
974 f.ID = &ID
975 }
976 case "name":
977 if v != nil {
978 var name string
979 err = json.Unmarshal(*v, &name)
980 if err != nil {
981 return err
982 }
983 f.Name = &name
984 }
985 case "type":
986 if v != nil {
987 var typeVar string
988 err = json.Unmarshal(*v, &typeVar)
989 if err != nil {
990 return err
991 }
992 f.Type = &typeVar
993 }
994 case "location":
995 if v != nil {
996 var location string
997 err = json.Unmarshal(*v, &location)
998 if err != nil {
999 return err
1000 }
1001 f.Location = &location
1002 }
1003 case "tags":
1004 if v != nil {
1005 var tags map[string]*string
1006 err = json.Unmarshal(*v, &tags)
1007 if err != nil {
1008 return err
1009 }
1010 f.Tags = tags
1011 }
1012 }
1013 }
1014
1015 return nil
1016 }
1017
1018
1019
1020 type FormulaCreateOrUpdateResourceFuture struct {
1021 azure.FutureAPI
1022
1023
1024 Result func(FormulaClient) (Formula, error)
1025 }
1026
1027
1028 func (future *FormulaCreateOrUpdateResourceFuture) UnmarshalJSON(body []byte) error {
1029 var azFuture azure.Future
1030 if err := json.Unmarshal(body, &azFuture); err != nil {
1031 return err
1032 }
1033 future.FutureAPI = &azFuture
1034 future.Result = future.result
1035 return nil
1036 }
1037
1038
1039 func (future *FormulaCreateOrUpdateResourceFuture) result(client FormulaClient) (f Formula, err error) {
1040 var done bool
1041 done, err = future.DoneWithContext(context.Background(), client)
1042 if err != nil {
1043 err = autorest.NewErrorWithError(err, "dtl.FormulaCreateOrUpdateResourceFuture", "Result", future.Response(), "Polling failure")
1044 return
1045 }
1046 if !done {
1047 f.Response.Response = future.Response()
1048 err = azure.NewAsyncOpIncompleteError("dtl.FormulaCreateOrUpdateResourceFuture")
1049 return
1050 }
1051 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1052 if f.Response.Response, err = future.GetResult(sender); err == nil && f.Response.Response.StatusCode != http.StatusNoContent {
1053 f, err = client.CreateOrUpdateResourceResponder(f.Response.Response)
1054 if err != nil {
1055 err = autorest.NewErrorWithError(err, "dtl.FormulaCreateOrUpdateResourceFuture", "Result", f.Response.Response, "Failure responding to request")
1056 }
1057 }
1058 return
1059 }
1060
1061
1062 type FormulaProperties struct {
1063
1064 Description *string `json:"description,omitempty"`
1065
1066 Author *string `json:"author,omitempty"`
1067
1068 OsType *string `json:"osType,omitempty"`
1069
1070 CreationDate *date.Time `json:"creationDate,omitempty"`
1071
1072 FormulaContent *LabVirtualMachine `json:"formulaContent,omitempty"`
1073
1074 VM *FormulaPropertiesFromVM `json:"vm,omitempty"`
1075
1076 ProvisioningState *string `json:"provisioningState,omitempty"`
1077 }
1078
1079
1080 type FormulaPropertiesFromVM struct {
1081
1082 LabVMID *string `json:"labVmId,omitempty"`
1083 }
1084
1085
1086 type GalleryImage struct {
1087
1088 *GalleryImageProperties `json:"properties,omitempty"`
1089
1090 ID *string `json:"id,omitempty"`
1091
1092 Name *string `json:"name,omitempty"`
1093
1094 Type *string `json:"type,omitempty"`
1095
1096 Location *string `json:"location,omitempty"`
1097
1098 Tags map[string]*string `json:"tags"`
1099 }
1100
1101
1102 func (gi GalleryImage) MarshalJSON() ([]byte, error) {
1103 objectMap := make(map[string]interface{})
1104 if gi.GalleryImageProperties != nil {
1105 objectMap["properties"] = gi.GalleryImageProperties
1106 }
1107 if gi.ID != nil {
1108 objectMap["id"] = gi.ID
1109 }
1110 if gi.Name != nil {
1111 objectMap["name"] = gi.Name
1112 }
1113 if gi.Type != nil {
1114 objectMap["type"] = gi.Type
1115 }
1116 if gi.Location != nil {
1117 objectMap["location"] = gi.Location
1118 }
1119 if gi.Tags != nil {
1120 objectMap["tags"] = gi.Tags
1121 }
1122 return json.Marshal(objectMap)
1123 }
1124
1125
1126 func (gi *GalleryImage) UnmarshalJSON(body []byte) error {
1127 var m map[string]*json.RawMessage
1128 err := json.Unmarshal(body, &m)
1129 if err != nil {
1130 return err
1131 }
1132 for k, v := range m {
1133 switch k {
1134 case "properties":
1135 if v != nil {
1136 var galleryImageProperties GalleryImageProperties
1137 err = json.Unmarshal(*v, &galleryImageProperties)
1138 if err != nil {
1139 return err
1140 }
1141 gi.GalleryImageProperties = &galleryImageProperties
1142 }
1143 case "id":
1144 if v != nil {
1145 var ID string
1146 err = json.Unmarshal(*v, &ID)
1147 if err != nil {
1148 return err
1149 }
1150 gi.ID = &ID
1151 }
1152 case "name":
1153 if v != nil {
1154 var name string
1155 err = json.Unmarshal(*v, &name)
1156 if err != nil {
1157 return err
1158 }
1159 gi.Name = &name
1160 }
1161 case "type":
1162 if v != nil {
1163 var typeVar string
1164 err = json.Unmarshal(*v, &typeVar)
1165 if err != nil {
1166 return err
1167 }
1168 gi.Type = &typeVar
1169 }
1170 case "location":
1171 if v != nil {
1172 var location string
1173 err = json.Unmarshal(*v, &location)
1174 if err != nil {
1175 return err
1176 }
1177 gi.Location = &location
1178 }
1179 case "tags":
1180 if v != nil {
1181 var tags map[string]*string
1182 err = json.Unmarshal(*v, &tags)
1183 if err != nil {
1184 return err
1185 }
1186 gi.Tags = tags
1187 }
1188 }
1189 }
1190
1191 return nil
1192 }
1193
1194
1195 type GalleryImageProperties struct {
1196
1197 Author *string `json:"author,omitempty"`
1198
1199 CreatedDate *date.Time `json:"createdDate,omitempty"`
1200
1201 Description *string `json:"description,omitempty"`
1202
1203 ImageReference *GalleryImageReference `json:"imageReference,omitempty"`
1204
1205 Icon *string `json:"icon,omitempty"`
1206
1207 Enabled *bool `json:"enabled,omitempty"`
1208 }
1209
1210
1211 type GalleryImageReference struct {
1212
1213 Offer *string `json:"offer,omitempty"`
1214
1215 Publisher *string `json:"publisher,omitempty"`
1216
1217 Sku *string `json:"sku,omitempty"`
1218
1219 OsType *string `json:"osType,omitempty"`
1220
1221 Version *string `json:"version,omitempty"`
1222 }
1223
1224
1225 type GenerateArmTemplateRequest struct {
1226
1227 VirtualMachineName *string `json:"virtualMachineName,omitempty"`
1228
1229 Parameters *[]ParameterInfo `json:"parameters,omitempty"`
1230
1231 Location *string `json:"location,omitempty"`
1232 }
1233
1234
1235 type GenerateUploadURIParameter struct {
1236
1237 BlobName *string `json:"blobName,omitempty"`
1238 }
1239
1240
1241 type GenerateUploadURIResponse struct {
1242 autorest.Response `json:"-"`
1243
1244 UploadURI *string `json:"uploadUri,omitempty"`
1245 }
1246
1247
1248 type HourDetails struct {
1249
1250 Minute *int32 `json:"minute,omitempty"`
1251 }
1252
1253
1254 type Lab struct {
1255 autorest.Response `json:"-"`
1256
1257 *LabProperties `json:"properties,omitempty"`
1258
1259 ID *string `json:"id,omitempty"`
1260
1261 Name *string `json:"name,omitempty"`
1262
1263 Type *string `json:"type,omitempty"`
1264
1265 Location *string `json:"location,omitempty"`
1266
1267 Tags map[string]*string `json:"tags"`
1268 }
1269
1270
1271 func (l Lab) MarshalJSON() ([]byte, error) {
1272 objectMap := make(map[string]interface{})
1273 if l.LabProperties != nil {
1274 objectMap["properties"] = l.LabProperties
1275 }
1276 if l.ID != nil {
1277 objectMap["id"] = l.ID
1278 }
1279 if l.Name != nil {
1280 objectMap["name"] = l.Name
1281 }
1282 if l.Type != nil {
1283 objectMap["type"] = l.Type
1284 }
1285 if l.Location != nil {
1286 objectMap["location"] = l.Location
1287 }
1288 if l.Tags != nil {
1289 objectMap["tags"] = l.Tags
1290 }
1291 return json.Marshal(objectMap)
1292 }
1293
1294
1295 func (l *Lab) UnmarshalJSON(body []byte) error {
1296 var m map[string]*json.RawMessage
1297 err := json.Unmarshal(body, &m)
1298 if err != nil {
1299 return err
1300 }
1301 for k, v := range m {
1302 switch k {
1303 case "properties":
1304 if v != nil {
1305 var labProperties LabProperties
1306 err = json.Unmarshal(*v, &labProperties)
1307 if err != nil {
1308 return err
1309 }
1310 l.LabProperties = &labProperties
1311 }
1312 case "id":
1313 if v != nil {
1314 var ID string
1315 err = json.Unmarshal(*v, &ID)
1316 if err != nil {
1317 return err
1318 }
1319 l.ID = &ID
1320 }
1321 case "name":
1322 if v != nil {
1323 var name string
1324 err = json.Unmarshal(*v, &name)
1325 if err != nil {
1326 return err
1327 }
1328 l.Name = &name
1329 }
1330 case "type":
1331 if v != nil {
1332 var typeVar string
1333 err = json.Unmarshal(*v, &typeVar)
1334 if err != nil {
1335 return err
1336 }
1337 l.Type = &typeVar
1338 }
1339 case "location":
1340 if v != nil {
1341 var location string
1342 err = json.Unmarshal(*v, &location)
1343 if err != nil {
1344 return err
1345 }
1346 l.Location = &location
1347 }
1348 case "tags":
1349 if v != nil {
1350 var tags map[string]*string
1351 err = json.Unmarshal(*v, &tags)
1352 if err != nil {
1353 return err
1354 }
1355 l.Tags = tags
1356 }
1357 }
1358 }
1359
1360 return nil
1361 }
1362
1363
1364
1365 type LabCreateEnvironmentFuture struct {
1366 azure.FutureAPI
1367
1368
1369 Result func(LabClient) (autorest.Response, error)
1370 }
1371
1372
1373 func (future *LabCreateEnvironmentFuture) UnmarshalJSON(body []byte) error {
1374 var azFuture azure.Future
1375 if err := json.Unmarshal(body, &azFuture); err != nil {
1376 return err
1377 }
1378 future.FutureAPI = &azFuture
1379 future.Result = future.result
1380 return nil
1381 }
1382
1383
1384 func (future *LabCreateEnvironmentFuture) result(client LabClient) (ar autorest.Response, err error) {
1385 var done bool
1386 done, err = future.DoneWithContext(context.Background(), client)
1387 if err != nil {
1388 err = autorest.NewErrorWithError(err, "dtl.LabCreateEnvironmentFuture", "Result", future.Response(), "Polling failure")
1389 return
1390 }
1391 if !done {
1392 ar.Response = future.Response()
1393 err = azure.NewAsyncOpIncompleteError("dtl.LabCreateEnvironmentFuture")
1394 return
1395 }
1396 ar.Response = future.Response()
1397 return
1398 }
1399
1400
1401
1402 type LabCreateOrUpdateResourceFuture struct {
1403 azure.FutureAPI
1404
1405
1406 Result func(LabClient) (Lab, error)
1407 }
1408
1409
1410 func (future *LabCreateOrUpdateResourceFuture) UnmarshalJSON(body []byte) error {
1411 var azFuture azure.Future
1412 if err := json.Unmarshal(body, &azFuture); err != nil {
1413 return err
1414 }
1415 future.FutureAPI = &azFuture
1416 future.Result = future.result
1417 return nil
1418 }
1419
1420
1421 func (future *LabCreateOrUpdateResourceFuture) result(client LabClient) (l Lab, err error) {
1422 var done bool
1423 done, err = future.DoneWithContext(context.Background(), client)
1424 if err != nil {
1425 err = autorest.NewErrorWithError(err, "dtl.LabCreateOrUpdateResourceFuture", "Result", future.Response(), "Polling failure")
1426 return
1427 }
1428 if !done {
1429 l.Response.Response = future.Response()
1430 err = azure.NewAsyncOpIncompleteError("dtl.LabCreateOrUpdateResourceFuture")
1431 return
1432 }
1433 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1434 if l.Response.Response, err = future.GetResult(sender); err == nil && l.Response.Response.StatusCode != http.StatusNoContent {
1435 l, err = client.CreateOrUpdateResourceResponder(l.Response.Response)
1436 if err != nil {
1437 err = autorest.NewErrorWithError(err, "dtl.LabCreateOrUpdateResourceFuture", "Result", l.Response.Response, "Failure responding to request")
1438 }
1439 }
1440 return
1441 }
1442
1443
1444
1445 type LabDeleteResourceFuture struct {
1446 azure.FutureAPI
1447
1448
1449 Result func(LabClient) (autorest.Response, error)
1450 }
1451
1452
1453 func (future *LabDeleteResourceFuture) UnmarshalJSON(body []byte) error {
1454 var azFuture azure.Future
1455 if err := json.Unmarshal(body, &azFuture); err != nil {
1456 return err
1457 }
1458 future.FutureAPI = &azFuture
1459 future.Result = future.result
1460 return nil
1461 }
1462
1463
1464 func (future *LabDeleteResourceFuture) result(client LabClient) (ar autorest.Response, err error) {
1465 var done bool
1466 done, err = future.DoneWithContext(context.Background(), client)
1467 if err != nil {
1468 err = autorest.NewErrorWithError(err, "dtl.LabDeleteResourceFuture", "Result", future.Response(), "Polling failure")
1469 return
1470 }
1471 if !done {
1472 ar.Response = future.Response()
1473 err = azure.NewAsyncOpIncompleteError("dtl.LabDeleteResourceFuture")
1474 return
1475 }
1476 ar.Response = future.Response()
1477 return
1478 }
1479
1480
1481 type LabProperties struct {
1482
1483 DefaultStorageAccount *string `json:"defaultStorageAccount,omitempty"`
1484
1485 ArtifactsStorageAccount *string `json:"artifactsStorageAccount,omitempty"`
1486
1487 StorageAccounts *[]string `json:"storageAccounts,omitempty"`
1488
1489 VaultName *string `json:"vaultName,omitempty"`
1490
1491 LabStorageType LabStorageType `json:"labStorageType,omitempty"`
1492
1493 DefaultVirtualNetworkID *string `json:"defaultVirtualNetworkId,omitempty"`
1494
1495 CreatedDate *date.Time `json:"createdDate,omitempty"`
1496
1497 ProvisioningState *string `json:"provisioningState,omitempty"`
1498 }
1499
1500
1501 type LabVhd struct {
1502
1503 ID *string `json:"id,omitempty"`
1504 }
1505
1506
1507 type LabVirtualMachine struct {
1508 autorest.Response `json:"-"`
1509
1510 *LabVirtualMachineProperties `json:"properties,omitempty"`
1511
1512 ID *string `json:"id,omitempty"`
1513
1514 Name *string `json:"name,omitempty"`
1515
1516 Type *string `json:"type,omitempty"`
1517
1518 Location *string `json:"location,omitempty"`
1519
1520 Tags map[string]*string `json:"tags"`
1521 }
1522
1523
1524 func (lvm LabVirtualMachine) MarshalJSON() ([]byte, error) {
1525 objectMap := make(map[string]interface{})
1526 if lvm.LabVirtualMachineProperties != nil {
1527 objectMap["properties"] = lvm.LabVirtualMachineProperties
1528 }
1529 if lvm.ID != nil {
1530 objectMap["id"] = lvm.ID
1531 }
1532 if lvm.Name != nil {
1533 objectMap["name"] = lvm.Name
1534 }
1535 if lvm.Type != nil {
1536 objectMap["type"] = lvm.Type
1537 }
1538 if lvm.Location != nil {
1539 objectMap["location"] = lvm.Location
1540 }
1541 if lvm.Tags != nil {
1542 objectMap["tags"] = lvm.Tags
1543 }
1544 return json.Marshal(objectMap)
1545 }
1546
1547
1548 func (lvm *LabVirtualMachine) UnmarshalJSON(body []byte) error {
1549 var m map[string]*json.RawMessage
1550 err := json.Unmarshal(body, &m)
1551 if err != nil {
1552 return err
1553 }
1554 for k, v := range m {
1555 switch k {
1556 case "properties":
1557 if v != nil {
1558 var labVirtualMachineProperties LabVirtualMachineProperties
1559 err = json.Unmarshal(*v, &labVirtualMachineProperties)
1560 if err != nil {
1561 return err
1562 }
1563 lvm.LabVirtualMachineProperties = &labVirtualMachineProperties
1564 }
1565 case "id":
1566 if v != nil {
1567 var ID string
1568 err = json.Unmarshal(*v, &ID)
1569 if err != nil {
1570 return err
1571 }
1572 lvm.ID = &ID
1573 }
1574 case "name":
1575 if v != nil {
1576 var name string
1577 err = json.Unmarshal(*v, &name)
1578 if err != nil {
1579 return err
1580 }
1581 lvm.Name = &name
1582 }
1583 case "type":
1584 if v != nil {
1585 var typeVar string
1586 err = json.Unmarshal(*v, &typeVar)
1587 if err != nil {
1588 return err
1589 }
1590 lvm.Type = &typeVar
1591 }
1592 case "location":
1593 if v != nil {
1594 var location string
1595 err = json.Unmarshal(*v, &location)
1596 if err != nil {
1597 return err
1598 }
1599 lvm.Location = &location
1600 }
1601 case "tags":
1602 if v != nil {
1603 var tags map[string]*string
1604 err = json.Unmarshal(*v, &tags)
1605 if err != nil {
1606 return err
1607 }
1608 lvm.Tags = tags
1609 }
1610 }
1611 }
1612
1613 return nil
1614 }
1615
1616
1617 type LabVirtualMachineProperties struct {
1618
1619 Notes *string `json:"notes,omitempty"`
1620
1621 OwnerObjectID *string `json:"ownerObjectId,omitempty"`
1622
1623 CreatedByUserID *string `json:"createdByUserId,omitempty"`
1624
1625 CreatedByUser *string `json:"createdByUser,omitempty"`
1626
1627 ComputeID *string `json:"computeId,omitempty"`
1628
1629 CustomImageID *string `json:"customImageId,omitempty"`
1630
1631 OsType *string `json:"osType,omitempty"`
1632
1633 Size *string `json:"size,omitempty"`
1634
1635 UserName *string `json:"userName,omitempty"`
1636
1637 Password *string `json:"password,omitempty"`
1638
1639 SSHKey *string `json:"sshKey,omitempty"`
1640
1641 IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"`
1642
1643 Fqdn *string `json:"fqdn,omitempty"`
1644
1645 LabSubnetName *string `json:"labSubnetName,omitempty"`
1646
1647 LabVirtualNetworkID *string `json:"labVirtualNetworkId,omitempty"`
1648
1649 DisallowPublicIPAddress *bool `json:"disallowPublicIpAddress,omitempty"`
1650
1651 Artifacts *[]ArtifactInstallProperties `json:"artifacts,omitempty"`
1652
1653 ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties `json:"artifactDeploymentStatus,omitempty"`
1654
1655 GalleryImageReference *GalleryImageReference `json:"galleryImageReference,omitempty"`
1656
1657 ProvisioningState *string `json:"provisioningState,omitempty"`
1658 }
1659
1660
1661 type LinuxOsInfo struct {
1662
1663 LinuxOsState LinuxOsState `json:"linuxOsState,omitempty"`
1664 }
1665
1666
1667 type ParameterInfo struct {
1668 Name *string `json:"name,omitempty"`
1669 Value *string `json:"value,omitempty"`
1670 }
1671
1672
1673 type Policy struct {
1674 autorest.Response `json:"-"`
1675
1676 *PolicyProperties `json:"properties,omitempty"`
1677
1678 ID *string `json:"id,omitempty"`
1679
1680 Name *string `json:"name,omitempty"`
1681
1682 Type *string `json:"type,omitempty"`
1683
1684 Location *string `json:"location,omitempty"`
1685
1686 Tags map[string]*string `json:"tags"`
1687 }
1688
1689
1690 func (p Policy) MarshalJSON() ([]byte, error) {
1691 objectMap := make(map[string]interface{})
1692 if p.PolicyProperties != nil {
1693 objectMap["properties"] = p.PolicyProperties
1694 }
1695 if p.ID != nil {
1696 objectMap["id"] = p.ID
1697 }
1698 if p.Name != nil {
1699 objectMap["name"] = p.Name
1700 }
1701 if p.Type != nil {
1702 objectMap["type"] = p.Type
1703 }
1704 if p.Location != nil {
1705 objectMap["location"] = p.Location
1706 }
1707 if p.Tags != nil {
1708 objectMap["tags"] = p.Tags
1709 }
1710 return json.Marshal(objectMap)
1711 }
1712
1713
1714 func (p *Policy) UnmarshalJSON(body []byte) error {
1715 var m map[string]*json.RawMessage
1716 err := json.Unmarshal(body, &m)
1717 if err != nil {
1718 return err
1719 }
1720 for k, v := range m {
1721 switch k {
1722 case "properties":
1723 if v != nil {
1724 var policyProperties PolicyProperties
1725 err = json.Unmarshal(*v, &policyProperties)
1726 if err != nil {
1727 return err
1728 }
1729 p.PolicyProperties = &policyProperties
1730 }
1731 case "id":
1732 if v != nil {
1733 var ID string
1734 err = json.Unmarshal(*v, &ID)
1735 if err != nil {
1736 return err
1737 }
1738 p.ID = &ID
1739 }
1740 case "name":
1741 if v != nil {
1742 var name string
1743 err = json.Unmarshal(*v, &name)
1744 if err != nil {
1745 return err
1746 }
1747 p.Name = &name
1748 }
1749 case "type":
1750 if v != nil {
1751 var typeVar string
1752 err = json.Unmarshal(*v, &typeVar)
1753 if err != nil {
1754 return err
1755 }
1756 p.Type = &typeVar
1757 }
1758 case "location":
1759 if v != nil {
1760 var location string
1761 err = json.Unmarshal(*v, &location)
1762 if err != nil {
1763 return err
1764 }
1765 p.Location = &location
1766 }
1767 case "tags":
1768 if v != nil {
1769 var tags map[string]*string
1770 err = json.Unmarshal(*v, &tags)
1771 if err != nil {
1772 return err
1773 }
1774 p.Tags = tags
1775 }
1776 }
1777 }
1778
1779 return nil
1780 }
1781
1782
1783 type PolicyProperties struct {
1784
1785 Description *string `json:"description,omitempty"`
1786
1787 Status PolicyStatus `json:"status,omitempty"`
1788
1789 FactName PolicyFactName `json:"factName,omitempty"`
1790
1791 FactData *string `json:"factData,omitempty"`
1792
1793 Threshold *string `json:"threshold,omitempty"`
1794
1795 EvaluatorType PolicyEvaluatorType `json:"evaluatorType,omitempty"`
1796
1797 ProvisioningState *string `json:"provisioningState,omitempty"`
1798 }
1799
1800
1801 type PolicySetResult struct {
1802
1803 HasError *bool `json:"hasError,omitempty"`
1804
1805 PolicyViolations *[]PolicyViolation `json:"policyViolations,omitempty"`
1806 }
1807
1808
1809 type PolicyViolation struct {
1810
1811 Code *string `json:"code,omitempty"`
1812
1813 Message *string `json:"message,omitempty"`
1814 }
1815
1816
1817 type ResponseWithContinuationArtifact struct {
1818 autorest.Response `json:"-"`
1819
1820 Value *[]Artifact `json:"value,omitempty"`
1821
1822 NextLink *string `json:"nextLink,omitempty"`
1823 }
1824
1825
1826 type ResponseWithContinuationArtifactIterator struct {
1827 i int
1828 page ResponseWithContinuationArtifactPage
1829 }
1830
1831
1832
1833 func (iter *ResponseWithContinuationArtifactIterator) NextWithContext(ctx context.Context) (err error) {
1834 if tracing.IsEnabled() {
1835 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArtifactIterator.NextWithContext")
1836 defer func() {
1837 sc := -1
1838 if iter.Response().Response.Response != nil {
1839 sc = iter.Response().Response.Response.StatusCode
1840 }
1841 tracing.EndSpan(ctx, sc, err)
1842 }()
1843 }
1844 iter.i++
1845 if iter.i < len(iter.page.Values()) {
1846 return nil
1847 }
1848 err = iter.page.NextWithContext(ctx)
1849 if err != nil {
1850 iter.i--
1851 return err
1852 }
1853 iter.i = 0
1854 return nil
1855 }
1856
1857
1858
1859
1860 func (iter *ResponseWithContinuationArtifactIterator) Next() error {
1861 return iter.NextWithContext(context.Background())
1862 }
1863
1864
1865 func (iter ResponseWithContinuationArtifactIterator) NotDone() bool {
1866 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1867 }
1868
1869
1870 func (iter ResponseWithContinuationArtifactIterator) Response() ResponseWithContinuationArtifact {
1871 return iter.page.Response()
1872 }
1873
1874
1875
1876 func (iter ResponseWithContinuationArtifactIterator) Value() Artifact {
1877 if !iter.page.NotDone() {
1878 return Artifact{}
1879 }
1880 return iter.page.Values()[iter.i]
1881 }
1882
1883
1884 func NewResponseWithContinuationArtifactIterator(page ResponseWithContinuationArtifactPage) ResponseWithContinuationArtifactIterator {
1885 return ResponseWithContinuationArtifactIterator{page: page}
1886 }
1887
1888
1889 func (rwcA ResponseWithContinuationArtifact) IsEmpty() bool {
1890 return rwcA.Value == nil || len(*rwcA.Value) == 0
1891 }
1892
1893
1894 func (rwcA ResponseWithContinuationArtifact) hasNextLink() bool {
1895 return rwcA.NextLink != nil && len(*rwcA.NextLink) != 0
1896 }
1897
1898
1899
1900 func (rwcA ResponseWithContinuationArtifact) responseWithContinuationArtifactPreparer(ctx context.Context) (*http.Request, error) {
1901 if !rwcA.hasNextLink() {
1902 return nil, nil
1903 }
1904 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1905 autorest.AsJSON(),
1906 autorest.AsGet(),
1907 autorest.WithBaseURL(to.String(rwcA.NextLink)))
1908 }
1909
1910
1911 type ResponseWithContinuationArtifactPage struct {
1912 fn func(context.Context, ResponseWithContinuationArtifact) (ResponseWithContinuationArtifact, error)
1913 rwca ResponseWithContinuationArtifact
1914 }
1915
1916
1917
1918 func (page *ResponseWithContinuationArtifactPage) NextWithContext(ctx context.Context) (err error) {
1919 if tracing.IsEnabled() {
1920 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArtifactPage.NextWithContext")
1921 defer func() {
1922 sc := -1
1923 if page.Response().Response.Response != nil {
1924 sc = page.Response().Response.Response.StatusCode
1925 }
1926 tracing.EndSpan(ctx, sc, err)
1927 }()
1928 }
1929 for {
1930 next, err := page.fn(ctx, page.rwca)
1931 if err != nil {
1932 return err
1933 }
1934 page.rwca = next
1935 if !next.hasNextLink() || !next.IsEmpty() {
1936 break
1937 }
1938 }
1939 return nil
1940 }
1941
1942
1943
1944
1945 func (page *ResponseWithContinuationArtifactPage) Next() error {
1946 return page.NextWithContext(context.Background())
1947 }
1948
1949
1950 func (page ResponseWithContinuationArtifactPage) NotDone() bool {
1951 return !page.rwca.IsEmpty()
1952 }
1953
1954
1955 func (page ResponseWithContinuationArtifactPage) Response() ResponseWithContinuationArtifact {
1956 return page.rwca
1957 }
1958
1959
1960 func (page ResponseWithContinuationArtifactPage) Values() []Artifact {
1961 if page.rwca.IsEmpty() {
1962 return nil
1963 }
1964 return *page.rwca.Value
1965 }
1966
1967
1968 func NewResponseWithContinuationArtifactPage(cur ResponseWithContinuationArtifact, getNextPage func(context.Context, ResponseWithContinuationArtifact) (ResponseWithContinuationArtifact, error)) ResponseWithContinuationArtifactPage {
1969 return ResponseWithContinuationArtifactPage{
1970 fn: getNextPage,
1971 rwca: cur,
1972 }
1973 }
1974
1975
1976 type ResponseWithContinuationArtifactSource struct {
1977 autorest.Response `json:"-"`
1978
1979 Value *[]ArtifactSource `json:"value,omitempty"`
1980
1981 NextLink *string `json:"nextLink,omitempty"`
1982 }
1983
1984
1985
1986 type ResponseWithContinuationArtifactSourceIterator struct {
1987 i int
1988 page ResponseWithContinuationArtifactSourcePage
1989 }
1990
1991
1992
1993 func (iter *ResponseWithContinuationArtifactSourceIterator) NextWithContext(ctx context.Context) (err error) {
1994 if tracing.IsEnabled() {
1995 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArtifactSourceIterator.NextWithContext")
1996 defer func() {
1997 sc := -1
1998 if iter.Response().Response.Response != nil {
1999 sc = iter.Response().Response.Response.StatusCode
2000 }
2001 tracing.EndSpan(ctx, sc, err)
2002 }()
2003 }
2004 iter.i++
2005 if iter.i < len(iter.page.Values()) {
2006 return nil
2007 }
2008 err = iter.page.NextWithContext(ctx)
2009 if err != nil {
2010 iter.i--
2011 return err
2012 }
2013 iter.i = 0
2014 return nil
2015 }
2016
2017
2018
2019
2020 func (iter *ResponseWithContinuationArtifactSourceIterator) Next() error {
2021 return iter.NextWithContext(context.Background())
2022 }
2023
2024
2025 func (iter ResponseWithContinuationArtifactSourceIterator) NotDone() bool {
2026 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2027 }
2028
2029
2030 func (iter ResponseWithContinuationArtifactSourceIterator) Response() ResponseWithContinuationArtifactSource {
2031 return iter.page.Response()
2032 }
2033
2034
2035
2036 func (iter ResponseWithContinuationArtifactSourceIterator) Value() ArtifactSource {
2037 if !iter.page.NotDone() {
2038 return ArtifactSource{}
2039 }
2040 return iter.page.Values()[iter.i]
2041 }
2042
2043
2044 func NewResponseWithContinuationArtifactSourceIterator(page ResponseWithContinuationArtifactSourcePage) ResponseWithContinuationArtifactSourceIterator {
2045 return ResponseWithContinuationArtifactSourceIterator{page: page}
2046 }
2047
2048
2049 func (rwcAs ResponseWithContinuationArtifactSource) IsEmpty() bool {
2050 return rwcAs.Value == nil || len(*rwcAs.Value) == 0
2051 }
2052
2053
2054 func (rwcAs ResponseWithContinuationArtifactSource) hasNextLink() bool {
2055 return rwcAs.NextLink != nil && len(*rwcAs.NextLink) != 0
2056 }
2057
2058
2059
2060 func (rwcAs ResponseWithContinuationArtifactSource) responseWithContinuationArtifactSourcePreparer(ctx context.Context) (*http.Request, error) {
2061 if !rwcAs.hasNextLink() {
2062 return nil, nil
2063 }
2064 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2065 autorest.AsJSON(),
2066 autorest.AsGet(),
2067 autorest.WithBaseURL(to.String(rwcAs.NextLink)))
2068 }
2069
2070
2071 type ResponseWithContinuationArtifactSourcePage struct {
2072 fn func(context.Context, ResponseWithContinuationArtifactSource) (ResponseWithContinuationArtifactSource, error)
2073 rwcas ResponseWithContinuationArtifactSource
2074 }
2075
2076
2077
2078 func (page *ResponseWithContinuationArtifactSourcePage) NextWithContext(ctx context.Context) (err error) {
2079 if tracing.IsEnabled() {
2080 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArtifactSourcePage.NextWithContext")
2081 defer func() {
2082 sc := -1
2083 if page.Response().Response.Response != nil {
2084 sc = page.Response().Response.Response.StatusCode
2085 }
2086 tracing.EndSpan(ctx, sc, err)
2087 }()
2088 }
2089 for {
2090 next, err := page.fn(ctx, page.rwcas)
2091 if err != nil {
2092 return err
2093 }
2094 page.rwcas = next
2095 if !next.hasNextLink() || !next.IsEmpty() {
2096 break
2097 }
2098 }
2099 return nil
2100 }
2101
2102
2103
2104
2105 func (page *ResponseWithContinuationArtifactSourcePage) Next() error {
2106 return page.NextWithContext(context.Background())
2107 }
2108
2109
2110 func (page ResponseWithContinuationArtifactSourcePage) NotDone() bool {
2111 return !page.rwcas.IsEmpty()
2112 }
2113
2114
2115 func (page ResponseWithContinuationArtifactSourcePage) Response() ResponseWithContinuationArtifactSource {
2116 return page.rwcas
2117 }
2118
2119
2120 func (page ResponseWithContinuationArtifactSourcePage) Values() []ArtifactSource {
2121 if page.rwcas.IsEmpty() {
2122 return nil
2123 }
2124 return *page.rwcas.Value
2125 }
2126
2127
2128 func NewResponseWithContinuationArtifactSourcePage(cur ResponseWithContinuationArtifactSource, getNextPage func(context.Context, ResponseWithContinuationArtifactSource) (ResponseWithContinuationArtifactSource, error)) ResponseWithContinuationArtifactSourcePage {
2129 return ResponseWithContinuationArtifactSourcePage{
2130 fn: getNextPage,
2131 rwcas: cur,
2132 }
2133 }
2134
2135
2136 type ResponseWithContinuationCost struct {
2137 autorest.Response `json:"-"`
2138
2139 Value *[]Cost `json:"value,omitempty"`
2140
2141 NextLink *string `json:"nextLink,omitempty"`
2142 }
2143
2144
2145 type ResponseWithContinuationCostInsight struct {
2146 autorest.Response `json:"-"`
2147
2148 Value *[]CostInsight `json:"value,omitempty"`
2149
2150 NextLink *string `json:"nextLink,omitempty"`
2151 }
2152
2153
2154 type ResponseWithContinuationCostInsightIterator struct {
2155 i int
2156 page ResponseWithContinuationCostInsightPage
2157 }
2158
2159
2160
2161 func (iter *ResponseWithContinuationCostInsightIterator) NextWithContext(ctx context.Context) (err error) {
2162 if tracing.IsEnabled() {
2163 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationCostInsightIterator.NextWithContext")
2164 defer func() {
2165 sc := -1
2166 if iter.Response().Response.Response != nil {
2167 sc = iter.Response().Response.Response.StatusCode
2168 }
2169 tracing.EndSpan(ctx, sc, err)
2170 }()
2171 }
2172 iter.i++
2173 if iter.i < len(iter.page.Values()) {
2174 return nil
2175 }
2176 err = iter.page.NextWithContext(ctx)
2177 if err != nil {
2178 iter.i--
2179 return err
2180 }
2181 iter.i = 0
2182 return nil
2183 }
2184
2185
2186
2187
2188 func (iter *ResponseWithContinuationCostInsightIterator) Next() error {
2189 return iter.NextWithContext(context.Background())
2190 }
2191
2192
2193 func (iter ResponseWithContinuationCostInsightIterator) NotDone() bool {
2194 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2195 }
2196
2197
2198 func (iter ResponseWithContinuationCostInsightIterator) Response() ResponseWithContinuationCostInsight {
2199 return iter.page.Response()
2200 }
2201
2202
2203
2204 func (iter ResponseWithContinuationCostInsightIterator) Value() CostInsight {
2205 if !iter.page.NotDone() {
2206 return CostInsight{}
2207 }
2208 return iter.page.Values()[iter.i]
2209 }
2210
2211
2212 func NewResponseWithContinuationCostInsightIterator(page ResponseWithContinuationCostInsightPage) ResponseWithContinuationCostInsightIterator {
2213 return ResponseWithContinuationCostInsightIterator{page: page}
2214 }
2215
2216
2217 func (rwcCi ResponseWithContinuationCostInsight) IsEmpty() bool {
2218 return rwcCi.Value == nil || len(*rwcCi.Value) == 0
2219 }
2220
2221
2222 func (rwcCi ResponseWithContinuationCostInsight) hasNextLink() bool {
2223 return rwcCi.NextLink != nil && len(*rwcCi.NextLink) != 0
2224 }
2225
2226
2227
2228 func (rwcCi ResponseWithContinuationCostInsight) responseWithContinuationCostInsightPreparer(ctx context.Context) (*http.Request, error) {
2229 if !rwcCi.hasNextLink() {
2230 return nil, nil
2231 }
2232 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2233 autorest.AsJSON(),
2234 autorest.AsGet(),
2235 autorest.WithBaseURL(to.String(rwcCi.NextLink)))
2236 }
2237
2238
2239 type ResponseWithContinuationCostInsightPage struct {
2240 fn func(context.Context, ResponseWithContinuationCostInsight) (ResponseWithContinuationCostInsight, error)
2241 rwcci ResponseWithContinuationCostInsight
2242 }
2243
2244
2245
2246 func (page *ResponseWithContinuationCostInsightPage) NextWithContext(ctx context.Context) (err error) {
2247 if tracing.IsEnabled() {
2248 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationCostInsightPage.NextWithContext")
2249 defer func() {
2250 sc := -1
2251 if page.Response().Response.Response != nil {
2252 sc = page.Response().Response.Response.StatusCode
2253 }
2254 tracing.EndSpan(ctx, sc, err)
2255 }()
2256 }
2257 for {
2258 next, err := page.fn(ctx, page.rwcci)
2259 if err != nil {
2260 return err
2261 }
2262 page.rwcci = next
2263 if !next.hasNextLink() || !next.IsEmpty() {
2264 break
2265 }
2266 }
2267 return nil
2268 }
2269
2270
2271
2272
2273 func (page *ResponseWithContinuationCostInsightPage) Next() error {
2274 return page.NextWithContext(context.Background())
2275 }
2276
2277
2278 func (page ResponseWithContinuationCostInsightPage) NotDone() bool {
2279 return !page.rwcci.IsEmpty()
2280 }
2281
2282
2283 func (page ResponseWithContinuationCostInsightPage) Response() ResponseWithContinuationCostInsight {
2284 return page.rwcci
2285 }
2286
2287
2288 func (page ResponseWithContinuationCostInsightPage) Values() []CostInsight {
2289 if page.rwcci.IsEmpty() {
2290 return nil
2291 }
2292 return *page.rwcci.Value
2293 }
2294
2295
2296 func NewResponseWithContinuationCostInsightPage(cur ResponseWithContinuationCostInsight, getNextPage func(context.Context, ResponseWithContinuationCostInsight) (ResponseWithContinuationCostInsight, error)) ResponseWithContinuationCostInsightPage {
2297 return ResponseWithContinuationCostInsightPage{
2298 fn: getNextPage,
2299 rwcci: cur,
2300 }
2301 }
2302
2303
2304 type ResponseWithContinuationCostIterator struct {
2305 i int
2306 page ResponseWithContinuationCostPage
2307 }
2308
2309
2310
2311 func (iter *ResponseWithContinuationCostIterator) NextWithContext(ctx context.Context) (err error) {
2312 if tracing.IsEnabled() {
2313 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationCostIterator.NextWithContext")
2314 defer func() {
2315 sc := -1
2316 if iter.Response().Response.Response != nil {
2317 sc = iter.Response().Response.Response.StatusCode
2318 }
2319 tracing.EndSpan(ctx, sc, err)
2320 }()
2321 }
2322 iter.i++
2323 if iter.i < len(iter.page.Values()) {
2324 return nil
2325 }
2326 err = iter.page.NextWithContext(ctx)
2327 if err != nil {
2328 iter.i--
2329 return err
2330 }
2331 iter.i = 0
2332 return nil
2333 }
2334
2335
2336
2337
2338 func (iter *ResponseWithContinuationCostIterator) Next() error {
2339 return iter.NextWithContext(context.Background())
2340 }
2341
2342
2343 func (iter ResponseWithContinuationCostIterator) NotDone() bool {
2344 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2345 }
2346
2347
2348 func (iter ResponseWithContinuationCostIterator) Response() ResponseWithContinuationCost {
2349 return iter.page.Response()
2350 }
2351
2352
2353
2354 func (iter ResponseWithContinuationCostIterator) Value() Cost {
2355 if !iter.page.NotDone() {
2356 return Cost{}
2357 }
2358 return iter.page.Values()[iter.i]
2359 }
2360
2361
2362 func NewResponseWithContinuationCostIterator(page ResponseWithContinuationCostPage) ResponseWithContinuationCostIterator {
2363 return ResponseWithContinuationCostIterator{page: page}
2364 }
2365
2366
2367 func (rwcC ResponseWithContinuationCost) IsEmpty() bool {
2368 return rwcC.Value == nil || len(*rwcC.Value) == 0
2369 }
2370
2371
2372 func (rwcC ResponseWithContinuationCost) hasNextLink() bool {
2373 return rwcC.NextLink != nil && len(*rwcC.NextLink) != 0
2374 }
2375
2376
2377
2378 func (rwcC ResponseWithContinuationCost) responseWithContinuationCostPreparer(ctx context.Context) (*http.Request, error) {
2379 if !rwcC.hasNextLink() {
2380 return nil, nil
2381 }
2382 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2383 autorest.AsJSON(),
2384 autorest.AsGet(),
2385 autorest.WithBaseURL(to.String(rwcC.NextLink)))
2386 }
2387
2388
2389 type ResponseWithContinuationCostPage struct {
2390 fn func(context.Context, ResponseWithContinuationCost) (ResponseWithContinuationCost, error)
2391 rwcc ResponseWithContinuationCost
2392 }
2393
2394
2395
2396 func (page *ResponseWithContinuationCostPage) NextWithContext(ctx context.Context) (err error) {
2397 if tracing.IsEnabled() {
2398 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationCostPage.NextWithContext")
2399 defer func() {
2400 sc := -1
2401 if page.Response().Response.Response != nil {
2402 sc = page.Response().Response.Response.StatusCode
2403 }
2404 tracing.EndSpan(ctx, sc, err)
2405 }()
2406 }
2407 for {
2408 next, err := page.fn(ctx, page.rwcc)
2409 if err != nil {
2410 return err
2411 }
2412 page.rwcc = next
2413 if !next.hasNextLink() || !next.IsEmpty() {
2414 break
2415 }
2416 }
2417 return nil
2418 }
2419
2420
2421
2422
2423 func (page *ResponseWithContinuationCostPage) Next() error {
2424 return page.NextWithContext(context.Background())
2425 }
2426
2427
2428 func (page ResponseWithContinuationCostPage) NotDone() bool {
2429 return !page.rwcc.IsEmpty()
2430 }
2431
2432
2433 func (page ResponseWithContinuationCostPage) Response() ResponseWithContinuationCost {
2434 return page.rwcc
2435 }
2436
2437
2438 func (page ResponseWithContinuationCostPage) Values() []Cost {
2439 if page.rwcc.IsEmpty() {
2440 return nil
2441 }
2442 return *page.rwcc.Value
2443 }
2444
2445
2446 func NewResponseWithContinuationCostPage(cur ResponseWithContinuationCost, getNextPage func(context.Context, ResponseWithContinuationCost) (ResponseWithContinuationCost, error)) ResponseWithContinuationCostPage {
2447 return ResponseWithContinuationCostPage{
2448 fn: getNextPage,
2449 rwcc: cur,
2450 }
2451 }
2452
2453
2454 type ResponseWithContinuationCustomImage struct {
2455 autorest.Response `json:"-"`
2456
2457 Value *[]CustomImage `json:"value,omitempty"`
2458
2459 NextLink *string `json:"nextLink,omitempty"`
2460 }
2461
2462
2463 type ResponseWithContinuationCustomImageIterator struct {
2464 i int
2465 page ResponseWithContinuationCustomImagePage
2466 }
2467
2468
2469
2470 func (iter *ResponseWithContinuationCustomImageIterator) NextWithContext(ctx context.Context) (err error) {
2471 if tracing.IsEnabled() {
2472 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationCustomImageIterator.NextWithContext")
2473 defer func() {
2474 sc := -1
2475 if iter.Response().Response.Response != nil {
2476 sc = iter.Response().Response.Response.StatusCode
2477 }
2478 tracing.EndSpan(ctx, sc, err)
2479 }()
2480 }
2481 iter.i++
2482 if iter.i < len(iter.page.Values()) {
2483 return nil
2484 }
2485 err = iter.page.NextWithContext(ctx)
2486 if err != nil {
2487 iter.i--
2488 return err
2489 }
2490 iter.i = 0
2491 return nil
2492 }
2493
2494
2495
2496
2497 func (iter *ResponseWithContinuationCustomImageIterator) Next() error {
2498 return iter.NextWithContext(context.Background())
2499 }
2500
2501
2502 func (iter ResponseWithContinuationCustomImageIterator) NotDone() bool {
2503 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2504 }
2505
2506
2507 func (iter ResponseWithContinuationCustomImageIterator) Response() ResponseWithContinuationCustomImage {
2508 return iter.page.Response()
2509 }
2510
2511
2512
2513 func (iter ResponseWithContinuationCustomImageIterator) Value() CustomImage {
2514 if !iter.page.NotDone() {
2515 return CustomImage{}
2516 }
2517 return iter.page.Values()[iter.i]
2518 }
2519
2520
2521 func NewResponseWithContinuationCustomImageIterator(page ResponseWithContinuationCustomImagePage) ResponseWithContinuationCustomImageIterator {
2522 return ResponseWithContinuationCustomImageIterator{page: page}
2523 }
2524
2525
2526 func (rwcCi ResponseWithContinuationCustomImage) IsEmpty() bool {
2527 return rwcCi.Value == nil || len(*rwcCi.Value) == 0
2528 }
2529
2530
2531 func (rwcCi ResponseWithContinuationCustomImage) hasNextLink() bool {
2532 return rwcCi.NextLink != nil && len(*rwcCi.NextLink) != 0
2533 }
2534
2535
2536
2537 func (rwcCi ResponseWithContinuationCustomImage) responseWithContinuationCustomImagePreparer(ctx context.Context) (*http.Request, error) {
2538 if !rwcCi.hasNextLink() {
2539 return nil, nil
2540 }
2541 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2542 autorest.AsJSON(),
2543 autorest.AsGet(),
2544 autorest.WithBaseURL(to.String(rwcCi.NextLink)))
2545 }
2546
2547
2548 type ResponseWithContinuationCustomImagePage struct {
2549 fn func(context.Context, ResponseWithContinuationCustomImage) (ResponseWithContinuationCustomImage, error)
2550 rwcci ResponseWithContinuationCustomImage
2551 }
2552
2553
2554
2555 func (page *ResponseWithContinuationCustomImagePage) NextWithContext(ctx context.Context) (err error) {
2556 if tracing.IsEnabled() {
2557 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationCustomImagePage.NextWithContext")
2558 defer func() {
2559 sc := -1
2560 if page.Response().Response.Response != nil {
2561 sc = page.Response().Response.Response.StatusCode
2562 }
2563 tracing.EndSpan(ctx, sc, err)
2564 }()
2565 }
2566 for {
2567 next, err := page.fn(ctx, page.rwcci)
2568 if err != nil {
2569 return err
2570 }
2571 page.rwcci = next
2572 if !next.hasNextLink() || !next.IsEmpty() {
2573 break
2574 }
2575 }
2576 return nil
2577 }
2578
2579
2580
2581
2582 func (page *ResponseWithContinuationCustomImagePage) Next() error {
2583 return page.NextWithContext(context.Background())
2584 }
2585
2586
2587 func (page ResponseWithContinuationCustomImagePage) NotDone() bool {
2588 return !page.rwcci.IsEmpty()
2589 }
2590
2591
2592 func (page ResponseWithContinuationCustomImagePage) Response() ResponseWithContinuationCustomImage {
2593 return page.rwcci
2594 }
2595
2596
2597 func (page ResponseWithContinuationCustomImagePage) Values() []CustomImage {
2598 if page.rwcci.IsEmpty() {
2599 return nil
2600 }
2601 return *page.rwcci.Value
2602 }
2603
2604
2605 func NewResponseWithContinuationCustomImagePage(cur ResponseWithContinuationCustomImage, getNextPage func(context.Context, ResponseWithContinuationCustomImage) (ResponseWithContinuationCustomImage, error)) ResponseWithContinuationCustomImagePage {
2606 return ResponseWithContinuationCustomImagePage{
2607 fn: getNextPage,
2608 rwcci: cur,
2609 }
2610 }
2611
2612
2613 type ResponseWithContinuationFormula struct {
2614 autorest.Response `json:"-"`
2615
2616 Value *[]Formula `json:"value,omitempty"`
2617
2618 NextLink *string `json:"nextLink,omitempty"`
2619 }
2620
2621
2622 type ResponseWithContinuationFormulaIterator struct {
2623 i int
2624 page ResponseWithContinuationFormulaPage
2625 }
2626
2627
2628
2629 func (iter *ResponseWithContinuationFormulaIterator) NextWithContext(ctx context.Context) (err error) {
2630 if tracing.IsEnabled() {
2631 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationFormulaIterator.NextWithContext")
2632 defer func() {
2633 sc := -1
2634 if iter.Response().Response.Response != nil {
2635 sc = iter.Response().Response.Response.StatusCode
2636 }
2637 tracing.EndSpan(ctx, sc, err)
2638 }()
2639 }
2640 iter.i++
2641 if iter.i < len(iter.page.Values()) {
2642 return nil
2643 }
2644 err = iter.page.NextWithContext(ctx)
2645 if err != nil {
2646 iter.i--
2647 return err
2648 }
2649 iter.i = 0
2650 return nil
2651 }
2652
2653
2654
2655
2656 func (iter *ResponseWithContinuationFormulaIterator) Next() error {
2657 return iter.NextWithContext(context.Background())
2658 }
2659
2660
2661 func (iter ResponseWithContinuationFormulaIterator) NotDone() bool {
2662 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2663 }
2664
2665
2666 func (iter ResponseWithContinuationFormulaIterator) Response() ResponseWithContinuationFormula {
2667 return iter.page.Response()
2668 }
2669
2670
2671
2672 func (iter ResponseWithContinuationFormulaIterator) Value() Formula {
2673 if !iter.page.NotDone() {
2674 return Formula{}
2675 }
2676 return iter.page.Values()[iter.i]
2677 }
2678
2679
2680 func NewResponseWithContinuationFormulaIterator(page ResponseWithContinuationFormulaPage) ResponseWithContinuationFormulaIterator {
2681 return ResponseWithContinuationFormulaIterator{page: page}
2682 }
2683
2684
2685 func (rwcF ResponseWithContinuationFormula) IsEmpty() bool {
2686 return rwcF.Value == nil || len(*rwcF.Value) == 0
2687 }
2688
2689
2690 func (rwcF ResponseWithContinuationFormula) hasNextLink() bool {
2691 return rwcF.NextLink != nil && len(*rwcF.NextLink) != 0
2692 }
2693
2694
2695
2696 func (rwcF ResponseWithContinuationFormula) responseWithContinuationFormulaPreparer(ctx context.Context) (*http.Request, error) {
2697 if !rwcF.hasNextLink() {
2698 return nil, nil
2699 }
2700 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2701 autorest.AsJSON(),
2702 autorest.AsGet(),
2703 autorest.WithBaseURL(to.String(rwcF.NextLink)))
2704 }
2705
2706
2707 type ResponseWithContinuationFormulaPage struct {
2708 fn func(context.Context, ResponseWithContinuationFormula) (ResponseWithContinuationFormula, error)
2709 rwcf ResponseWithContinuationFormula
2710 }
2711
2712
2713
2714 func (page *ResponseWithContinuationFormulaPage) NextWithContext(ctx context.Context) (err error) {
2715 if tracing.IsEnabled() {
2716 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationFormulaPage.NextWithContext")
2717 defer func() {
2718 sc := -1
2719 if page.Response().Response.Response != nil {
2720 sc = page.Response().Response.Response.StatusCode
2721 }
2722 tracing.EndSpan(ctx, sc, err)
2723 }()
2724 }
2725 for {
2726 next, err := page.fn(ctx, page.rwcf)
2727 if err != nil {
2728 return err
2729 }
2730 page.rwcf = next
2731 if !next.hasNextLink() || !next.IsEmpty() {
2732 break
2733 }
2734 }
2735 return nil
2736 }
2737
2738
2739
2740
2741 func (page *ResponseWithContinuationFormulaPage) Next() error {
2742 return page.NextWithContext(context.Background())
2743 }
2744
2745
2746 func (page ResponseWithContinuationFormulaPage) NotDone() bool {
2747 return !page.rwcf.IsEmpty()
2748 }
2749
2750
2751 func (page ResponseWithContinuationFormulaPage) Response() ResponseWithContinuationFormula {
2752 return page.rwcf
2753 }
2754
2755
2756 func (page ResponseWithContinuationFormulaPage) Values() []Formula {
2757 if page.rwcf.IsEmpty() {
2758 return nil
2759 }
2760 return *page.rwcf.Value
2761 }
2762
2763
2764 func NewResponseWithContinuationFormulaPage(cur ResponseWithContinuationFormula, getNextPage func(context.Context, ResponseWithContinuationFormula) (ResponseWithContinuationFormula, error)) ResponseWithContinuationFormulaPage {
2765 return ResponseWithContinuationFormulaPage{
2766 fn: getNextPage,
2767 rwcf: cur,
2768 }
2769 }
2770
2771
2772 type ResponseWithContinuationGalleryImage struct {
2773 autorest.Response `json:"-"`
2774
2775 Value *[]GalleryImage `json:"value,omitempty"`
2776
2777 NextLink *string `json:"nextLink,omitempty"`
2778 }
2779
2780
2781
2782 type ResponseWithContinuationGalleryImageIterator struct {
2783 i int
2784 page ResponseWithContinuationGalleryImagePage
2785 }
2786
2787
2788
2789 func (iter *ResponseWithContinuationGalleryImageIterator) NextWithContext(ctx context.Context) (err error) {
2790 if tracing.IsEnabled() {
2791 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationGalleryImageIterator.NextWithContext")
2792 defer func() {
2793 sc := -1
2794 if iter.Response().Response.Response != nil {
2795 sc = iter.Response().Response.Response.StatusCode
2796 }
2797 tracing.EndSpan(ctx, sc, err)
2798 }()
2799 }
2800 iter.i++
2801 if iter.i < len(iter.page.Values()) {
2802 return nil
2803 }
2804 err = iter.page.NextWithContext(ctx)
2805 if err != nil {
2806 iter.i--
2807 return err
2808 }
2809 iter.i = 0
2810 return nil
2811 }
2812
2813
2814
2815
2816 func (iter *ResponseWithContinuationGalleryImageIterator) Next() error {
2817 return iter.NextWithContext(context.Background())
2818 }
2819
2820
2821 func (iter ResponseWithContinuationGalleryImageIterator) NotDone() bool {
2822 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2823 }
2824
2825
2826 func (iter ResponseWithContinuationGalleryImageIterator) Response() ResponseWithContinuationGalleryImage {
2827 return iter.page.Response()
2828 }
2829
2830
2831
2832 func (iter ResponseWithContinuationGalleryImageIterator) Value() GalleryImage {
2833 if !iter.page.NotDone() {
2834 return GalleryImage{}
2835 }
2836 return iter.page.Values()[iter.i]
2837 }
2838
2839
2840 func NewResponseWithContinuationGalleryImageIterator(page ResponseWithContinuationGalleryImagePage) ResponseWithContinuationGalleryImageIterator {
2841 return ResponseWithContinuationGalleryImageIterator{page: page}
2842 }
2843
2844
2845 func (rwcGi ResponseWithContinuationGalleryImage) IsEmpty() bool {
2846 return rwcGi.Value == nil || len(*rwcGi.Value) == 0
2847 }
2848
2849
2850 func (rwcGi ResponseWithContinuationGalleryImage) hasNextLink() bool {
2851 return rwcGi.NextLink != nil && len(*rwcGi.NextLink) != 0
2852 }
2853
2854
2855
2856 func (rwcGi ResponseWithContinuationGalleryImage) responseWithContinuationGalleryImagePreparer(ctx context.Context) (*http.Request, error) {
2857 if !rwcGi.hasNextLink() {
2858 return nil, nil
2859 }
2860 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2861 autorest.AsJSON(),
2862 autorest.AsGet(),
2863 autorest.WithBaseURL(to.String(rwcGi.NextLink)))
2864 }
2865
2866
2867 type ResponseWithContinuationGalleryImagePage struct {
2868 fn func(context.Context, ResponseWithContinuationGalleryImage) (ResponseWithContinuationGalleryImage, error)
2869 rwcgi ResponseWithContinuationGalleryImage
2870 }
2871
2872
2873
2874 func (page *ResponseWithContinuationGalleryImagePage) NextWithContext(ctx context.Context) (err error) {
2875 if tracing.IsEnabled() {
2876 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationGalleryImagePage.NextWithContext")
2877 defer func() {
2878 sc := -1
2879 if page.Response().Response.Response != nil {
2880 sc = page.Response().Response.Response.StatusCode
2881 }
2882 tracing.EndSpan(ctx, sc, err)
2883 }()
2884 }
2885 for {
2886 next, err := page.fn(ctx, page.rwcgi)
2887 if err != nil {
2888 return err
2889 }
2890 page.rwcgi = next
2891 if !next.hasNextLink() || !next.IsEmpty() {
2892 break
2893 }
2894 }
2895 return nil
2896 }
2897
2898
2899
2900
2901 func (page *ResponseWithContinuationGalleryImagePage) Next() error {
2902 return page.NextWithContext(context.Background())
2903 }
2904
2905
2906 func (page ResponseWithContinuationGalleryImagePage) NotDone() bool {
2907 return !page.rwcgi.IsEmpty()
2908 }
2909
2910
2911 func (page ResponseWithContinuationGalleryImagePage) Response() ResponseWithContinuationGalleryImage {
2912 return page.rwcgi
2913 }
2914
2915
2916 func (page ResponseWithContinuationGalleryImagePage) Values() []GalleryImage {
2917 if page.rwcgi.IsEmpty() {
2918 return nil
2919 }
2920 return *page.rwcgi.Value
2921 }
2922
2923
2924 func NewResponseWithContinuationGalleryImagePage(cur ResponseWithContinuationGalleryImage, getNextPage func(context.Context, ResponseWithContinuationGalleryImage) (ResponseWithContinuationGalleryImage, error)) ResponseWithContinuationGalleryImagePage {
2925 return ResponseWithContinuationGalleryImagePage{
2926 fn: getNextPage,
2927 rwcgi: cur,
2928 }
2929 }
2930
2931
2932 type ResponseWithContinuationLab struct {
2933 autorest.Response `json:"-"`
2934
2935 Value *[]Lab `json:"value,omitempty"`
2936
2937 NextLink *string `json:"nextLink,omitempty"`
2938 }
2939
2940
2941 type ResponseWithContinuationLabIterator struct {
2942 i int
2943 page ResponseWithContinuationLabPage
2944 }
2945
2946
2947
2948 func (iter *ResponseWithContinuationLabIterator) NextWithContext(ctx context.Context) (err error) {
2949 if tracing.IsEnabled() {
2950 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabIterator.NextWithContext")
2951 defer func() {
2952 sc := -1
2953 if iter.Response().Response.Response != nil {
2954 sc = iter.Response().Response.Response.StatusCode
2955 }
2956 tracing.EndSpan(ctx, sc, err)
2957 }()
2958 }
2959 iter.i++
2960 if iter.i < len(iter.page.Values()) {
2961 return nil
2962 }
2963 err = iter.page.NextWithContext(ctx)
2964 if err != nil {
2965 iter.i--
2966 return err
2967 }
2968 iter.i = 0
2969 return nil
2970 }
2971
2972
2973
2974
2975 func (iter *ResponseWithContinuationLabIterator) Next() error {
2976 return iter.NextWithContext(context.Background())
2977 }
2978
2979
2980 func (iter ResponseWithContinuationLabIterator) NotDone() bool {
2981 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2982 }
2983
2984
2985 func (iter ResponseWithContinuationLabIterator) Response() ResponseWithContinuationLab {
2986 return iter.page.Response()
2987 }
2988
2989
2990
2991 func (iter ResponseWithContinuationLabIterator) Value() Lab {
2992 if !iter.page.NotDone() {
2993 return Lab{}
2994 }
2995 return iter.page.Values()[iter.i]
2996 }
2997
2998
2999 func NewResponseWithContinuationLabIterator(page ResponseWithContinuationLabPage) ResponseWithContinuationLabIterator {
3000 return ResponseWithContinuationLabIterator{page: page}
3001 }
3002
3003
3004 func (rwcL ResponseWithContinuationLab) IsEmpty() bool {
3005 return rwcL.Value == nil || len(*rwcL.Value) == 0
3006 }
3007
3008
3009 func (rwcL ResponseWithContinuationLab) hasNextLink() bool {
3010 return rwcL.NextLink != nil && len(*rwcL.NextLink) != 0
3011 }
3012
3013
3014
3015 func (rwcL ResponseWithContinuationLab) responseWithContinuationLabPreparer(ctx context.Context) (*http.Request, error) {
3016 if !rwcL.hasNextLink() {
3017 return nil, nil
3018 }
3019 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3020 autorest.AsJSON(),
3021 autorest.AsGet(),
3022 autorest.WithBaseURL(to.String(rwcL.NextLink)))
3023 }
3024
3025
3026 type ResponseWithContinuationLabPage struct {
3027 fn func(context.Context, ResponseWithContinuationLab) (ResponseWithContinuationLab, error)
3028 rwcl ResponseWithContinuationLab
3029 }
3030
3031
3032
3033 func (page *ResponseWithContinuationLabPage) NextWithContext(ctx context.Context) (err error) {
3034 if tracing.IsEnabled() {
3035 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabPage.NextWithContext")
3036 defer func() {
3037 sc := -1
3038 if page.Response().Response.Response != nil {
3039 sc = page.Response().Response.Response.StatusCode
3040 }
3041 tracing.EndSpan(ctx, sc, err)
3042 }()
3043 }
3044 for {
3045 next, err := page.fn(ctx, page.rwcl)
3046 if err != nil {
3047 return err
3048 }
3049 page.rwcl = next
3050 if !next.hasNextLink() || !next.IsEmpty() {
3051 break
3052 }
3053 }
3054 return nil
3055 }
3056
3057
3058
3059
3060 func (page *ResponseWithContinuationLabPage) Next() error {
3061 return page.NextWithContext(context.Background())
3062 }
3063
3064
3065 func (page ResponseWithContinuationLabPage) NotDone() bool {
3066 return !page.rwcl.IsEmpty()
3067 }
3068
3069
3070 func (page ResponseWithContinuationLabPage) Response() ResponseWithContinuationLab {
3071 return page.rwcl
3072 }
3073
3074
3075 func (page ResponseWithContinuationLabPage) Values() []Lab {
3076 if page.rwcl.IsEmpty() {
3077 return nil
3078 }
3079 return *page.rwcl.Value
3080 }
3081
3082
3083 func NewResponseWithContinuationLabPage(cur ResponseWithContinuationLab, getNextPage func(context.Context, ResponseWithContinuationLab) (ResponseWithContinuationLab, error)) ResponseWithContinuationLabPage {
3084 return ResponseWithContinuationLabPage{
3085 fn: getNextPage,
3086 rwcl: cur,
3087 }
3088 }
3089
3090
3091 type ResponseWithContinuationLabVhd struct {
3092 autorest.Response `json:"-"`
3093
3094 Value *[]LabVhd `json:"value,omitempty"`
3095
3096 NextLink *string `json:"nextLink,omitempty"`
3097 }
3098
3099
3100 type ResponseWithContinuationLabVhdIterator struct {
3101 i int
3102 page ResponseWithContinuationLabVhdPage
3103 }
3104
3105
3106
3107 func (iter *ResponseWithContinuationLabVhdIterator) NextWithContext(ctx context.Context) (err error) {
3108 if tracing.IsEnabled() {
3109 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabVhdIterator.NextWithContext")
3110 defer func() {
3111 sc := -1
3112 if iter.Response().Response.Response != nil {
3113 sc = iter.Response().Response.Response.StatusCode
3114 }
3115 tracing.EndSpan(ctx, sc, err)
3116 }()
3117 }
3118 iter.i++
3119 if iter.i < len(iter.page.Values()) {
3120 return nil
3121 }
3122 err = iter.page.NextWithContext(ctx)
3123 if err != nil {
3124 iter.i--
3125 return err
3126 }
3127 iter.i = 0
3128 return nil
3129 }
3130
3131
3132
3133
3134 func (iter *ResponseWithContinuationLabVhdIterator) Next() error {
3135 return iter.NextWithContext(context.Background())
3136 }
3137
3138
3139 func (iter ResponseWithContinuationLabVhdIterator) NotDone() bool {
3140 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3141 }
3142
3143
3144 func (iter ResponseWithContinuationLabVhdIterator) Response() ResponseWithContinuationLabVhd {
3145 return iter.page.Response()
3146 }
3147
3148
3149
3150 func (iter ResponseWithContinuationLabVhdIterator) Value() LabVhd {
3151 if !iter.page.NotDone() {
3152 return LabVhd{}
3153 }
3154 return iter.page.Values()[iter.i]
3155 }
3156
3157
3158 func NewResponseWithContinuationLabVhdIterator(page ResponseWithContinuationLabVhdPage) ResponseWithContinuationLabVhdIterator {
3159 return ResponseWithContinuationLabVhdIterator{page: page}
3160 }
3161
3162
3163 func (rwcLv ResponseWithContinuationLabVhd) IsEmpty() bool {
3164 return rwcLv.Value == nil || len(*rwcLv.Value) == 0
3165 }
3166
3167
3168 func (rwcLv ResponseWithContinuationLabVhd) hasNextLink() bool {
3169 return rwcLv.NextLink != nil && len(*rwcLv.NextLink) != 0
3170 }
3171
3172
3173
3174 func (rwcLv ResponseWithContinuationLabVhd) responseWithContinuationLabVhdPreparer(ctx context.Context) (*http.Request, error) {
3175 if !rwcLv.hasNextLink() {
3176 return nil, nil
3177 }
3178 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3179 autorest.AsJSON(),
3180 autorest.AsGet(),
3181 autorest.WithBaseURL(to.String(rwcLv.NextLink)))
3182 }
3183
3184
3185 type ResponseWithContinuationLabVhdPage struct {
3186 fn func(context.Context, ResponseWithContinuationLabVhd) (ResponseWithContinuationLabVhd, error)
3187 rwclv ResponseWithContinuationLabVhd
3188 }
3189
3190
3191
3192 func (page *ResponseWithContinuationLabVhdPage) NextWithContext(ctx context.Context) (err error) {
3193 if tracing.IsEnabled() {
3194 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabVhdPage.NextWithContext")
3195 defer func() {
3196 sc := -1
3197 if page.Response().Response.Response != nil {
3198 sc = page.Response().Response.Response.StatusCode
3199 }
3200 tracing.EndSpan(ctx, sc, err)
3201 }()
3202 }
3203 for {
3204 next, err := page.fn(ctx, page.rwclv)
3205 if err != nil {
3206 return err
3207 }
3208 page.rwclv = next
3209 if !next.hasNextLink() || !next.IsEmpty() {
3210 break
3211 }
3212 }
3213 return nil
3214 }
3215
3216
3217
3218
3219 func (page *ResponseWithContinuationLabVhdPage) Next() error {
3220 return page.NextWithContext(context.Background())
3221 }
3222
3223
3224 func (page ResponseWithContinuationLabVhdPage) NotDone() bool {
3225 return !page.rwclv.IsEmpty()
3226 }
3227
3228
3229 func (page ResponseWithContinuationLabVhdPage) Response() ResponseWithContinuationLabVhd {
3230 return page.rwclv
3231 }
3232
3233
3234 func (page ResponseWithContinuationLabVhdPage) Values() []LabVhd {
3235 if page.rwclv.IsEmpty() {
3236 return nil
3237 }
3238 return *page.rwclv.Value
3239 }
3240
3241
3242 func NewResponseWithContinuationLabVhdPage(cur ResponseWithContinuationLabVhd, getNextPage func(context.Context, ResponseWithContinuationLabVhd) (ResponseWithContinuationLabVhd, error)) ResponseWithContinuationLabVhdPage {
3243 return ResponseWithContinuationLabVhdPage{
3244 fn: getNextPage,
3245 rwclv: cur,
3246 }
3247 }
3248
3249
3250 type ResponseWithContinuationLabVirtualMachine struct {
3251 autorest.Response `json:"-"`
3252
3253 Value *[]LabVirtualMachine `json:"value,omitempty"`
3254
3255 NextLink *string `json:"nextLink,omitempty"`
3256 }
3257
3258
3259
3260 type ResponseWithContinuationLabVirtualMachineIterator struct {
3261 i int
3262 page ResponseWithContinuationLabVirtualMachinePage
3263 }
3264
3265
3266
3267 func (iter *ResponseWithContinuationLabVirtualMachineIterator) NextWithContext(ctx context.Context) (err error) {
3268 if tracing.IsEnabled() {
3269 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabVirtualMachineIterator.NextWithContext")
3270 defer func() {
3271 sc := -1
3272 if iter.Response().Response.Response != nil {
3273 sc = iter.Response().Response.Response.StatusCode
3274 }
3275 tracing.EndSpan(ctx, sc, err)
3276 }()
3277 }
3278 iter.i++
3279 if iter.i < len(iter.page.Values()) {
3280 return nil
3281 }
3282 err = iter.page.NextWithContext(ctx)
3283 if err != nil {
3284 iter.i--
3285 return err
3286 }
3287 iter.i = 0
3288 return nil
3289 }
3290
3291
3292
3293
3294 func (iter *ResponseWithContinuationLabVirtualMachineIterator) Next() error {
3295 return iter.NextWithContext(context.Background())
3296 }
3297
3298
3299 func (iter ResponseWithContinuationLabVirtualMachineIterator) NotDone() bool {
3300 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3301 }
3302
3303
3304 func (iter ResponseWithContinuationLabVirtualMachineIterator) Response() ResponseWithContinuationLabVirtualMachine {
3305 return iter.page.Response()
3306 }
3307
3308
3309
3310 func (iter ResponseWithContinuationLabVirtualMachineIterator) Value() LabVirtualMachine {
3311 if !iter.page.NotDone() {
3312 return LabVirtualMachine{}
3313 }
3314 return iter.page.Values()[iter.i]
3315 }
3316
3317
3318 func NewResponseWithContinuationLabVirtualMachineIterator(page ResponseWithContinuationLabVirtualMachinePage) ResponseWithContinuationLabVirtualMachineIterator {
3319 return ResponseWithContinuationLabVirtualMachineIterator{page: page}
3320 }
3321
3322
3323 func (rwcLvm ResponseWithContinuationLabVirtualMachine) IsEmpty() bool {
3324 return rwcLvm.Value == nil || len(*rwcLvm.Value) == 0
3325 }
3326
3327
3328 func (rwcLvm ResponseWithContinuationLabVirtualMachine) hasNextLink() bool {
3329 return rwcLvm.NextLink != nil && len(*rwcLvm.NextLink) != 0
3330 }
3331
3332
3333
3334 func (rwcLvm ResponseWithContinuationLabVirtualMachine) responseWithContinuationLabVirtualMachinePreparer(ctx context.Context) (*http.Request, error) {
3335 if !rwcLvm.hasNextLink() {
3336 return nil, nil
3337 }
3338 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3339 autorest.AsJSON(),
3340 autorest.AsGet(),
3341 autorest.WithBaseURL(to.String(rwcLvm.NextLink)))
3342 }
3343
3344
3345 type ResponseWithContinuationLabVirtualMachinePage struct {
3346 fn func(context.Context, ResponseWithContinuationLabVirtualMachine) (ResponseWithContinuationLabVirtualMachine, error)
3347 rwclvm ResponseWithContinuationLabVirtualMachine
3348 }
3349
3350
3351
3352 func (page *ResponseWithContinuationLabVirtualMachinePage) NextWithContext(ctx context.Context) (err error) {
3353 if tracing.IsEnabled() {
3354 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabVirtualMachinePage.NextWithContext")
3355 defer func() {
3356 sc := -1
3357 if page.Response().Response.Response != nil {
3358 sc = page.Response().Response.Response.StatusCode
3359 }
3360 tracing.EndSpan(ctx, sc, err)
3361 }()
3362 }
3363 for {
3364 next, err := page.fn(ctx, page.rwclvm)
3365 if err != nil {
3366 return err
3367 }
3368 page.rwclvm = next
3369 if !next.hasNextLink() || !next.IsEmpty() {
3370 break
3371 }
3372 }
3373 return nil
3374 }
3375
3376
3377
3378
3379 func (page *ResponseWithContinuationLabVirtualMachinePage) Next() error {
3380 return page.NextWithContext(context.Background())
3381 }
3382
3383
3384 func (page ResponseWithContinuationLabVirtualMachinePage) NotDone() bool {
3385 return !page.rwclvm.IsEmpty()
3386 }
3387
3388
3389 func (page ResponseWithContinuationLabVirtualMachinePage) Response() ResponseWithContinuationLabVirtualMachine {
3390 return page.rwclvm
3391 }
3392
3393
3394 func (page ResponseWithContinuationLabVirtualMachinePage) Values() []LabVirtualMachine {
3395 if page.rwclvm.IsEmpty() {
3396 return nil
3397 }
3398 return *page.rwclvm.Value
3399 }
3400
3401
3402 func NewResponseWithContinuationLabVirtualMachinePage(cur ResponseWithContinuationLabVirtualMachine, getNextPage func(context.Context, ResponseWithContinuationLabVirtualMachine) (ResponseWithContinuationLabVirtualMachine, error)) ResponseWithContinuationLabVirtualMachinePage {
3403 return ResponseWithContinuationLabVirtualMachinePage{
3404 fn: getNextPage,
3405 rwclvm: cur,
3406 }
3407 }
3408
3409
3410 type ResponseWithContinuationPolicy struct {
3411 autorest.Response `json:"-"`
3412
3413 Value *[]Policy `json:"value,omitempty"`
3414
3415 NextLink *string `json:"nextLink,omitempty"`
3416 }
3417
3418
3419 type ResponseWithContinuationPolicyIterator struct {
3420 i int
3421 page ResponseWithContinuationPolicyPage
3422 }
3423
3424
3425
3426 func (iter *ResponseWithContinuationPolicyIterator) NextWithContext(ctx context.Context) (err error) {
3427 if tracing.IsEnabled() {
3428 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationPolicyIterator.NextWithContext")
3429 defer func() {
3430 sc := -1
3431 if iter.Response().Response.Response != nil {
3432 sc = iter.Response().Response.Response.StatusCode
3433 }
3434 tracing.EndSpan(ctx, sc, err)
3435 }()
3436 }
3437 iter.i++
3438 if iter.i < len(iter.page.Values()) {
3439 return nil
3440 }
3441 err = iter.page.NextWithContext(ctx)
3442 if err != nil {
3443 iter.i--
3444 return err
3445 }
3446 iter.i = 0
3447 return nil
3448 }
3449
3450
3451
3452
3453 func (iter *ResponseWithContinuationPolicyIterator) Next() error {
3454 return iter.NextWithContext(context.Background())
3455 }
3456
3457
3458 func (iter ResponseWithContinuationPolicyIterator) NotDone() bool {
3459 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3460 }
3461
3462
3463 func (iter ResponseWithContinuationPolicyIterator) Response() ResponseWithContinuationPolicy {
3464 return iter.page.Response()
3465 }
3466
3467
3468
3469 func (iter ResponseWithContinuationPolicyIterator) Value() Policy {
3470 if !iter.page.NotDone() {
3471 return Policy{}
3472 }
3473 return iter.page.Values()[iter.i]
3474 }
3475
3476
3477 func NewResponseWithContinuationPolicyIterator(page ResponseWithContinuationPolicyPage) ResponseWithContinuationPolicyIterator {
3478 return ResponseWithContinuationPolicyIterator{page: page}
3479 }
3480
3481
3482 func (rwcP ResponseWithContinuationPolicy) IsEmpty() bool {
3483 return rwcP.Value == nil || len(*rwcP.Value) == 0
3484 }
3485
3486
3487 func (rwcP ResponseWithContinuationPolicy) hasNextLink() bool {
3488 return rwcP.NextLink != nil && len(*rwcP.NextLink) != 0
3489 }
3490
3491
3492
3493 func (rwcP ResponseWithContinuationPolicy) responseWithContinuationPolicyPreparer(ctx context.Context) (*http.Request, error) {
3494 if !rwcP.hasNextLink() {
3495 return nil, nil
3496 }
3497 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3498 autorest.AsJSON(),
3499 autorest.AsGet(),
3500 autorest.WithBaseURL(to.String(rwcP.NextLink)))
3501 }
3502
3503
3504 type ResponseWithContinuationPolicyPage struct {
3505 fn func(context.Context, ResponseWithContinuationPolicy) (ResponseWithContinuationPolicy, error)
3506 rwcp ResponseWithContinuationPolicy
3507 }
3508
3509
3510
3511 func (page *ResponseWithContinuationPolicyPage) NextWithContext(ctx context.Context) (err error) {
3512 if tracing.IsEnabled() {
3513 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationPolicyPage.NextWithContext")
3514 defer func() {
3515 sc := -1
3516 if page.Response().Response.Response != nil {
3517 sc = page.Response().Response.Response.StatusCode
3518 }
3519 tracing.EndSpan(ctx, sc, err)
3520 }()
3521 }
3522 for {
3523 next, err := page.fn(ctx, page.rwcp)
3524 if err != nil {
3525 return err
3526 }
3527 page.rwcp = next
3528 if !next.hasNextLink() || !next.IsEmpty() {
3529 break
3530 }
3531 }
3532 return nil
3533 }
3534
3535
3536
3537
3538 func (page *ResponseWithContinuationPolicyPage) Next() error {
3539 return page.NextWithContext(context.Background())
3540 }
3541
3542
3543 func (page ResponseWithContinuationPolicyPage) NotDone() bool {
3544 return !page.rwcp.IsEmpty()
3545 }
3546
3547
3548 func (page ResponseWithContinuationPolicyPage) Response() ResponseWithContinuationPolicy {
3549 return page.rwcp
3550 }
3551
3552
3553 func (page ResponseWithContinuationPolicyPage) Values() []Policy {
3554 if page.rwcp.IsEmpty() {
3555 return nil
3556 }
3557 return *page.rwcp.Value
3558 }
3559
3560
3561 func NewResponseWithContinuationPolicyPage(cur ResponseWithContinuationPolicy, getNextPage func(context.Context, ResponseWithContinuationPolicy) (ResponseWithContinuationPolicy, error)) ResponseWithContinuationPolicyPage {
3562 return ResponseWithContinuationPolicyPage{
3563 fn: getNextPage,
3564 rwcp: cur,
3565 }
3566 }
3567
3568
3569 type ResponseWithContinuationSchedule struct {
3570 autorest.Response `json:"-"`
3571
3572 Value *[]Schedule `json:"value,omitempty"`
3573
3574 NextLink *string `json:"nextLink,omitempty"`
3575 }
3576
3577
3578 type ResponseWithContinuationScheduleIterator struct {
3579 i int
3580 page ResponseWithContinuationSchedulePage
3581 }
3582
3583
3584
3585 func (iter *ResponseWithContinuationScheduleIterator) NextWithContext(ctx context.Context) (err error) {
3586 if tracing.IsEnabled() {
3587 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationScheduleIterator.NextWithContext")
3588 defer func() {
3589 sc := -1
3590 if iter.Response().Response.Response != nil {
3591 sc = iter.Response().Response.Response.StatusCode
3592 }
3593 tracing.EndSpan(ctx, sc, err)
3594 }()
3595 }
3596 iter.i++
3597 if iter.i < len(iter.page.Values()) {
3598 return nil
3599 }
3600 err = iter.page.NextWithContext(ctx)
3601 if err != nil {
3602 iter.i--
3603 return err
3604 }
3605 iter.i = 0
3606 return nil
3607 }
3608
3609
3610
3611
3612 func (iter *ResponseWithContinuationScheduleIterator) Next() error {
3613 return iter.NextWithContext(context.Background())
3614 }
3615
3616
3617 func (iter ResponseWithContinuationScheduleIterator) NotDone() bool {
3618 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3619 }
3620
3621
3622 func (iter ResponseWithContinuationScheduleIterator) Response() ResponseWithContinuationSchedule {
3623 return iter.page.Response()
3624 }
3625
3626
3627
3628 func (iter ResponseWithContinuationScheduleIterator) Value() Schedule {
3629 if !iter.page.NotDone() {
3630 return Schedule{}
3631 }
3632 return iter.page.Values()[iter.i]
3633 }
3634
3635
3636 func NewResponseWithContinuationScheduleIterator(page ResponseWithContinuationSchedulePage) ResponseWithContinuationScheduleIterator {
3637 return ResponseWithContinuationScheduleIterator{page: page}
3638 }
3639
3640
3641 func (rwcS ResponseWithContinuationSchedule) IsEmpty() bool {
3642 return rwcS.Value == nil || len(*rwcS.Value) == 0
3643 }
3644
3645
3646 func (rwcS ResponseWithContinuationSchedule) hasNextLink() bool {
3647 return rwcS.NextLink != nil && len(*rwcS.NextLink) != 0
3648 }
3649
3650
3651
3652 func (rwcS ResponseWithContinuationSchedule) responseWithContinuationSchedulePreparer(ctx context.Context) (*http.Request, error) {
3653 if !rwcS.hasNextLink() {
3654 return nil, nil
3655 }
3656 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3657 autorest.AsJSON(),
3658 autorest.AsGet(),
3659 autorest.WithBaseURL(to.String(rwcS.NextLink)))
3660 }
3661
3662
3663 type ResponseWithContinuationSchedulePage struct {
3664 fn func(context.Context, ResponseWithContinuationSchedule) (ResponseWithContinuationSchedule, error)
3665 rwcs ResponseWithContinuationSchedule
3666 }
3667
3668
3669
3670 func (page *ResponseWithContinuationSchedulePage) NextWithContext(ctx context.Context) (err error) {
3671 if tracing.IsEnabled() {
3672 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationSchedulePage.NextWithContext")
3673 defer func() {
3674 sc := -1
3675 if page.Response().Response.Response != nil {
3676 sc = page.Response().Response.Response.StatusCode
3677 }
3678 tracing.EndSpan(ctx, sc, err)
3679 }()
3680 }
3681 for {
3682 next, err := page.fn(ctx, page.rwcs)
3683 if err != nil {
3684 return err
3685 }
3686 page.rwcs = next
3687 if !next.hasNextLink() || !next.IsEmpty() {
3688 break
3689 }
3690 }
3691 return nil
3692 }
3693
3694
3695
3696
3697 func (page *ResponseWithContinuationSchedulePage) Next() error {
3698 return page.NextWithContext(context.Background())
3699 }
3700
3701
3702 func (page ResponseWithContinuationSchedulePage) NotDone() bool {
3703 return !page.rwcs.IsEmpty()
3704 }
3705
3706
3707 func (page ResponseWithContinuationSchedulePage) Response() ResponseWithContinuationSchedule {
3708 return page.rwcs
3709 }
3710
3711
3712 func (page ResponseWithContinuationSchedulePage) Values() []Schedule {
3713 if page.rwcs.IsEmpty() {
3714 return nil
3715 }
3716 return *page.rwcs.Value
3717 }
3718
3719
3720 func NewResponseWithContinuationSchedulePage(cur ResponseWithContinuationSchedule, getNextPage func(context.Context, ResponseWithContinuationSchedule) (ResponseWithContinuationSchedule, error)) ResponseWithContinuationSchedulePage {
3721 return ResponseWithContinuationSchedulePage{
3722 fn: getNextPage,
3723 rwcs: cur,
3724 }
3725 }
3726
3727
3728 type ResponseWithContinuationVirtualNetwork struct {
3729 autorest.Response `json:"-"`
3730
3731 Value *[]VirtualNetwork `json:"value,omitempty"`
3732
3733 NextLink *string `json:"nextLink,omitempty"`
3734 }
3735
3736
3737
3738 type ResponseWithContinuationVirtualNetworkIterator struct {
3739 i int
3740 page ResponseWithContinuationVirtualNetworkPage
3741 }
3742
3743
3744
3745 func (iter *ResponseWithContinuationVirtualNetworkIterator) NextWithContext(ctx context.Context) (err error) {
3746 if tracing.IsEnabled() {
3747 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationVirtualNetworkIterator.NextWithContext")
3748 defer func() {
3749 sc := -1
3750 if iter.Response().Response.Response != nil {
3751 sc = iter.Response().Response.Response.StatusCode
3752 }
3753 tracing.EndSpan(ctx, sc, err)
3754 }()
3755 }
3756 iter.i++
3757 if iter.i < len(iter.page.Values()) {
3758 return nil
3759 }
3760 err = iter.page.NextWithContext(ctx)
3761 if err != nil {
3762 iter.i--
3763 return err
3764 }
3765 iter.i = 0
3766 return nil
3767 }
3768
3769
3770
3771
3772 func (iter *ResponseWithContinuationVirtualNetworkIterator) Next() error {
3773 return iter.NextWithContext(context.Background())
3774 }
3775
3776
3777 func (iter ResponseWithContinuationVirtualNetworkIterator) NotDone() bool {
3778 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3779 }
3780
3781
3782 func (iter ResponseWithContinuationVirtualNetworkIterator) Response() ResponseWithContinuationVirtualNetwork {
3783 return iter.page.Response()
3784 }
3785
3786
3787
3788 func (iter ResponseWithContinuationVirtualNetworkIterator) Value() VirtualNetwork {
3789 if !iter.page.NotDone() {
3790 return VirtualNetwork{}
3791 }
3792 return iter.page.Values()[iter.i]
3793 }
3794
3795
3796 func NewResponseWithContinuationVirtualNetworkIterator(page ResponseWithContinuationVirtualNetworkPage) ResponseWithContinuationVirtualNetworkIterator {
3797 return ResponseWithContinuationVirtualNetworkIterator{page: page}
3798 }
3799
3800
3801 func (rwcVn ResponseWithContinuationVirtualNetwork) IsEmpty() bool {
3802 return rwcVn.Value == nil || len(*rwcVn.Value) == 0
3803 }
3804
3805
3806 func (rwcVn ResponseWithContinuationVirtualNetwork) hasNextLink() bool {
3807 return rwcVn.NextLink != nil && len(*rwcVn.NextLink) != 0
3808 }
3809
3810
3811
3812 func (rwcVn ResponseWithContinuationVirtualNetwork) responseWithContinuationVirtualNetworkPreparer(ctx context.Context) (*http.Request, error) {
3813 if !rwcVn.hasNextLink() {
3814 return nil, nil
3815 }
3816 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3817 autorest.AsJSON(),
3818 autorest.AsGet(),
3819 autorest.WithBaseURL(to.String(rwcVn.NextLink)))
3820 }
3821
3822
3823 type ResponseWithContinuationVirtualNetworkPage struct {
3824 fn func(context.Context, ResponseWithContinuationVirtualNetwork) (ResponseWithContinuationVirtualNetwork, error)
3825 rwcvn ResponseWithContinuationVirtualNetwork
3826 }
3827
3828
3829
3830 func (page *ResponseWithContinuationVirtualNetworkPage) NextWithContext(ctx context.Context) (err error) {
3831 if tracing.IsEnabled() {
3832 ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationVirtualNetworkPage.NextWithContext")
3833 defer func() {
3834 sc := -1
3835 if page.Response().Response.Response != nil {
3836 sc = page.Response().Response.Response.StatusCode
3837 }
3838 tracing.EndSpan(ctx, sc, err)
3839 }()
3840 }
3841 for {
3842 next, err := page.fn(ctx, page.rwcvn)
3843 if err != nil {
3844 return err
3845 }
3846 page.rwcvn = next
3847 if !next.hasNextLink() || !next.IsEmpty() {
3848 break
3849 }
3850 }
3851 return nil
3852 }
3853
3854
3855
3856
3857 func (page *ResponseWithContinuationVirtualNetworkPage) Next() error {
3858 return page.NextWithContext(context.Background())
3859 }
3860
3861
3862 func (page ResponseWithContinuationVirtualNetworkPage) NotDone() bool {
3863 return !page.rwcvn.IsEmpty()
3864 }
3865
3866
3867 func (page ResponseWithContinuationVirtualNetworkPage) Response() ResponseWithContinuationVirtualNetwork {
3868 return page.rwcvn
3869 }
3870
3871
3872 func (page ResponseWithContinuationVirtualNetworkPage) Values() []VirtualNetwork {
3873 if page.rwcvn.IsEmpty() {
3874 return nil
3875 }
3876 return *page.rwcvn.Value
3877 }
3878
3879
3880 func NewResponseWithContinuationVirtualNetworkPage(cur ResponseWithContinuationVirtualNetwork, getNextPage func(context.Context, ResponseWithContinuationVirtualNetwork) (ResponseWithContinuationVirtualNetwork, error)) ResponseWithContinuationVirtualNetworkPage {
3881 return ResponseWithContinuationVirtualNetworkPage{
3882 fn: getNextPage,
3883 rwcvn: cur,
3884 }
3885 }
3886
3887
3888 type Schedule struct {
3889 autorest.Response `json:"-"`
3890
3891 *ScheduleProperties `json:"properties,omitempty"`
3892
3893 ID *string `json:"id,omitempty"`
3894
3895 Name *string `json:"name,omitempty"`
3896
3897 Type *string `json:"type,omitempty"`
3898
3899 Location *string `json:"location,omitempty"`
3900
3901 Tags map[string]*string `json:"tags"`
3902 }
3903
3904
3905 func (s Schedule) MarshalJSON() ([]byte, error) {
3906 objectMap := make(map[string]interface{})
3907 if s.ScheduleProperties != nil {
3908 objectMap["properties"] = s.ScheduleProperties
3909 }
3910 if s.ID != nil {
3911 objectMap["id"] = s.ID
3912 }
3913 if s.Name != nil {
3914 objectMap["name"] = s.Name
3915 }
3916 if s.Type != nil {
3917 objectMap["type"] = s.Type
3918 }
3919 if s.Location != nil {
3920 objectMap["location"] = s.Location
3921 }
3922 if s.Tags != nil {
3923 objectMap["tags"] = s.Tags
3924 }
3925 return json.Marshal(objectMap)
3926 }
3927
3928
3929 func (s *Schedule) UnmarshalJSON(body []byte) error {
3930 var m map[string]*json.RawMessage
3931 err := json.Unmarshal(body, &m)
3932 if err != nil {
3933 return err
3934 }
3935 for k, v := range m {
3936 switch k {
3937 case "properties":
3938 if v != nil {
3939 var scheduleProperties ScheduleProperties
3940 err = json.Unmarshal(*v, &scheduleProperties)
3941 if err != nil {
3942 return err
3943 }
3944 s.ScheduleProperties = &scheduleProperties
3945 }
3946 case "id":
3947 if v != nil {
3948 var ID string
3949 err = json.Unmarshal(*v, &ID)
3950 if err != nil {
3951 return err
3952 }
3953 s.ID = &ID
3954 }
3955 case "name":
3956 if v != nil {
3957 var name string
3958 err = json.Unmarshal(*v, &name)
3959 if err != nil {
3960 return err
3961 }
3962 s.Name = &name
3963 }
3964 case "type":
3965 if v != nil {
3966 var typeVar string
3967 err = json.Unmarshal(*v, &typeVar)
3968 if err != nil {
3969 return err
3970 }
3971 s.Type = &typeVar
3972 }
3973 case "location":
3974 if v != nil {
3975 var location string
3976 err = json.Unmarshal(*v, &location)
3977 if err != nil {
3978 return err
3979 }
3980 s.Location = &location
3981 }
3982 case "tags":
3983 if v != nil {
3984 var tags map[string]*string
3985 err = json.Unmarshal(*v, &tags)
3986 if err != nil {
3987 return err
3988 }
3989 s.Tags = tags
3990 }
3991 }
3992 }
3993
3994 return nil
3995 }
3996
3997
3998
3999 type ScheduleCreateOrUpdateResourceFuture struct {
4000 azure.FutureAPI
4001
4002
4003 Result func(ScheduleClient) (Schedule, error)
4004 }
4005
4006
4007 func (future *ScheduleCreateOrUpdateResourceFuture) UnmarshalJSON(body []byte) error {
4008 var azFuture azure.Future
4009 if err := json.Unmarshal(body, &azFuture); err != nil {
4010 return err
4011 }
4012 future.FutureAPI = &azFuture
4013 future.Result = future.result
4014 return nil
4015 }
4016
4017
4018 func (future *ScheduleCreateOrUpdateResourceFuture) result(client ScheduleClient) (s Schedule, err error) {
4019 var done bool
4020 done, err = future.DoneWithContext(context.Background(), client)
4021 if err != nil {
4022 err = autorest.NewErrorWithError(err, "dtl.ScheduleCreateOrUpdateResourceFuture", "Result", future.Response(), "Polling failure")
4023 return
4024 }
4025 if !done {
4026 s.Response.Response = future.Response()
4027 err = azure.NewAsyncOpIncompleteError("dtl.ScheduleCreateOrUpdateResourceFuture")
4028 return
4029 }
4030 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4031 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
4032 s, err = client.CreateOrUpdateResourceResponder(s.Response.Response)
4033 if err != nil {
4034 err = autorest.NewErrorWithError(err, "dtl.ScheduleCreateOrUpdateResourceFuture", "Result", s.Response.Response, "Failure responding to request")
4035 }
4036 }
4037 return
4038 }
4039
4040
4041
4042 type ScheduleDeleteResourceFuture struct {
4043 azure.FutureAPI
4044
4045
4046 Result func(ScheduleClient) (autorest.Response, error)
4047 }
4048
4049
4050 func (future *ScheduleDeleteResourceFuture) UnmarshalJSON(body []byte) error {
4051 var azFuture azure.Future
4052 if err := json.Unmarshal(body, &azFuture); err != nil {
4053 return err
4054 }
4055 future.FutureAPI = &azFuture
4056 future.Result = future.result
4057 return nil
4058 }
4059
4060
4061 func (future *ScheduleDeleteResourceFuture) result(client ScheduleClient) (ar autorest.Response, err error) {
4062 var done bool
4063 done, err = future.DoneWithContext(context.Background(), client)
4064 if err != nil {
4065 err = autorest.NewErrorWithError(err, "dtl.ScheduleDeleteResourceFuture", "Result", future.Response(), "Polling failure")
4066 return
4067 }
4068 if !done {
4069 ar.Response = future.Response()
4070 err = azure.NewAsyncOpIncompleteError("dtl.ScheduleDeleteResourceFuture")
4071 return
4072 }
4073 ar.Response = future.Response()
4074 return
4075 }
4076
4077
4078
4079 type ScheduleExecuteFuture struct {
4080 azure.FutureAPI
4081
4082
4083 Result func(ScheduleClient) (autorest.Response, error)
4084 }
4085
4086
4087 func (future *ScheduleExecuteFuture) UnmarshalJSON(body []byte) error {
4088 var azFuture azure.Future
4089 if err := json.Unmarshal(body, &azFuture); err != nil {
4090 return err
4091 }
4092 future.FutureAPI = &azFuture
4093 future.Result = future.result
4094 return nil
4095 }
4096
4097
4098 func (future *ScheduleExecuteFuture) result(client ScheduleClient) (ar autorest.Response, err error) {
4099 var done bool
4100 done, err = future.DoneWithContext(context.Background(), client)
4101 if err != nil {
4102 err = autorest.NewErrorWithError(err, "dtl.ScheduleExecuteFuture", "Result", future.Response(), "Polling failure")
4103 return
4104 }
4105 if !done {
4106 ar.Response = future.Response()
4107 err = azure.NewAsyncOpIncompleteError("dtl.ScheduleExecuteFuture")
4108 return
4109 }
4110 ar.Response = future.Response()
4111 return
4112 }
4113
4114
4115 type ScheduleProperties struct {
4116
4117 Status EnableStatus `json:"status,omitempty"`
4118
4119 TaskType TaskType `json:"taskType,omitempty"`
4120
4121 WeeklyRecurrence *WeekDetails `json:"weeklyRecurrence,omitempty"`
4122
4123 DailyRecurrence *DayDetails `json:"dailyRecurrence,omitempty"`
4124
4125 HourlyRecurrence *HourDetails `json:"hourlyRecurrence,omitempty"`
4126
4127 TimeZoneID *string `json:"timeZoneId,omitempty"`
4128
4129 ProvisioningState *string `json:"provisioningState,omitempty"`
4130 }
4131
4132
4133 type Subnet struct {
4134 ResourceID *string `json:"resourceId,omitempty"`
4135 LabSubnetName *string `json:"labSubnetName,omitempty"`
4136
4137 AllowPublicIP UsagePermissionType `json:"allowPublicIp,omitempty"`
4138 }
4139
4140
4141 type SubnetOverride struct {
4142
4143 ResourceID *string `json:"resourceId,omitempty"`
4144
4145 LabSubnetName *string `json:"labSubnetName,omitempty"`
4146
4147 UseInVMCreationPermission UsagePermissionType `json:"useInVmCreationPermission,omitempty"`
4148
4149 UsePublicIPAddressPermission UsagePermissionType `json:"usePublicIpAddressPermission,omitempty"`
4150 }
4151
4152
4153 type SubscriptionNotification struct {
4154 RegistrationDate *string `json:"registrationDate,omitempty"`
4155
4156 State SubscriptionNotificationState `json:"state,omitempty"`
4157 Properties *SubscriptionNotificationProperties `json:"properties,omitempty"`
4158 }
4159
4160
4161 type SubscriptionNotificationProperties struct {
4162 TenantID *string `json:"tenantId,omitempty"`
4163 }
4164
4165
4166
4167 type VirtualMachineApplyArtifactsFuture struct {
4168 azure.FutureAPI
4169
4170
4171 Result func(VirtualMachineClient) (autorest.Response, error)
4172 }
4173
4174
4175 func (future *VirtualMachineApplyArtifactsFuture) UnmarshalJSON(body []byte) error {
4176 var azFuture azure.Future
4177 if err := json.Unmarshal(body, &azFuture); err != nil {
4178 return err
4179 }
4180 future.FutureAPI = &azFuture
4181 future.Result = future.result
4182 return nil
4183 }
4184
4185
4186 func (future *VirtualMachineApplyArtifactsFuture) result(client VirtualMachineClient) (ar autorest.Response, err error) {
4187 var done bool
4188 done, err = future.DoneWithContext(context.Background(), client)
4189 if err != nil {
4190 err = autorest.NewErrorWithError(err, "dtl.VirtualMachineApplyArtifactsFuture", "Result", future.Response(), "Polling failure")
4191 return
4192 }
4193 if !done {
4194 ar.Response = future.Response()
4195 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachineApplyArtifactsFuture")
4196 return
4197 }
4198 ar.Response = future.Response()
4199 return
4200 }
4201
4202
4203
4204 type VirtualMachineCreateOrUpdateResourceFuture struct {
4205 azure.FutureAPI
4206
4207
4208 Result func(VirtualMachineClient) (LabVirtualMachine, error)
4209 }
4210
4211
4212 func (future *VirtualMachineCreateOrUpdateResourceFuture) UnmarshalJSON(body []byte) error {
4213 var azFuture azure.Future
4214 if err := json.Unmarshal(body, &azFuture); err != nil {
4215 return err
4216 }
4217 future.FutureAPI = &azFuture
4218 future.Result = future.result
4219 return nil
4220 }
4221
4222
4223 func (future *VirtualMachineCreateOrUpdateResourceFuture) result(client VirtualMachineClient) (lvm LabVirtualMachine, err error) {
4224 var done bool
4225 done, err = future.DoneWithContext(context.Background(), client)
4226 if err != nil {
4227 err = autorest.NewErrorWithError(err, "dtl.VirtualMachineCreateOrUpdateResourceFuture", "Result", future.Response(), "Polling failure")
4228 return
4229 }
4230 if !done {
4231 lvm.Response.Response = future.Response()
4232 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachineCreateOrUpdateResourceFuture")
4233 return
4234 }
4235 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4236 if lvm.Response.Response, err = future.GetResult(sender); err == nil && lvm.Response.Response.StatusCode != http.StatusNoContent {
4237 lvm, err = client.CreateOrUpdateResourceResponder(lvm.Response.Response)
4238 if err != nil {
4239 err = autorest.NewErrorWithError(err, "dtl.VirtualMachineCreateOrUpdateResourceFuture", "Result", lvm.Response.Response, "Failure responding to request")
4240 }
4241 }
4242 return
4243 }
4244
4245
4246
4247 type VirtualMachineDeleteResourceFuture struct {
4248 azure.FutureAPI
4249
4250
4251 Result func(VirtualMachineClient) (autorest.Response, error)
4252 }
4253
4254
4255 func (future *VirtualMachineDeleteResourceFuture) UnmarshalJSON(body []byte) error {
4256 var azFuture azure.Future
4257 if err := json.Unmarshal(body, &azFuture); err != nil {
4258 return err
4259 }
4260 future.FutureAPI = &azFuture
4261 future.Result = future.result
4262 return nil
4263 }
4264
4265
4266 func (future *VirtualMachineDeleteResourceFuture) result(client VirtualMachineClient) (ar autorest.Response, err error) {
4267 var done bool
4268 done, err = future.DoneWithContext(context.Background(), client)
4269 if err != nil {
4270 err = autorest.NewErrorWithError(err, "dtl.VirtualMachineDeleteResourceFuture", "Result", future.Response(), "Polling failure")
4271 return
4272 }
4273 if !done {
4274 ar.Response = future.Response()
4275 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachineDeleteResourceFuture")
4276 return
4277 }
4278 ar.Response = future.Response()
4279 return
4280 }
4281
4282
4283
4284 type VirtualMachineStartFuture struct {
4285 azure.FutureAPI
4286
4287
4288 Result func(VirtualMachineClient) (autorest.Response, error)
4289 }
4290
4291
4292 func (future *VirtualMachineStartFuture) UnmarshalJSON(body []byte) error {
4293 var azFuture azure.Future
4294 if err := json.Unmarshal(body, &azFuture); err != nil {
4295 return err
4296 }
4297 future.FutureAPI = &azFuture
4298 future.Result = future.result
4299 return nil
4300 }
4301
4302
4303 func (future *VirtualMachineStartFuture) result(client VirtualMachineClient) (ar autorest.Response, err error) {
4304 var done bool
4305 done, err = future.DoneWithContext(context.Background(), client)
4306 if err != nil {
4307 err = autorest.NewErrorWithError(err, "dtl.VirtualMachineStartFuture", "Result", future.Response(), "Polling failure")
4308 return
4309 }
4310 if !done {
4311 ar.Response = future.Response()
4312 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachineStartFuture")
4313 return
4314 }
4315 ar.Response = future.Response()
4316 return
4317 }
4318
4319
4320
4321 type VirtualMachineStopFuture struct {
4322 azure.FutureAPI
4323
4324
4325 Result func(VirtualMachineClient) (autorest.Response, error)
4326 }
4327
4328
4329 func (future *VirtualMachineStopFuture) UnmarshalJSON(body []byte) error {
4330 var azFuture azure.Future
4331 if err := json.Unmarshal(body, &azFuture); err != nil {
4332 return err
4333 }
4334 future.FutureAPI = &azFuture
4335 future.Result = future.result
4336 return nil
4337 }
4338
4339
4340 func (future *VirtualMachineStopFuture) result(client VirtualMachineClient) (ar autorest.Response, err error) {
4341 var done bool
4342 done, err = future.DoneWithContext(context.Background(), client)
4343 if err != nil {
4344 err = autorest.NewErrorWithError(err, "dtl.VirtualMachineStopFuture", "Result", future.Response(), "Polling failure")
4345 return
4346 }
4347 if !done {
4348 ar.Response = future.Response()
4349 err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachineStopFuture")
4350 return
4351 }
4352 ar.Response = future.Response()
4353 return
4354 }
4355
4356
4357 type VirtualNetwork struct {
4358 autorest.Response `json:"-"`
4359
4360 *VirtualNetworkProperties `json:"properties,omitempty"`
4361
4362 ID *string `json:"id,omitempty"`
4363
4364 Name *string `json:"name,omitempty"`
4365
4366 Type *string `json:"type,omitempty"`
4367
4368 Location *string `json:"location,omitempty"`
4369
4370 Tags map[string]*string `json:"tags"`
4371 }
4372
4373
4374 func (vn VirtualNetwork) MarshalJSON() ([]byte, error) {
4375 objectMap := make(map[string]interface{})
4376 if vn.VirtualNetworkProperties != nil {
4377 objectMap["properties"] = vn.VirtualNetworkProperties
4378 }
4379 if vn.ID != nil {
4380 objectMap["id"] = vn.ID
4381 }
4382 if vn.Name != nil {
4383 objectMap["name"] = vn.Name
4384 }
4385 if vn.Type != nil {
4386 objectMap["type"] = vn.Type
4387 }
4388 if vn.Location != nil {
4389 objectMap["location"] = vn.Location
4390 }
4391 if vn.Tags != nil {
4392 objectMap["tags"] = vn.Tags
4393 }
4394 return json.Marshal(objectMap)
4395 }
4396
4397
4398 func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error {
4399 var m map[string]*json.RawMessage
4400 err := json.Unmarshal(body, &m)
4401 if err != nil {
4402 return err
4403 }
4404 for k, v := range m {
4405 switch k {
4406 case "properties":
4407 if v != nil {
4408 var virtualNetworkProperties VirtualNetworkProperties
4409 err = json.Unmarshal(*v, &virtualNetworkProperties)
4410 if err != nil {
4411 return err
4412 }
4413 vn.VirtualNetworkProperties = &virtualNetworkProperties
4414 }
4415 case "id":
4416 if v != nil {
4417 var ID string
4418 err = json.Unmarshal(*v, &ID)
4419 if err != nil {
4420 return err
4421 }
4422 vn.ID = &ID
4423 }
4424 case "name":
4425 if v != nil {
4426 var name string
4427 err = json.Unmarshal(*v, &name)
4428 if err != nil {
4429 return err
4430 }
4431 vn.Name = &name
4432 }
4433 case "type":
4434 if v != nil {
4435 var typeVar string
4436 err = json.Unmarshal(*v, &typeVar)
4437 if err != nil {
4438 return err
4439 }
4440 vn.Type = &typeVar
4441 }
4442 case "location":
4443 if v != nil {
4444 var location string
4445 err = json.Unmarshal(*v, &location)
4446 if err != nil {
4447 return err
4448 }
4449 vn.Location = &location
4450 }
4451 case "tags":
4452 if v != nil {
4453 var tags map[string]*string
4454 err = json.Unmarshal(*v, &tags)
4455 if err != nil {
4456 return err
4457 }
4458 vn.Tags = tags
4459 }
4460 }
4461 }
4462
4463 return nil
4464 }
4465
4466
4467
4468 type VirtualNetworkCreateOrUpdateResourceFuture struct {
4469 azure.FutureAPI
4470
4471
4472 Result func(VirtualNetworkClient) (VirtualNetwork, error)
4473 }
4474
4475
4476 func (future *VirtualNetworkCreateOrUpdateResourceFuture) UnmarshalJSON(body []byte) error {
4477 var azFuture azure.Future
4478 if err := json.Unmarshal(body, &azFuture); err != nil {
4479 return err
4480 }
4481 future.FutureAPI = &azFuture
4482 future.Result = future.result
4483 return nil
4484 }
4485
4486
4487 func (future *VirtualNetworkCreateOrUpdateResourceFuture) result(client VirtualNetworkClient) (vn VirtualNetwork, err error) {
4488 var done bool
4489 done, err = future.DoneWithContext(context.Background(), client)
4490 if err != nil {
4491 err = autorest.NewErrorWithError(err, "dtl.VirtualNetworkCreateOrUpdateResourceFuture", "Result", future.Response(), "Polling failure")
4492 return
4493 }
4494 if !done {
4495 vn.Response.Response = future.Response()
4496 err = azure.NewAsyncOpIncompleteError("dtl.VirtualNetworkCreateOrUpdateResourceFuture")
4497 return
4498 }
4499 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4500 if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent {
4501 vn, err = client.CreateOrUpdateResourceResponder(vn.Response.Response)
4502 if err != nil {
4503 err = autorest.NewErrorWithError(err, "dtl.VirtualNetworkCreateOrUpdateResourceFuture", "Result", vn.Response.Response, "Failure responding to request")
4504 }
4505 }
4506 return
4507 }
4508
4509
4510
4511 type VirtualNetworkDeleteResourceFuture struct {
4512 azure.FutureAPI
4513
4514
4515 Result func(VirtualNetworkClient) (autorest.Response, error)
4516 }
4517
4518
4519 func (future *VirtualNetworkDeleteResourceFuture) UnmarshalJSON(body []byte) error {
4520 var azFuture azure.Future
4521 if err := json.Unmarshal(body, &azFuture); err != nil {
4522 return err
4523 }
4524 future.FutureAPI = &azFuture
4525 future.Result = future.result
4526 return nil
4527 }
4528
4529
4530 func (future *VirtualNetworkDeleteResourceFuture) result(client VirtualNetworkClient) (ar autorest.Response, err error) {
4531 var done bool
4532 done, err = future.DoneWithContext(context.Background(), client)
4533 if err != nil {
4534 err = autorest.NewErrorWithError(err, "dtl.VirtualNetworkDeleteResourceFuture", "Result", future.Response(), "Polling failure")
4535 return
4536 }
4537 if !done {
4538 ar.Response = future.Response()
4539 err = azure.NewAsyncOpIncompleteError("dtl.VirtualNetworkDeleteResourceFuture")
4540 return
4541 }
4542 ar.Response = future.Response()
4543 return
4544 }
4545
4546
4547 type VirtualNetworkProperties struct {
4548
4549 AllowedSubnets *[]Subnet `json:"allowedSubnets,omitempty"`
4550
4551 Description *string `json:"description,omitempty"`
4552
4553 ExternalProviderResourceID *string `json:"externalProviderResourceId,omitempty"`
4554
4555 SubnetOverrides *[]SubnetOverride `json:"subnetOverrides,omitempty"`
4556
4557 ProvisioningState *string `json:"provisioningState,omitempty"`
4558 }
4559
4560
4561 type VMCostProperties struct {
4562 Name *string `json:"name,omitempty"`
4563 ResourceGroupName *string `json:"resourceGroupName,omitempty"`
4564 Cost *float64 `json:"cost,omitempty"`
4565 }
4566
4567
4568 type WeekDetails struct {
4569
4570 Weekdays *[]string `json:"weekdays,omitempty"`
4571
4572 Time *string `json:"time,omitempty"`
4573 }
4574
4575
4576 type WindowsOsInfo struct {
4577
4578 WindowsOsState WindowsOsState `json:"windowsOsState,omitempty"`
4579 }
4580
View as plain text