1 package features
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/resources/mgmt/2019-07-01/features"
22
23
24 type AliasPathType struct {
25
26 Path *string `json:"path,omitempty"`
27
28 APIVersions *[]string `json:"apiVersions,omitempty"`
29 }
30
31
32 type AliasType struct {
33
34 Name *string `json:"name,omitempty"`
35
36 Paths *[]AliasPathType `json:"paths,omitempty"`
37 }
38
39
40 type BasicDependency struct {
41
42 ID *string `json:"id,omitempty"`
43
44 ResourceType *string `json:"resourceType,omitempty"`
45
46 ResourceName *string `json:"resourceName,omitempty"`
47 }
48
49
50 type CloudError struct {
51 Error *ErrorResponse `json:"error,omitempty"`
52 }
53
54
55 type DebugSetting struct {
56
57 DetailLevel *string `json:"detailLevel,omitempty"`
58 }
59
60
61 type Dependency struct {
62
63 DependsOn *[]BasicDependency `json:"dependsOn,omitempty"`
64
65 ID *string `json:"id,omitempty"`
66
67 ResourceType *string `json:"resourceType,omitempty"`
68
69 ResourceName *string `json:"resourceName,omitempty"`
70 }
71
72
73 type Deployment struct {
74
75 Location *string `json:"location,omitempty"`
76
77 Properties *DeploymentProperties `json:"properties,omitempty"`
78 }
79
80
81 type DeploymentExportResult struct {
82 autorest.Response `json:"-"`
83
84 Template interface{} `json:"template,omitempty"`
85 }
86
87
88 type DeploymentExtended struct {
89 autorest.Response `json:"-"`
90
91 ID *string `json:"id,omitempty"`
92
93 Name *string `json:"name,omitempty"`
94
95 Type *string `json:"type,omitempty"`
96
97 Location *string `json:"location,omitempty"`
98
99 Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
100 }
101
102
103 func (de DeploymentExtended) MarshalJSON() ([]byte, error) {
104 objectMap := make(map[string]interface{})
105 if de.Location != nil {
106 objectMap["location"] = de.Location
107 }
108 if de.Properties != nil {
109 objectMap["properties"] = de.Properties
110 }
111 return json.Marshal(objectMap)
112 }
113
114
115 type DeploymentExtendedFilter struct {
116
117 ProvisioningState *string `json:"provisioningState,omitempty"`
118 }
119
120
121 type DeploymentListResult struct {
122 autorest.Response `json:"-"`
123
124 Value *[]DeploymentExtended `json:"value,omitempty"`
125
126 NextLink *string `json:"nextLink,omitempty"`
127 }
128
129
130 func (dlr DeploymentListResult) MarshalJSON() ([]byte, error) {
131 objectMap := make(map[string]interface{})
132 if dlr.Value != nil {
133 objectMap["value"] = dlr.Value
134 }
135 return json.Marshal(objectMap)
136 }
137
138
139 type DeploymentListResultIterator struct {
140 i int
141 page DeploymentListResultPage
142 }
143
144
145
146 func (iter *DeploymentListResultIterator) NextWithContext(ctx context.Context) (err error) {
147 if tracing.IsEnabled() {
148 ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentListResultIterator.NextWithContext")
149 defer func() {
150 sc := -1
151 if iter.Response().Response.Response != nil {
152 sc = iter.Response().Response.Response.StatusCode
153 }
154 tracing.EndSpan(ctx, sc, err)
155 }()
156 }
157 iter.i++
158 if iter.i < len(iter.page.Values()) {
159 return nil
160 }
161 err = iter.page.NextWithContext(ctx)
162 if err != nil {
163 iter.i--
164 return err
165 }
166 iter.i = 0
167 return nil
168 }
169
170
171
172
173 func (iter *DeploymentListResultIterator) Next() error {
174 return iter.NextWithContext(context.Background())
175 }
176
177
178 func (iter DeploymentListResultIterator) NotDone() bool {
179 return iter.page.NotDone() && iter.i < len(iter.page.Values())
180 }
181
182
183 func (iter DeploymentListResultIterator) Response() DeploymentListResult {
184 return iter.page.Response()
185 }
186
187
188
189 func (iter DeploymentListResultIterator) Value() DeploymentExtended {
190 if !iter.page.NotDone() {
191 return DeploymentExtended{}
192 }
193 return iter.page.Values()[iter.i]
194 }
195
196
197 func NewDeploymentListResultIterator(page DeploymentListResultPage) DeploymentListResultIterator {
198 return DeploymentListResultIterator{page: page}
199 }
200
201
202 func (dlr DeploymentListResult) IsEmpty() bool {
203 return dlr.Value == nil || len(*dlr.Value) == 0
204 }
205
206
207 func (dlr DeploymentListResult) hasNextLink() bool {
208 return dlr.NextLink != nil && len(*dlr.NextLink) != 0
209 }
210
211
212
213 func (dlr DeploymentListResult) deploymentListResultPreparer(ctx context.Context) (*http.Request, error) {
214 if !dlr.hasNextLink() {
215 return nil, nil
216 }
217 return autorest.Prepare((&http.Request{}).WithContext(ctx),
218 autorest.AsJSON(),
219 autorest.AsGet(),
220 autorest.WithBaseURL(to.String(dlr.NextLink)))
221 }
222
223
224 type DeploymentListResultPage struct {
225 fn func(context.Context, DeploymentListResult) (DeploymentListResult, error)
226 dlr DeploymentListResult
227 }
228
229
230
231 func (page *DeploymentListResultPage) NextWithContext(ctx context.Context) (err error) {
232 if tracing.IsEnabled() {
233 ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentListResultPage.NextWithContext")
234 defer func() {
235 sc := -1
236 if page.Response().Response.Response != nil {
237 sc = page.Response().Response.Response.StatusCode
238 }
239 tracing.EndSpan(ctx, sc, err)
240 }()
241 }
242 for {
243 next, err := page.fn(ctx, page.dlr)
244 if err != nil {
245 return err
246 }
247 page.dlr = next
248 if !next.hasNextLink() || !next.IsEmpty() {
249 break
250 }
251 }
252 return nil
253 }
254
255
256
257
258 func (page *DeploymentListResultPage) Next() error {
259 return page.NextWithContext(context.Background())
260 }
261
262
263 func (page DeploymentListResultPage) NotDone() bool {
264 return !page.dlr.IsEmpty()
265 }
266
267
268 func (page DeploymentListResultPage) Response() DeploymentListResult {
269 return page.dlr
270 }
271
272
273 func (page DeploymentListResultPage) Values() []DeploymentExtended {
274 if page.dlr.IsEmpty() {
275 return nil
276 }
277 return *page.dlr.Value
278 }
279
280
281 func NewDeploymentListResultPage(cur DeploymentListResult, getNextPage func(context.Context, DeploymentListResult) (DeploymentListResult, error)) DeploymentListResultPage {
282 return DeploymentListResultPage{
283 fn: getNextPage,
284 dlr: cur,
285 }
286 }
287
288
289 type DeploymentOperation struct {
290 autorest.Response `json:"-"`
291
292 ID *string `json:"id,omitempty"`
293
294 OperationID *string `json:"operationId,omitempty"`
295
296 Properties *DeploymentOperationProperties `json:"properties,omitempty"`
297 }
298
299
300 func (do DeploymentOperation) MarshalJSON() ([]byte, error) {
301 objectMap := make(map[string]interface{})
302 if do.Properties != nil {
303 objectMap["properties"] = do.Properties
304 }
305 return json.Marshal(objectMap)
306 }
307
308
309 type DeploymentOperationProperties struct {
310
311 ProvisioningState *string `json:"provisioningState,omitempty"`
312
313 Timestamp *date.Time `json:"timestamp,omitempty"`
314
315 Duration *string `json:"duration,omitempty"`
316
317 ServiceRequestID *string `json:"serviceRequestId,omitempty"`
318
319 StatusCode *string `json:"statusCode,omitempty"`
320
321 StatusMessage interface{} `json:"statusMessage,omitempty"`
322
323 TargetResource *TargetResource `json:"targetResource,omitempty"`
324
325 Request *HTTPMessage `json:"request,omitempty"`
326
327 Response *HTTPMessage `json:"response,omitempty"`
328 }
329
330
331 func (dop DeploymentOperationProperties) MarshalJSON() ([]byte, error) {
332 objectMap := make(map[string]interface{})
333 return json.Marshal(objectMap)
334 }
335
336
337 type DeploymentOperationsListResult struct {
338 autorest.Response `json:"-"`
339
340 Value *[]DeploymentOperation `json:"value,omitempty"`
341
342 NextLink *string `json:"nextLink,omitempty"`
343 }
344
345
346 func (dolr DeploymentOperationsListResult) MarshalJSON() ([]byte, error) {
347 objectMap := make(map[string]interface{})
348 if dolr.Value != nil {
349 objectMap["value"] = dolr.Value
350 }
351 return json.Marshal(objectMap)
352 }
353
354
355
356 type DeploymentOperationsListResultIterator struct {
357 i int
358 page DeploymentOperationsListResultPage
359 }
360
361
362
363 func (iter *DeploymentOperationsListResultIterator) NextWithContext(ctx context.Context) (err error) {
364 if tracing.IsEnabled() {
365 ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsListResultIterator.NextWithContext")
366 defer func() {
367 sc := -1
368 if iter.Response().Response.Response != nil {
369 sc = iter.Response().Response.Response.StatusCode
370 }
371 tracing.EndSpan(ctx, sc, err)
372 }()
373 }
374 iter.i++
375 if iter.i < len(iter.page.Values()) {
376 return nil
377 }
378 err = iter.page.NextWithContext(ctx)
379 if err != nil {
380 iter.i--
381 return err
382 }
383 iter.i = 0
384 return nil
385 }
386
387
388
389
390 func (iter *DeploymentOperationsListResultIterator) Next() error {
391 return iter.NextWithContext(context.Background())
392 }
393
394
395 func (iter DeploymentOperationsListResultIterator) NotDone() bool {
396 return iter.page.NotDone() && iter.i < len(iter.page.Values())
397 }
398
399
400 func (iter DeploymentOperationsListResultIterator) Response() DeploymentOperationsListResult {
401 return iter.page.Response()
402 }
403
404
405
406 func (iter DeploymentOperationsListResultIterator) Value() DeploymentOperation {
407 if !iter.page.NotDone() {
408 return DeploymentOperation{}
409 }
410 return iter.page.Values()[iter.i]
411 }
412
413
414 func NewDeploymentOperationsListResultIterator(page DeploymentOperationsListResultPage) DeploymentOperationsListResultIterator {
415 return DeploymentOperationsListResultIterator{page: page}
416 }
417
418
419 func (dolr DeploymentOperationsListResult) IsEmpty() bool {
420 return dolr.Value == nil || len(*dolr.Value) == 0
421 }
422
423
424 func (dolr DeploymentOperationsListResult) hasNextLink() bool {
425 return dolr.NextLink != nil && len(*dolr.NextLink) != 0
426 }
427
428
429
430 func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer(ctx context.Context) (*http.Request, error) {
431 if !dolr.hasNextLink() {
432 return nil, nil
433 }
434 return autorest.Prepare((&http.Request{}).WithContext(ctx),
435 autorest.AsJSON(),
436 autorest.AsGet(),
437 autorest.WithBaseURL(to.String(dolr.NextLink)))
438 }
439
440
441 type DeploymentOperationsListResultPage struct {
442 fn func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)
443 dolr DeploymentOperationsListResult
444 }
445
446
447
448 func (page *DeploymentOperationsListResultPage) NextWithContext(ctx context.Context) (err error) {
449 if tracing.IsEnabled() {
450 ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsListResultPage.NextWithContext")
451 defer func() {
452 sc := -1
453 if page.Response().Response.Response != nil {
454 sc = page.Response().Response.Response.StatusCode
455 }
456 tracing.EndSpan(ctx, sc, err)
457 }()
458 }
459 for {
460 next, err := page.fn(ctx, page.dolr)
461 if err != nil {
462 return err
463 }
464 page.dolr = next
465 if !next.hasNextLink() || !next.IsEmpty() {
466 break
467 }
468 }
469 return nil
470 }
471
472
473
474
475 func (page *DeploymentOperationsListResultPage) Next() error {
476 return page.NextWithContext(context.Background())
477 }
478
479
480 func (page DeploymentOperationsListResultPage) NotDone() bool {
481 return !page.dolr.IsEmpty()
482 }
483
484
485 func (page DeploymentOperationsListResultPage) Response() DeploymentOperationsListResult {
486 return page.dolr
487 }
488
489
490 func (page DeploymentOperationsListResultPage) Values() []DeploymentOperation {
491 if page.dolr.IsEmpty() {
492 return nil
493 }
494 return *page.dolr.Value
495 }
496
497
498 func NewDeploymentOperationsListResultPage(cur DeploymentOperationsListResult, getNextPage func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)) DeploymentOperationsListResultPage {
499 return DeploymentOperationsListResultPage{
500 fn: getNextPage,
501 dolr: cur,
502 }
503 }
504
505
506 type DeploymentProperties struct {
507
508 Template interface{} `json:"template,omitempty"`
509
510 TemplateLink *TemplateLink `json:"templateLink,omitempty"`
511
512 Parameters interface{} `json:"parameters,omitempty"`
513
514 ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
515
516 Mode DeploymentMode `json:"mode,omitempty"`
517
518 DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
519
520 OnErrorDeployment *OnErrorDeployment `json:"onErrorDeployment,omitempty"`
521 }
522
523
524 type DeploymentPropertiesExtended struct {
525
526 ProvisioningState *string `json:"provisioningState,omitempty"`
527
528 CorrelationID *string `json:"correlationId,omitempty"`
529
530 Timestamp *date.Time `json:"timestamp,omitempty"`
531
532 Duration *string `json:"duration,omitempty"`
533
534 Outputs interface{} `json:"outputs,omitempty"`
535
536 Providers *[]Provider `json:"providers,omitempty"`
537
538 Dependencies *[]Dependency `json:"dependencies,omitempty"`
539
540 Template interface{} `json:"template,omitempty"`
541
542 TemplateLink *TemplateLink `json:"templateLink,omitempty"`
543
544 Parameters interface{} `json:"parameters,omitempty"`
545
546 ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
547
548 Mode DeploymentMode `json:"mode,omitempty"`
549
550 DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
551
552 OnErrorDeployment *OnErrorDeploymentExtended `json:"onErrorDeployment,omitempty"`
553 }
554
555
556 func (dpe DeploymentPropertiesExtended) MarshalJSON() ([]byte, error) {
557 objectMap := make(map[string]interface{})
558 if dpe.Outputs != nil {
559 objectMap["outputs"] = dpe.Outputs
560 }
561 if dpe.Providers != nil {
562 objectMap["providers"] = dpe.Providers
563 }
564 if dpe.Dependencies != nil {
565 objectMap["dependencies"] = dpe.Dependencies
566 }
567 if dpe.Template != nil {
568 objectMap["template"] = dpe.Template
569 }
570 if dpe.TemplateLink != nil {
571 objectMap["templateLink"] = dpe.TemplateLink
572 }
573 if dpe.Parameters != nil {
574 objectMap["parameters"] = dpe.Parameters
575 }
576 if dpe.ParametersLink != nil {
577 objectMap["parametersLink"] = dpe.ParametersLink
578 }
579 if dpe.Mode != "" {
580 objectMap["mode"] = dpe.Mode
581 }
582 if dpe.DebugSetting != nil {
583 objectMap["debugSetting"] = dpe.DebugSetting
584 }
585 if dpe.OnErrorDeployment != nil {
586 objectMap["onErrorDeployment"] = dpe.OnErrorDeployment
587 }
588 return json.Marshal(objectMap)
589 }
590
591
592
593 type DeploymentsCreateOrUpdateAtManagementGroupScopeFuture struct {
594 azure.FutureAPI
595
596
597 Result func(DeploymentsClient) (DeploymentExtended, error)
598 }
599
600
601 func (future *DeploymentsCreateOrUpdateAtManagementGroupScopeFuture) UnmarshalJSON(body []byte) error {
602 var azFuture azure.Future
603 if err := json.Unmarshal(body, &azFuture); err != nil {
604 return err
605 }
606 future.FutureAPI = &azFuture
607 future.Result = future.result
608 return nil
609 }
610
611
612 func (future *DeploymentsCreateOrUpdateAtManagementGroupScopeFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
613 var done bool
614 done, err = future.DoneWithContext(context.Background(), client)
615 if err != nil {
616 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtManagementGroupScopeFuture", "Result", future.Response(), "Polling failure")
617 return
618 }
619 if !done {
620 de.Response.Response = future.Response()
621 err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateAtManagementGroupScopeFuture")
622 return
623 }
624 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
625 if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
626 de, err = client.CreateOrUpdateAtManagementGroupScopeResponder(de.Response.Response)
627 if err != nil {
628 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtManagementGroupScopeFuture", "Result", de.Response.Response, "Failure responding to request")
629 }
630 }
631 return
632 }
633
634
635
636 type DeploymentsCreateOrUpdateAtScopeFuture struct {
637 azure.FutureAPI
638
639
640 Result func(DeploymentsClient) (DeploymentExtended, error)
641 }
642
643
644 func (future *DeploymentsCreateOrUpdateAtScopeFuture) UnmarshalJSON(body []byte) error {
645 var azFuture azure.Future
646 if err := json.Unmarshal(body, &azFuture); err != nil {
647 return err
648 }
649 future.FutureAPI = &azFuture
650 future.Result = future.result
651 return nil
652 }
653
654
655 func (future *DeploymentsCreateOrUpdateAtScopeFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
656 var done bool
657 done, err = future.DoneWithContext(context.Background(), client)
658 if err != nil {
659 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtScopeFuture", "Result", future.Response(), "Polling failure")
660 return
661 }
662 if !done {
663 de.Response.Response = future.Response()
664 err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateAtScopeFuture")
665 return
666 }
667 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
668 if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
669 de, err = client.CreateOrUpdateAtScopeResponder(de.Response.Response)
670 if err != nil {
671 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtScopeFuture", "Result", de.Response.Response, "Failure responding to request")
672 }
673 }
674 return
675 }
676
677
678
679 type DeploymentsCreateOrUpdateAtSubscriptionScopeFuture struct {
680 azure.FutureAPI
681
682
683 Result func(DeploymentsClient) (DeploymentExtended, error)
684 }
685
686
687 func (future *DeploymentsCreateOrUpdateAtSubscriptionScopeFuture) UnmarshalJSON(body []byte) error {
688 var azFuture azure.Future
689 if err := json.Unmarshal(body, &azFuture); err != nil {
690 return err
691 }
692 future.FutureAPI = &azFuture
693 future.Result = future.result
694 return nil
695 }
696
697
698 func (future *DeploymentsCreateOrUpdateAtSubscriptionScopeFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
699 var done bool
700 done, err = future.DoneWithContext(context.Background(), client)
701 if err != nil {
702 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
703 return
704 }
705 if !done {
706 de.Response.Response = future.Response()
707 err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture")
708 return
709 }
710 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
711 if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
712 de, err = client.CreateOrUpdateAtSubscriptionScopeResponder(de.Response.Response)
713 if err != nil {
714 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture", "Result", de.Response.Response, "Failure responding to request")
715 }
716 }
717 return
718 }
719
720
721
722 type DeploymentsCreateOrUpdateAtTenantScopeFuture struct {
723 azure.FutureAPI
724
725
726 Result func(DeploymentsClient) (DeploymentExtended, error)
727 }
728
729
730 func (future *DeploymentsCreateOrUpdateAtTenantScopeFuture) UnmarshalJSON(body []byte) error {
731 var azFuture azure.Future
732 if err := json.Unmarshal(body, &azFuture); err != nil {
733 return err
734 }
735 future.FutureAPI = &azFuture
736 future.Result = future.result
737 return nil
738 }
739
740
741 func (future *DeploymentsCreateOrUpdateAtTenantScopeFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
742 var done bool
743 done, err = future.DoneWithContext(context.Background(), client)
744 if err != nil {
745 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtTenantScopeFuture", "Result", future.Response(), "Polling failure")
746 return
747 }
748 if !done {
749 de.Response.Response = future.Response()
750 err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateAtTenantScopeFuture")
751 return
752 }
753 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
754 if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
755 de, err = client.CreateOrUpdateAtTenantScopeResponder(de.Response.Response)
756 if err != nil {
757 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateAtTenantScopeFuture", "Result", de.Response.Response, "Failure responding to request")
758 }
759 }
760 return
761 }
762
763
764
765 type DeploymentsCreateOrUpdateFuture struct {
766 azure.FutureAPI
767
768
769 Result func(DeploymentsClient) (DeploymentExtended, error)
770 }
771
772
773 func (future *DeploymentsCreateOrUpdateFuture) 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 *DeploymentsCreateOrUpdateFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
785 var done bool
786 done, err = future.DoneWithContext(context.Background(), client)
787 if err != nil {
788 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
789 return
790 }
791 if !done {
792 de.Response.Response = future.Response()
793 err = azure.NewAsyncOpIncompleteError("features.DeploymentsCreateOrUpdateFuture")
794 return
795 }
796 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
797 if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
798 de, err = client.CreateOrUpdateResponder(de.Response.Response)
799 if err != nil {
800 err = autorest.NewErrorWithError(err, "features.DeploymentsCreateOrUpdateFuture", "Result", de.Response.Response, "Failure responding to request")
801 }
802 }
803 return
804 }
805
806
807
808 type DeploymentsDeleteAtManagementGroupScopeFuture struct {
809 azure.FutureAPI
810
811
812 Result func(DeploymentsClient) (autorest.Response, error)
813 }
814
815
816 func (future *DeploymentsDeleteAtManagementGroupScopeFuture) 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 *DeploymentsDeleteAtManagementGroupScopeFuture) result(client DeploymentsClient) (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, "features.DeploymentsDeleteAtManagementGroupScopeFuture", "Result", future.Response(), "Polling failure")
832 return
833 }
834 if !done {
835 ar.Response = future.Response()
836 err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteAtManagementGroupScopeFuture")
837 return
838 }
839 ar.Response = future.Response()
840 return
841 }
842
843
844
845 type DeploymentsDeleteAtScopeFuture struct {
846 azure.FutureAPI
847
848
849 Result func(DeploymentsClient) (autorest.Response, error)
850 }
851
852
853 func (future *DeploymentsDeleteAtScopeFuture) UnmarshalJSON(body []byte) error {
854 var azFuture azure.Future
855 if err := json.Unmarshal(body, &azFuture); err != nil {
856 return err
857 }
858 future.FutureAPI = &azFuture
859 future.Result = future.result
860 return nil
861 }
862
863
864 func (future *DeploymentsDeleteAtScopeFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
865 var done bool
866 done, err = future.DoneWithContext(context.Background(), client)
867 if err != nil {
868 err = autorest.NewErrorWithError(err, "features.DeploymentsDeleteAtScopeFuture", "Result", future.Response(), "Polling failure")
869 return
870 }
871 if !done {
872 ar.Response = future.Response()
873 err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteAtScopeFuture")
874 return
875 }
876 ar.Response = future.Response()
877 return
878 }
879
880
881
882 type DeploymentsDeleteAtSubscriptionScopeFuture struct {
883 azure.FutureAPI
884
885
886 Result func(DeploymentsClient) (autorest.Response, error)
887 }
888
889
890 func (future *DeploymentsDeleteAtSubscriptionScopeFuture) UnmarshalJSON(body []byte) error {
891 var azFuture azure.Future
892 if err := json.Unmarshal(body, &azFuture); err != nil {
893 return err
894 }
895 future.FutureAPI = &azFuture
896 future.Result = future.result
897 return nil
898 }
899
900
901 func (future *DeploymentsDeleteAtSubscriptionScopeFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
902 var done bool
903 done, err = future.DoneWithContext(context.Background(), client)
904 if err != nil {
905 err = autorest.NewErrorWithError(err, "features.DeploymentsDeleteAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
906 return
907 }
908 if !done {
909 ar.Response = future.Response()
910 err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteAtSubscriptionScopeFuture")
911 return
912 }
913 ar.Response = future.Response()
914 return
915 }
916
917
918
919 type DeploymentsDeleteAtTenantScopeFuture struct {
920 azure.FutureAPI
921
922
923 Result func(DeploymentsClient) (autorest.Response, error)
924 }
925
926
927 func (future *DeploymentsDeleteAtTenantScopeFuture) UnmarshalJSON(body []byte) error {
928 var azFuture azure.Future
929 if err := json.Unmarshal(body, &azFuture); err != nil {
930 return err
931 }
932 future.FutureAPI = &azFuture
933 future.Result = future.result
934 return nil
935 }
936
937
938 func (future *DeploymentsDeleteAtTenantScopeFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
939 var done bool
940 done, err = future.DoneWithContext(context.Background(), client)
941 if err != nil {
942 err = autorest.NewErrorWithError(err, "features.DeploymentsDeleteAtTenantScopeFuture", "Result", future.Response(), "Polling failure")
943 return
944 }
945 if !done {
946 ar.Response = future.Response()
947 err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteAtTenantScopeFuture")
948 return
949 }
950 ar.Response = future.Response()
951 return
952 }
953
954
955
956 type DeploymentsDeleteFuture struct {
957 azure.FutureAPI
958
959
960 Result func(DeploymentsClient) (autorest.Response, error)
961 }
962
963
964 func (future *DeploymentsDeleteFuture) UnmarshalJSON(body []byte) error {
965 var azFuture azure.Future
966 if err := json.Unmarshal(body, &azFuture); err != nil {
967 return err
968 }
969 future.FutureAPI = &azFuture
970 future.Result = future.result
971 return nil
972 }
973
974
975 func (future *DeploymentsDeleteFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
976 var done bool
977 done, err = future.DoneWithContext(context.Background(), client)
978 if err != nil {
979 err = autorest.NewErrorWithError(err, "features.DeploymentsDeleteFuture", "Result", future.Response(), "Polling failure")
980 return
981 }
982 if !done {
983 ar.Response = future.Response()
984 err = azure.NewAsyncOpIncompleteError("features.DeploymentsDeleteFuture")
985 return
986 }
987 ar.Response = future.Response()
988 return
989 }
990
991
992
993 type DeploymentsWhatIfAtSubscriptionScopeFuture struct {
994 azure.FutureAPI
995
996
997 Result func(DeploymentsClient) (WhatIfOperationResult, error)
998 }
999
1000
1001 func (future *DeploymentsWhatIfAtSubscriptionScopeFuture) UnmarshalJSON(body []byte) error {
1002 var azFuture azure.Future
1003 if err := json.Unmarshal(body, &azFuture); err != nil {
1004 return err
1005 }
1006 future.FutureAPI = &azFuture
1007 future.Result = future.result
1008 return nil
1009 }
1010
1011
1012 func (future *DeploymentsWhatIfAtSubscriptionScopeFuture) result(client DeploymentsClient) (wior WhatIfOperationResult, err error) {
1013 var done bool
1014 done, err = future.DoneWithContext(context.Background(), client)
1015 if err != nil {
1016 err = autorest.NewErrorWithError(err, "features.DeploymentsWhatIfAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
1017 return
1018 }
1019 if !done {
1020 wior.Response.Response = future.Response()
1021 err = azure.NewAsyncOpIncompleteError("features.DeploymentsWhatIfAtSubscriptionScopeFuture")
1022 return
1023 }
1024 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1025 if wior.Response.Response, err = future.GetResult(sender); err == nil && wior.Response.Response.StatusCode != http.StatusNoContent {
1026 wior, err = client.WhatIfAtSubscriptionScopeResponder(wior.Response.Response)
1027 if err != nil {
1028 err = autorest.NewErrorWithError(err, "features.DeploymentsWhatIfAtSubscriptionScopeFuture", "Result", wior.Response.Response, "Failure responding to request")
1029 }
1030 }
1031 return
1032 }
1033
1034
1035
1036 type DeploymentsWhatIfFuture struct {
1037 azure.FutureAPI
1038
1039
1040 Result func(DeploymentsClient) (WhatIfOperationResult, error)
1041 }
1042
1043
1044 func (future *DeploymentsWhatIfFuture) UnmarshalJSON(body []byte) error {
1045 var azFuture azure.Future
1046 if err := json.Unmarshal(body, &azFuture); err != nil {
1047 return err
1048 }
1049 future.FutureAPI = &azFuture
1050 future.Result = future.result
1051 return nil
1052 }
1053
1054
1055 func (future *DeploymentsWhatIfFuture) result(client DeploymentsClient) (wior WhatIfOperationResult, err error) {
1056 var done bool
1057 done, err = future.DoneWithContext(context.Background(), client)
1058 if err != nil {
1059 err = autorest.NewErrorWithError(err, "features.DeploymentsWhatIfFuture", "Result", future.Response(), "Polling failure")
1060 return
1061 }
1062 if !done {
1063 wior.Response.Response = future.Response()
1064 err = azure.NewAsyncOpIncompleteError("features.DeploymentsWhatIfFuture")
1065 return
1066 }
1067 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1068 if wior.Response.Response, err = future.GetResult(sender); err == nil && wior.Response.Response.StatusCode != http.StatusNoContent {
1069 wior, err = client.WhatIfResponder(wior.Response.Response)
1070 if err != nil {
1071 err = autorest.NewErrorWithError(err, "features.DeploymentsWhatIfFuture", "Result", wior.Response.Response, "Failure responding to request")
1072 }
1073 }
1074 return
1075 }
1076
1077
1078 type DeploymentValidateResult struct {
1079 autorest.Response `json:"-"`
1080
1081 Error *ErrorResponse `json:"error,omitempty"`
1082
1083 Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
1084 }
1085
1086
1087 type DeploymentWhatIf struct {
1088
1089 Location *string `json:"location,omitempty"`
1090
1091 Properties *DeploymentWhatIfProperties `json:"properties,omitempty"`
1092 }
1093
1094
1095 type DeploymentWhatIfProperties struct {
1096
1097 WhatIfSettings *DeploymentWhatIfSettings `json:"whatIfSettings,omitempty"`
1098
1099 Template interface{} `json:"template,omitempty"`
1100
1101 TemplateLink *TemplateLink `json:"templateLink,omitempty"`
1102
1103 Parameters interface{} `json:"parameters,omitempty"`
1104
1105 ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
1106
1107 Mode DeploymentMode `json:"mode,omitempty"`
1108
1109 DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
1110
1111 OnErrorDeployment *OnErrorDeployment `json:"onErrorDeployment,omitempty"`
1112 }
1113
1114
1115 type DeploymentWhatIfSettings struct {
1116
1117 ResultFormat WhatIfResultFormat `json:"resultFormat,omitempty"`
1118 }
1119
1120
1121 type ErrorAdditionalInfo struct {
1122
1123 Type *string `json:"type,omitempty"`
1124
1125 Info interface{} `json:"info,omitempty"`
1126 }
1127
1128
1129 func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
1130 objectMap := make(map[string]interface{})
1131 return json.Marshal(objectMap)
1132 }
1133
1134
1135
1136 type ErrorResponse struct {
1137
1138 Code *string `json:"code,omitempty"`
1139
1140 Message *string `json:"message,omitempty"`
1141
1142 Target *string `json:"target,omitempty"`
1143
1144 Details *[]ErrorResponse `json:"details,omitempty"`
1145
1146 AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
1147 }
1148
1149
1150 func (er ErrorResponse) MarshalJSON() ([]byte, error) {
1151 objectMap := make(map[string]interface{})
1152 return json.Marshal(objectMap)
1153 }
1154
1155
1156 type ExportTemplateRequest struct {
1157
1158 Resources *[]string `json:"resources,omitempty"`
1159
1160 Options *string `json:"options,omitempty"`
1161 }
1162
1163
1164 type GenericResource struct {
1165 autorest.Response `json:"-"`
1166
1167 Plan *Plan `json:"plan,omitempty"`
1168
1169 Properties interface{} `json:"properties,omitempty"`
1170
1171 Kind *string `json:"kind,omitempty"`
1172
1173 ManagedBy *string `json:"managedBy,omitempty"`
1174
1175 Sku *Sku `json:"sku,omitempty"`
1176
1177 Identity *Identity `json:"identity,omitempty"`
1178
1179 ID *string `json:"id,omitempty"`
1180
1181 Name *string `json:"name,omitempty"`
1182
1183 Type *string `json:"type,omitempty"`
1184
1185 Location *string `json:"location,omitempty"`
1186
1187 Tags map[string]*string `json:"tags"`
1188 }
1189
1190
1191 func (gr GenericResource) MarshalJSON() ([]byte, error) {
1192 objectMap := make(map[string]interface{})
1193 if gr.Plan != nil {
1194 objectMap["plan"] = gr.Plan
1195 }
1196 if gr.Properties != nil {
1197 objectMap["properties"] = gr.Properties
1198 }
1199 if gr.Kind != nil {
1200 objectMap["kind"] = gr.Kind
1201 }
1202 if gr.ManagedBy != nil {
1203 objectMap["managedBy"] = gr.ManagedBy
1204 }
1205 if gr.Sku != nil {
1206 objectMap["sku"] = gr.Sku
1207 }
1208 if gr.Identity != nil {
1209 objectMap["identity"] = gr.Identity
1210 }
1211 if gr.Location != nil {
1212 objectMap["location"] = gr.Location
1213 }
1214 if gr.Tags != nil {
1215 objectMap["tags"] = gr.Tags
1216 }
1217 return json.Marshal(objectMap)
1218 }
1219
1220
1221 type GenericResourceExpanded struct {
1222
1223 CreatedTime *date.Time `json:"createdTime,omitempty"`
1224
1225 ChangedTime *date.Time `json:"changedTime,omitempty"`
1226
1227 ProvisioningState *string `json:"provisioningState,omitempty"`
1228
1229 Plan *Plan `json:"plan,omitempty"`
1230
1231 Properties interface{} `json:"properties,omitempty"`
1232
1233 Kind *string `json:"kind,omitempty"`
1234
1235 ManagedBy *string `json:"managedBy,omitempty"`
1236
1237 Sku *Sku `json:"sku,omitempty"`
1238
1239 Identity *Identity `json:"identity,omitempty"`
1240
1241 ID *string `json:"id,omitempty"`
1242
1243 Name *string `json:"name,omitempty"`
1244
1245 Type *string `json:"type,omitempty"`
1246
1247 Location *string `json:"location,omitempty"`
1248
1249 Tags map[string]*string `json:"tags"`
1250 }
1251
1252
1253 func (gre GenericResourceExpanded) MarshalJSON() ([]byte, error) {
1254 objectMap := make(map[string]interface{})
1255 if gre.Plan != nil {
1256 objectMap["plan"] = gre.Plan
1257 }
1258 if gre.Properties != nil {
1259 objectMap["properties"] = gre.Properties
1260 }
1261 if gre.Kind != nil {
1262 objectMap["kind"] = gre.Kind
1263 }
1264 if gre.ManagedBy != nil {
1265 objectMap["managedBy"] = gre.ManagedBy
1266 }
1267 if gre.Sku != nil {
1268 objectMap["sku"] = gre.Sku
1269 }
1270 if gre.Identity != nil {
1271 objectMap["identity"] = gre.Identity
1272 }
1273 if gre.Location != nil {
1274 objectMap["location"] = gre.Location
1275 }
1276 if gre.Tags != nil {
1277 objectMap["tags"] = gre.Tags
1278 }
1279 return json.Marshal(objectMap)
1280 }
1281
1282
1283 type GenericResourceFilter struct {
1284
1285 ResourceType *string `json:"resourceType,omitempty"`
1286
1287 Tagname *string `json:"tagname,omitempty"`
1288
1289 Tagvalue *string `json:"tagvalue,omitempty"`
1290 }
1291
1292
1293 type HTTPMessage struct {
1294
1295 Content interface{} `json:"content,omitempty"`
1296 }
1297
1298
1299 type Identity struct {
1300
1301 PrincipalID *string `json:"principalId,omitempty"`
1302
1303 TenantID *string `json:"tenantId,omitempty"`
1304
1305 Type ResourceIdentityType `json:"type,omitempty"`
1306
1307 UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
1308 }
1309
1310
1311 func (i Identity) MarshalJSON() ([]byte, error) {
1312 objectMap := make(map[string]interface{})
1313 if i.Type != "" {
1314 objectMap["type"] = i.Type
1315 }
1316 if i.UserAssignedIdentities != nil {
1317 objectMap["userAssignedIdentities"] = i.UserAssignedIdentities
1318 }
1319 return json.Marshal(objectMap)
1320 }
1321
1322
1323 type IdentityUserAssignedIdentitiesValue struct {
1324
1325 PrincipalID *string `json:"principalId,omitempty"`
1326
1327 ClientID *string `json:"clientId,omitempty"`
1328 }
1329
1330
1331 func (iAiv IdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
1332 objectMap := make(map[string]interface{})
1333 return json.Marshal(objectMap)
1334 }
1335
1336
1337 type OnErrorDeployment struct {
1338
1339 Type OnErrorDeploymentType `json:"type,omitempty"`
1340
1341 DeploymentName *string `json:"deploymentName,omitempty"`
1342 }
1343
1344
1345 type OnErrorDeploymentExtended struct {
1346
1347 ProvisioningState *string `json:"provisioningState,omitempty"`
1348
1349 Type OnErrorDeploymentType `json:"type,omitempty"`
1350
1351 DeploymentName *string `json:"deploymentName,omitempty"`
1352 }
1353
1354
1355 func (oede OnErrorDeploymentExtended) MarshalJSON() ([]byte, error) {
1356 objectMap := make(map[string]interface{})
1357 if oede.Type != "" {
1358 objectMap["type"] = oede.Type
1359 }
1360 if oede.DeploymentName != nil {
1361 objectMap["deploymentName"] = oede.DeploymentName
1362 }
1363 return json.Marshal(objectMap)
1364 }
1365
1366
1367 type Operation struct {
1368
1369 Name *string `json:"name,omitempty"`
1370
1371 Display *OperationDisplay `json:"display,omitempty"`
1372 }
1373
1374
1375 type OperationDisplay struct {
1376
1377 Provider *string `json:"provider,omitempty"`
1378
1379 Resource *string `json:"resource,omitempty"`
1380
1381 Operation *string `json:"operation,omitempty"`
1382
1383 Description *string `json:"description,omitempty"`
1384 }
1385
1386
1387
1388 type OperationListResult struct {
1389 autorest.Response `json:"-"`
1390
1391 Value *[]Operation `json:"value,omitempty"`
1392
1393 NextLink *string `json:"nextLink,omitempty"`
1394 }
1395
1396
1397 type OperationListResultIterator struct {
1398 i int
1399 page OperationListResultPage
1400 }
1401
1402
1403
1404 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1405 if tracing.IsEnabled() {
1406 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
1407 defer func() {
1408 sc := -1
1409 if iter.Response().Response.Response != nil {
1410 sc = iter.Response().Response.Response.StatusCode
1411 }
1412 tracing.EndSpan(ctx, sc, err)
1413 }()
1414 }
1415 iter.i++
1416 if iter.i < len(iter.page.Values()) {
1417 return nil
1418 }
1419 err = iter.page.NextWithContext(ctx)
1420 if err != nil {
1421 iter.i--
1422 return err
1423 }
1424 iter.i = 0
1425 return nil
1426 }
1427
1428
1429
1430
1431 func (iter *OperationListResultIterator) Next() error {
1432 return iter.NextWithContext(context.Background())
1433 }
1434
1435
1436 func (iter OperationListResultIterator) NotDone() bool {
1437 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1438 }
1439
1440
1441 func (iter OperationListResultIterator) Response() OperationListResult {
1442 return iter.page.Response()
1443 }
1444
1445
1446
1447 func (iter OperationListResultIterator) Value() Operation {
1448 if !iter.page.NotDone() {
1449 return Operation{}
1450 }
1451 return iter.page.Values()[iter.i]
1452 }
1453
1454
1455 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
1456 return OperationListResultIterator{page: page}
1457 }
1458
1459
1460 func (olr OperationListResult) IsEmpty() bool {
1461 return olr.Value == nil || len(*olr.Value) == 0
1462 }
1463
1464
1465 func (olr OperationListResult) hasNextLink() bool {
1466 return olr.NextLink != nil && len(*olr.NextLink) != 0
1467 }
1468
1469
1470
1471 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
1472 if !olr.hasNextLink() {
1473 return nil, nil
1474 }
1475 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1476 autorest.AsJSON(),
1477 autorest.AsGet(),
1478 autorest.WithBaseURL(to.String(olr.NextLink)))
1479 }
1480
1481
1482 type OperationListResultPage struct {
1483 fn func(context.Context, OperationListResult) (OperationListResult, error)
1484 olr OperationListResult
1485 }
1486
1487
1488
1489 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1490 if tracing.IsEnabled() {
1491 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
1492 defer func() {
1493 sc := -1
1494 if page.Response().Response.Response != nil {
1495 sc = page.Response().Response.Response.StatusCode
1496 }
1497 tracing.EndSpan(ctx, sc, err)
1498 }()
1499 }
1500 for {
1501 next, err := page.fn(ctx, page.olr)
1502 if err != nil {
1503 return err
1504 }
1505 page.olr = next
1506 if !next.hasNextLink() || !next.IsEmpty() {
1507 break
1508 }
1509 }
1510 return nil
1511 }
1512
1513
1514
1515
1516 func (page *OperationListResultPage) Next() error {
1517 return page.NextWithContext(context.Background())
1518 }
1519
1520
1521 func (page OperationListResultPage) NotDone() bool {
1522 return !page.olr.IsEmpty()
1523 }
1524
1525
1526 func (page OperationListResultPage) Response() OperationListResult {
1527 return page.olr
1528 }
1529
1530
1531 func (page OperationListResultPage) Values() []Operation {
1532 if page.olr.IsEmpty() {
1533 return nil
1534 }
1535 return *page.olr.Value
1536 }
1537
1538
1539 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
1540 return OperationListResultPage{
1541 fn: getNextPage,
1542 olr: cur,
1543 }
1544 }
1545
1546
1547 type ParametersLink struct {
1548
1549 URI *string `json:"uri,omitempty"`
1550
1551 ContentVersion *string `json:"contentVersion,omitempty"`
1552 }
1553
1554
1555 type Plan struct {
1556
1557 Name *string `json:"name,omitempty"`
1558
1559 Publisher *string `json:"publisher,omitempty"`
1560
1561 Product *string `json:"product,omitempty"`
1562
1563 PromotionCode *string `json:"promotionCode,omitempty"`
1564
1565 Version *string `json:"version,omitempty"`
1566 }
1567
1568
1569 type Provider struct {
1570 autorest.Response `json:"-"`
1571
1572 ID *string `json:"id,omitempty"`
1573
1574 Namespace *string `json:"namespace,omitempty"`
1575
1576 RegistrationState *string `json:"registrationState,omitempty"`
1577
1578 RegistrationPolicy *string `json:"registrationPolicy,omitempty"`
1579
1580 ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"`
1581 }
1582
1583
1584 func (p Provider) MarshalJSON() ([]byte, error) {
1585 objectMap := make(map[string]interface{})
1586 if p.Namespace != nil {
1587 objectMap["namespace"] = p.Namespace
1588 }
1589 return json.Marshal(objectMap)
1590 }
1591
1592
1593 type ProviderListResult struct {
1594 autorest.Response `json:"-"`
1595
1596 Value *[]Provider `json:"value,omitempty"`
1597
1598 NextLink *string `json:"nextLink,omitempty"`
1599 }
1600
1601
1602 func (plr ProviderListResult) MarshalJSON() ([]byte, error) {
1603 objectMap := make(map[string]interface{})
1604 if plr.Value != nil {
1605 objectMap["value"] = plr.Value
1606 }
1607 return json.Marshal(objectMap)
1608 }
1609
1610
1611 type ProviderListResultIterator struct {
1612 i int
1613 page ProviderListResultPage
1614 }
1615
1616
1617
1618 func (iter *ProviderListResultIterator) NextWithContext(ctx context.Context) (err error) {
1619 if tracing.IsEnabled() {
1620 ctx = tracing.StartSpan(ctx, fqdn+"/ProviderListResultIterator.NextWithContext")
1621 defer func() {
1622 sc := -1
1623 if iter.Response().Response.Response != nil {
1624 sc = iter.Response().Response.Response.StatusCode
1625 }
1626 tracing.EndSpan(ctx, sc, err)
1627 }()
1628 }
1629 iter.i++
1630 if iter.i < len(iter.page.Values()) {
1631 return nil
1632 }
1633 err = iter.page.NextWithContext(ctx)
1634 if err != nil {
1635 iter.i--
1636 return err
1637 }
1638 iter.i = 0
1639 return nil
1640 }
1641
1642
1643
1644
1645 func (iter *ProviderListResultIterator) Next() error {
1646 return iter.NextWithContext(context.Background())
1647 }
1648
1649
1650 func (iter ProviderListResultIterator) NotDone() bool {
1651 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1652 }
1653
1654
1655 func (iter ProviderListResultIterator) Response() ProviderListResult {
1656 return iter.page.Response()
1657 }
1658
1659
1660
1661 func (iter ProviderListResultIterator) Value() Provider {
1662 if !iter.page.NotDone() {
1663 return Provider{}
1664 }
1665 return iter.page.Values()[iter.i]
1666 }
1667
1668
1669 func NewProviderListResultIterator(page ProviderListResultPage) ProviderListResultIterator {
1670 return ProviderListResultIterator{page: page}
1671 }
1672
1673
1674 func (plr ProviderListResult) IsEmpty() bool {
1675 return plr.Value == nil || len(*plr.Value) == 0
1676 }
1677
1678
1679 func (plr ProviderListResult) hasNextLink() bool {
1680 return plr.NextLink != nil && len(*plr.NextLink) != 0
1681 }
1682
1683
1684
1685 func (plr ProviderListResult) providerListResultPreparer(ctx context.Context) (*http.Request, error) {
1686 if !plr.hasNextLink() {
1687 return nil, nil
1688 }
1689 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1690 autorest.AsJSON(),
1691 autorest.AsGet(),
1692 autorest.WithBaseURL(to.String(plr.NextLink)))
1693 }
1694
1695
1696 type ProviderListResultPage struct {
1697 fn func(context.Context, ProviderListResult) (ProviderListResult, error)
1698 plr ProviderListResult
1699 }
1700
1701
1702
1703 func (page *ProviderListResultPage) NextWithContext(ctx context.Context) (err error) {
1704 if tracing.IsEnabled() {
1705 ctx = tracing.StartSpan(ctx, fqdn+"/ProviderListResultPage.NextWithContext")
1706 defer func() {
1707 sc := -1
1708 if page.Response().Response.Response != nil {
1709 sc = page.Response().Response.Response.StatusCode
1710 }
1711 tracing.EndSpan(ctx, sc, err)
1712 }()
1713 }
1714 for {
1715 next, err := page.fn(ctx, page.plr)
1716 if err != nil {
1717 return err
1718 }
1719 page.plr = next
1720 if !next.hasNextLink() || !next.IsEmpty() {
1721 break
1722 }
1723 }
1724 return nil
1725 }
1726
1727
1728
1729
1730 func (page *ProviderListResultPage) Next() error {
1731 return page.NextWithContext(context.Background())
1732 }
1733
1734
1735 func (page ProviderListResultPage) NotDone() bool {
1736 return !page.plr.IsEmpty()
1737 }
1738
1739
1740 func (page ProviderListResultPage) Response() ProviderListResult {
1741 return page.plr
1742 }
1743
1744
1745 func (page ProviderListResultPage) Values() []Provider {
1746 if page.plr.IsEmpty() {
1747 return nil
1748 }
1749 return *page.plr.Value
1750 }
1751
1752
1753 func NewProviderListResultPage(cur ProviderListResult, getNextPage func(context.Context, ProviderListResult) (ProviderListResult, error)) ProviderListResultPage {
1754 return ProviderListResultPage{
1755 fn: getNextPage,
1756 plr: cur,
1757 }
1758 }
1759
1760
1761 type ProviderResourceType struct {
1762
1763 ResourceType *string `json:"resourceType,omitempty"`
1764
1765 Locations *[]string `json:"locations,omitempty"`
1766
1767 Aliases *[]AliasType `json:"aliases,omitempty"`
1768
1769 APIVersions *[]string `json:"apiVersions,omitempty"`
1770
1771 Capabilities *string `json:"capabilities,omitempty"`
1772
1773 Properties map[string]*string `json:"properties"`
1774 }
1775
1776
1777 func (prt ProviderResourceType) MarshalJSON() ([]byte, error) {
1778 objectMap := make(map[string]interface{})
1779 if prt.ResourceType != nil {
1780 objectMap["resourceType"] = prt.ResourceType
1781 }
1782 if prt.Locations != nil {
1783 objectMap["locations"] = prt.Locations
1784 }
1785 if prt.Aliases != nil {
1786 objectMap["aliases"] = prt.Aliases
1787 }
1788 if prt.APIVersions != nil {
1789 objectMap["apiVersions"] = prt.APIVersions
1790 }
1791 if prt.Capabilities != nil {
1792 objectMap["capabilities"] = prt.Capabilities
1793 }
1794 if prt.Properties != nil {
1795 objectMap["properties"] = prt.Properties
1796 }
1797 return json.Marshal(objectMap)
1798 }
1799
1800
1801 type Resource struct {
1802
1803 ID *string `json:"id,omitempty"`
1804
1805 Name *string `json:"name,omitempty"`
1806
1807 Type *string `json:"type,omitempty"`
1808
1809 Location *string `json:"location,omitempty"`
1810
1811 Tags map[string]*string `json:"tags"`
1812 }
1813
1814
1815 func (r Resource) MarshalJSON() ([]byte, error) {
1816 objectMap := make(map[string]interface{})
1817 if r.Location != nil {
1818 objectMap["location"] = r.Location
1819 }
1820 if r.Tags != nil {
1821 objectMap["tags"] = r.Tags
1822 }
1823 return json.Marshal(objectMap)
1824 }
1825
1826
1827 type ResourceGroup struct {
1828 autorest.Response `json:"-"`
1829
1830 ID *string `json:"id,omitempty"`
1831
1832 Name *string `json:"name,omitempty"`
1833
1834 Type *string `json:"type,omitempty"`
1835
1836 Properties *ResourceGroupProperties `json:"properties,omitempty"`
1837
1838 Location *string `json:"location,omitempty"`
1839
1840 ManagedBy *string `json:"managedBy,omitempty"`
1841
1842 Tags map[string]*string `json:"tags"`
1843 }
1844
1845
1846 func (rg ResourceGroup) MarshalJSON() ([]byte, error) {
1847 objectMap := make(map[string]interface{})
1848 if rg.Properties != nil {
1849 objectMap["properties"] = rg.Properties
1850 }
1851 if rg.Location != nil {
1852 objectMap["location"] = rg.Location
1853 }
1854 if rg.ManagedBy != nil {
1855 objectMap["managedBy"] = rg.ManagedBy
1856 }
1857 if rg.Tags != nil {
1858 objectMap["tags"] = rg.Tags
1859 }
1860 return json.Marshal(objectMap)
1861 }
1862
1863
1864 type ResourceGroupExportResult struct {
1865 autorest.Response `json:"-"`
1866
1867 Template interface{} `json:"template,omitempty"`
1868
1869 Error *ErrorResponse `json:"error,omitempty"`
1870 }
1871
1872
1873 type ResourceGroupFilter struct {
1874
1875 TagName *string `json:"tagName,omitempty"`
1876
1877 TagValue *string `json:"tagValue,omitempty"`
1878 }
1879
1880
1881 type ResourceGroupListResult struct {
1882 autorest.Response `json:"-"`
1883
1884 Value *[]ResourceGroup `json:"value,omitempty"`
1885
1886 NextLink *string `json:"nextLink,omitempty"`
1887 }
1888
1889
1890 func (rglr ResourceGroupListResult) MarshalJSON() ([]byte, error) {
1891 objectMap := make(map[string]interface{})
1892 if rglr.Value != nil {
1893 objectMap["value"] = rglr.Value
1894 }
1895 return json.Marshal(objectMap)
1896 }
1897
1898
1899 type ResourceGroupListResultIterator struct {
1900 i int
1901 page ResourceGroupListResultPage
1902 }
1903
1904
1905
1906 func (iter *ResourceGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
1907 if tracing.IsEnabled() {
1908 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGroupListResultIterator.NextWithContext")
1909 defer func() {
1910 sc := -1
1911 if iter.Response().Response.Response != nil {
1912 sc = iter.Response().Response.Response.StatusCode
1913 }
1914 tracing.EndSpan(ctx, sc, err)
1915 }()
1916 }
1917 iter.i++
1918 if iter.i < len(iter.page.Values()) {
1919 return nil
1920 }
1921 err = iter.page.NextWithContext(ctx)
1922 if err != nil {
1923 iter.i--
1924 return err
1925 }
1926 iter.i = 0
1927 return nil
1928 }
1929
1930
1931
1932
1933 func (iter *ResourceGroupListResultIterator) Next() error {
1934 return iter.NextWithContext(context.Background())
1935 }
1936
1937
1938 func (iter ResourceGroupListResultIterator) NotDone() bool {
1939 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1940 }
1941
1942
1943 func (iter ResourceGroupListResultIterator) Response() ResourceGroupListResult {
1944 return iter.page.Response()
1945 }
1946
1947
1948
1949 func (iter ResourceGroupListResultIterator) Value() ResourceGroup {
1950 if !iter.page.NotDone() {
1951 return ResourceGroup{}
1952 }
1953 return iter.page.Values()[iter.i]
1954 }
1955
1956
1957 func NewResourceGroupListResultIterator(page ResourceGroupListResultPage) ResourceGroupListResultIterator {
1958 return ResourceGroupListResultIterator{page: page}
1959 }
1960
1961
1962 func (rglr ResourceGroupListResult) IsEmpty() bool {
1963 return rglr.Value == nil || len(*rglr.Value) == 0
1964 }
1965
1966
1967 func (rglr ResourceGroupListResult) hasNextLink() bool {
1968 return rglr.NextLink != nil && len(*rglr.NextLink) != 0
1969 }
1970
1971
1972
1973 func (rglr ResourceGroupListResult) resourceGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
1974 if !rglr.hasNextLink() {
1975 return nil, nil
1976 }
1977 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1978 autorest.AsJSON(),
1979 autorest.AsGet(),
1980 autorest.WithBaseURL(to.String(rglr.NextLink)))
1981 }
1982
1983
1984 type ResourceGroupListResultPage struct {
1985 fn func(context.Context, ResourceGroupListResult) (ResourceGroupListResult, error)
1986 rglr ResourceGroupListResult
1987 }
1988
1989
1990
1991 func (page *ResourceGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
1992 if tracing.IsEnabled() {
1993 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGroupListResultPage.NextWithContext")
1994 defer func() {
1995 sc := -1
1996 if page.Response().Response.Response != nil {
1997 sc = page.Response().Response.Response.StatusCode
1998 }
1999 tracing.EndSpan(ctx, sc, err)
2000 }()
2001 }
2002 for {
2003 next, err := page.fn(ctx, page.rglr)
2004 if err != nil {
2005 return err
2006 }
2007 page.rglr = next
2008 if !next.hasNextLink() || !next.IsEmpty() {
2009 break
2010 }
2011 }
2012 return nil
2013 }
2014
2015
2016
2017
2018 func (page *ResourceGroupListResultPage) Next() error {
2019 return page.NextWithContext(context.Background())
2020 }
2021
2022
2023 func (page ResourceGroupListResultPage) NotDone() bool {
2024 return !page.rglr.IsEmpty()
2025 }
2026
2027
2028 func (page ResourceGroupListResultPage) Response() ResourceGroupListResult {
2029 return page.rglr
2030 }
2031
2032
2033 func (page ResourceGroupListResultPage) Values() []ResourceGroup {
2034 if page.rglr.IsEmpty() {
2035 return nil
2036 }
2037 return *page.rglr.Value
2038 }
2039
2040
2041 func NewResourceGroupListResultPage(cur ResourceGroupListResult, getNextPage func(context.Context, ResourceGroupListResult) (ResourceGroupListResult, error)) ResourceGroupListResultPage {
2042 return ResourceGroupListResultPage{
2043 fn: getNextPage,
2044 rglr: cur,
2045 }
2046 }
2047
2048
2049 type ResourceGroupPatchable struct {
2050
2051 Name *string `json:"name,omitempty"`
2052
2053 Properties *ResourceGroupProperties `json:"properties,omitempty"`
2054
2055 ManagedBy *string `json:"managedBy,omitempty"`
2056
2057 Tags map[string]*string `json:"tags"`
2058 }
2059
2060
2061 func (rgp ResourceGroupPatchable) MarshalJSON() ([]byte, error) {
2062 objectMap := make(map[string]interface{})
2063 if rgp.Name != nil {
2064 objectMap["name"] = rgp.Name
2065 }
2066 if rgp.Properties != nil {
2067 objectMap["properties"] = rgp.Properties
2068 }
2069 if rgp.ManagedBy != nil {
2070 objectMap["managedBy"] = rgp.ManagedBy
2071 }
2072 if rgp.Tags != nil {
2073 objectMap["tags"] = rgp.Tags
2074 }
2075 return json.Marshal(objectMap)
2076 }
2077
2078
2079 type ResourceGroupProperties struct {
2080
2081 ProvisioningState *string `json:"provisioningState,omitempty"`
2082 }
2083
2084
2085 func (rgp ResourceGroupProperties) MarshalJSON() ([]byte, error) {
2086 objectMap := make(map[string]interface{})
2087 return json.Marshal(objectMap)
2088 }
2089
2090
2091
2092 type ResourceGroupsDeleteFuture struct {
2093 azure.FutureAPI
2094
2095
2096 Result func(ResourceGroupsClient) (autorest.Response, error)
2097 }
2098
2099
2100 func (future *ResourceGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
2101 var azFuture azure.Future
2102 if err := json.Unmarshal(body, &azFuture); err != nil {
2103 return err
2104 }
2105 future.FutureAPI = &azFuture
2106 future.Result = future.result
2107 return nil
2108 }
2109
2110
2111 func (future *ResourceGroupsDeleteFuture) result(client ResourceGroupsClient) (ar autorest.Response, err error) {
2112 var done bool
2113 done, err = future.DoneWithContext(context.Background(), client)
2114 if err != nil {
2115 err = autorest.NewErrorWithError(err, "features.ResourceGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
2116 return
2117 }
2118 if !done {
2119 ar.Response = future.Response()
2120 err = azure.NewAsyncOpIncompleteError("features.ResourceGroupsDeleteFuture")
2121 return
2122 }
2123 ar.Response = future.Response()
2124 return
2125 }
2126
2127
2128 type ResourceListResult struct {
2129 autorest.Response `json:"-"`
2130
2131 Value *[]GenericResourceExpanded `json:"value,omitempty"`
2132
2133 NextLink *string `json:"nextLink,omitempty"`
2134 }
2135
2136
2137 func (rlr ResourceListResult) MarshalJSON() ([]byte, error) {
2138 objectMap := make(map[string]interface{})
2139 if rlr.Value != nil {
2140 objectMap["value"] = rlr.Value
2141 }
2142 return json.Marshal(objectMap)
2143 }
2144
2145
2146 type ResourceListResultIterator struct {
2147 i int
2148 page ResourceListResultPage
2149 }
2150
2151
2152
2153 func (iter *ResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
2154 if tracing.IsEnabled() {
2155 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListResultIterator.NextWithContext")
2156 defer func() {
2157 sc := -1
2158 if iter.Response().Response.Response != nil {
2159 sc = iter.Response().Response.Response.StatusCode
2160 }
2161 tracing.EndSpan(ctx, sc, err)
2162 }()
2163 }
2164 iter.i++
2165 if iter.i < len(iter.page.Values()) {
2166 return nil
2167 }
2168 err = iter.page.NextWithContext(ctx)
2169 if err != nil {
2170 iter.i--
2171 return err
2172 }
2173 iter.i = 0
2174 return nil
2175 }
2176
2177
2178
2179
2180 func (iter *ResourceListResultIterator) Next() error {
2181 return iter.NextWithContext(context.Background())
2182 }
2183
2184
2185 func (iter ResourceListResultIterator) NotDone() bool {
2186 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2187 }
2188
2189
2190 func (iter ResourceListResultIterator) Response() ResourceListResult {
2191 return iter.page.Response()
2192 }
2193
2194
2195
2196 func (iter ResourceListResultIterator) Value() GenericResourceExpanded {
2197 if !iter.page.NotDone() {
2198 return GenericResourceExpanded{}
2199 }
2200 return iter.page.Values()[iter.i]
2201 }
2202
2203
2204 func NewResourceListResultIterator(page ResourceListResultPage) ResourceListResultIterator {
2205 return ResourceListResultIterator{page: page}
2206 }
2207
2208
2209 func (rlr ResourceListResult) IsEmpty() bool {
2210 return rlr.Value == nil || len(*rlr.Value) == 0
2211 }
2212
2213
2214 func (rlr ResourceListResult) hasNextLink() bool {
2215 return rlr.NextLink != nil && len(*rlr.NextLink) != 0
2216 }
2217
2218
2219
2220 func (rlr ResourceListResult) resourceListResultPreparer(ctx context.Context) (*http.Request, error) {
2221 if !rlr.hasNextLink() {
2222 return nil, nil
2223 }
2224 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2225 autorest.AsJSON(),
2226 autorest.AsGet(),
2227 autorest.WithBaseURL(to.String(rlr.NextLink)))
2228 }
2229
2230
2231 type ResourceListResultPage struct {
2232 fn func(context.Context, ResourceListResult) (ResourceListResult, error)
2233 rlr ResourceListResult
2234 }
2235
2236
2237
2238 func (page *ResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
2239 if tracing.IsEnabled() {
2240 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListResultPage.NextWithContext")
2241 defer func() {
2242 sc := -1
2243 if page.Response().Response.Response != nil {
2244 sc = page.Response().Response.Response.StatusCode
2245 }
2246 tracing.EndSpan(ctx, sc, err)
2247 }()
2248 }
2249 for {
2250 next, err := page.fn(ctx, page.rlr)
2251 if err != nil {
2252 return err
2253 }
2254 page.rlr = next
2255 if !next.hasNextLink() || !next.IsEmpty() {
2256 break
2257 }
2258 }
2259 return nil
2260 }
2261
2262
2263
2264
2265 func (page *ResourceListResultPage) Next() error {
2266 return page.NextWithContext(context.Background())
2267 }
2268
2269
2270 func (page ResourceListResultPage) NotDone() bool {
2271 return !page.rlr.IsEmpty()
2272 }
2273
2274
2275 func (page ResourceListResultPage) Response() ResourceListResult {
2276 return page.rlr
2277 }
2278
2279
2280 func (page ResourceListResultPage) Values() []GenericResourceExpanded {
2281 if page.rlr.IsEmpty() {
2282 return nil
2283 }
2284 return *page.rlr.Value
2285 }
2286
2287
2288 func NewResourceListResultPage(cur ResourceListResult, getNextPage func(context.Context, ResourceListResult) (ResourceListResult, error)) ResourceListResultPage {
2289 return ResourceListResultPage{
2290 fn: getNextPage,
2291 rlr: cur,
2292 }
2293 }
2294
2295
2296 type ResourceProviderOperationDisplayProperties struct {
2297
2298 Publisher *string `json:"publisher,omitempty"`
2299
2300 Provider *string `json:"provider,omitempty"`
2301
2302 Resource *string `json:"resource,omitempty"`
2303
2304 Operation *string `json:"operation,omitempty"`
2305
2306 Description *string `json:"description,omitempty"`
2307 }
2308
2309
2310
2311 type ResourcesCreateOrUpdateByIDFuture struct {
2312 azure.FutureAPI
2313
2314
2315 Result func(ResourcesClient) (GenericResource, error)
2316 }
2317
2318
2319 func (future *ResourcesCreateOrUpdateByIDFuture) UnmarshalJSON(body []byte) error {
2320 var azFuture azure.Future
2321 if err := json.Unmarshal(body, &azFuture); err != nil {
2322 return err
2323 }
2324 future.FutureAPI = &azFuture
2325 future.Result = future.result
2326 return nil
2327 }
2328
2329
2330 func (future *ResourcesCreateOrUpdateByIDFuture) result(client ResourcesClient) (gr GenericResource, err error) {
2331 var done bool
2332 done, err = future.DoneWithContext(context.Background(), client)
2333 if err != nil {
2334 err = autorest.NewErrorWithError(err, "features.ResourcesCreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure")
2335 return
2336 }
2337 if !done {
2338 gr.Response.Response = future.Response()
2339 err = azure.NewAsyncOpIncompleteError("features.ResourcesCreateOrUpdateByIDFuture")
2340 return
2341 }
2342 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2343 if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
2344 gr, err = client.CreateOrUpdateByIDResponder(gr.Response.Response)
2345 if err != nil {
2346 err = autorest.NewErrorWithError(err, "features.ResourcesCreateOrUpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
2347 }
2348 }
2349 return
2350 }
2351
2352
2353
2354 type ResourcesCreateOrUpdateFuture struct {
2355 azure.FutureAPI
2356
2357
2358 Result func(ResourcesClient) (GenericResource, error)
2359 }
2360
2361
2362 func (future *ResourcesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2363 var azFuture azure.Future
2364 if err := json.Unmarshal(body, &azFuture); err != nil {
2365 return err
2366 }
2367 future.FutureAPI = &azFuture
2368 future.Result = future.result
2369 return nil
2370 }
2371
2372
2373 func (future *ResourcesCreateOrUpdateFuture) result(client ResourcesClient) (gr GenericResource, err error) {
2374 var done bool
2375 done, err = future.DoneWithContext(context.Background(), client)
2376 if err != nil {
2377 err = autorest.NewErrorWithError(err, "features.ResourcesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2378 return
2379 }
2380 if !done {
2381 gr.Response.Response = future.Response()
2382 err = azure.NewAsyncOpIncompleteError("features.ResourcesCreateOrUpdateFuture")
2383 return
2384 }
2385 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2386 if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
2387 gr, err = client.CreateOrUpdateResponder(gr.Response.Response)
2388 if err != nil {
2389 err = autorest.NewErrorWithError(err, "features.ResourcesCreateOrUpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
2390 }
2391 }
2392 return
2393 }
2394
2395
2396
2397 type ResourcesDeleteByIDFuture struct {
2398 azure.FutureAPI
2399
2400
2401 Result func(ResourcesClient) (autorest.Response, error)
2402 }
2403
2404
2405 func (future *ResourcesDeleteByIDFuture) UnmarshalJSON(body []byte) error {
2406 var azFuture azure.Future
2407 if err := json.Unmarshal(body, &azFuture); err != nil {
2408 return err
2409 }
2410 future.FutureAPI = &azFuture
2411 future.Result = future.result
2412 return nil
2413 }
2414
2415
2416 func (future *ResourcesDeleteByIDFuture) result(client ResourcesClient) (ar autorest.Response, err error) {
2417 var done bool
2418 done, err = future.DoneWithContext(context.Background(), client)
2419 if err != nil {
2420 err = autorest.NewErrorWithError(err, "features.ResourcesDeleteByIDFuture", "Result", future.Response(), "Polling failure")
2421 return
2422 }
2423 if !done {
2424 ar.Response = future.Response()
2425 err = azure.NewAsyncOpIncompleteError("features.ResourcesDeleteByIDFuture")
2426 return
2427 }
2428 ar.Response = future.Response()
2429 return
2430 }
2431
2432
2433
2434 type ResourcesDeleteFuture struct {
2435 azure.FutureAPI
2436
2437
2438 Result func(ResourcesClient) (autorest.Response, error)
2439 }
2440
2441
2442 func (future *ResourcesDeleteFuture) UnmarshalJSON(body []byte) error {
2443 var azFuture azure.Future
2444 if err := json.Unmarshal(body, &azFuture); err != nil {
2445 return err
2446 }
2447 future.FutureAPI = &azFuture
2448 future.Result = future.result
2449 return nil
2450 }
2451
2452
2453 func (future *ResourcesDeleteFuture) result(client ResourcesClient) (ar autorest.Response, err error) {
2454 var done bool
2455 done, err = future.DoneWithContext(context.Background(), client)
2456 if err != nil {
2457 err = autorest.NewErrorWithError(err, "features.ResourcesDeleteFuture", "Result", future.Response(), "Polling failure")
2458 return
2459 }
2460 if !done {
2461 ar.Response = future.Response()
2462 err = azure.NewAsyncOpIncompleteError("features.ResourcesDeleteFuture")
2463 return
2464 }
2465 ar.Response = future.Response()
2466 return
2467 }
2468
2469
2470 type ResourcesMoveInfo struct {
2471
2472 Resources *[]string `json:"resources,omitempty"`
2473
2474 TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
2475 }
2476
2477
2478
2479 type ResourcesMoveResourcesFuture struct {
2480 azure.FutureAPI
2481
2482
2483 Result func(ResourcesClient) (autorest.Response, error)
2484 }
2485
2486
2487 func (future *ResourcesMoveResourcesFuture) UnmarshalJSON(body []byte) error {
2488 var azFuture azure.Future
2489 if err := json.Unmarshal(body, &azFuture); err != nil {
2490 return err
2491 }
2492 future.FutureAPI = &azFuture
2493 future.Result = future.result
2494 return nil
2495 }
2496
2497
2498 func (future *ResourcesMoveResourcesFuture) result(client ResourcesClient) (ar autorest.Response, err error) {
2499 var done bool
2500 done, err = future.DoneWithContext(context.Background(), client)
2501 if err != nil {
2502 err = autorest.NewErrorWithError(err, "features.ResourcesMoveResourcesFuture", "Result", future.Response(), "Polling failure")
2503 return
2504 }
2505 if !done {
2506 ar.Response = future.Response()
2507 err = azure.NewAsyncOpIncompleteError("features.ResourcesMoveResourcesFuture")
2508 return
2509 }
2510 ar.Response = future.Response()
2511 return
2512 }
2513
2514
2515
2516 type ResourcesUpdateByIDFuture struct {
2517 azure.FutureAPI
2518
2519
2520 Result func(ResourcesClient) (GenericResource, error)
2521 }
2522
2523
2524 func (future *ResourcesUpdateByIDFuture) UnmarshalJSON(body []byte) error {
2525 var azFuture azure.Future
2526 if err := json.Unmarshal(body, &azFuture); err != nil {
2527 return err
2528 }
2529 future.FutureAPI = &azFuture
2530 future.Result = future.result
2531 return nil
2532 }
2533
2534
2535 func (future *ResourcesUpdateByIDFuture) result(client ResourcesClient) (gr GenericResource, err error) {
2536 var done bool
2537 done, err = future.DoneWithContext(context.Background(), client)
2538 if err != nil {
2539 err = autorest.NewErrorWithError(err, "features.ResourcesUpdateByIDFuture", "Result", future.Response(), "Polling failure")
2540 return
2541 }
2542 if !done {
2543 gr.Response.Response = future.Response()
2544 err = azure.NewAsyncOpIncompleteError("features.ResourcesUpdateByIDFuture")
2545 return
2546 }
2547 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2548 if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
2549 gr, err = client.UpdateByIDResponder(gr.Response.Response)
2550 if err != nil {
2551 err = autorest.NewErrorWithError(err, "features.ResourcesUpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
2552 }
2553 }
2554 return
2555 }
2556
2557
2558
2559 type ResourcesUpdateFuture struct {
2560 azure.FutureAPI
2561
2562
2563 Result func(ResourcesClient) (GenericResource, error)
2564 }
2565
2566
2567 func (future *ResourcesUpdateFuture) UnmarshalJSON(body []byte) error {
2568 var azFuture azure.Future
2569 if err := json.Unmarshal(body, &azFuture); err != nil {
2570 return err
2571 }
2572 future.FutureAPI = &azFuture
2573 future.Result = future.result
2574 return nil
2575 }
2576
2577
2578 func (future *ResourcesUpdateFuture) result(client ResourcesClient) (gr GenericResource, err error) {
2579 var done bool
2580 done, err = future.DoneWithContext(context.Background(), client)
2581 if err != nil {
2582 err = autorest.NewErrorWithError(err, "features.ResourcesUpdateFuture", "Result", future.Response(), "Polling failure")
2583 return
2584 }
2585 if !done {
2586 gr.Response.Response = future.Response()
2587 err = azure.NewAsyncOpIncompleteError("features.ResourcesUpdateFuture")
2588 return
2589 }
2590 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2591 if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
2592 gr, err = client.UpdateResponder(gr.Response.Response)
2593 if err != nil {
2594 err = autorest.NewErrorWithError(err, "features.ResourcesUpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
2595 }
2596 }
2597 return
2598 }
2599
2600
2601
2602 type ResourcesValidateMoveResourcesFuture struct {
2603 azure.FutureAPI
2604
2605
2606 Result func(ResourcesClient) (autorest.Response, error)
2607 }
2608
2609
2610 func (future *ResourcesValidateMoveResourcesFuture) UnmarshalJSON(body []byte) error {
2611 var azFuture azure.Future
2612 if err := json.Unmarshal(body, &azFuture); err != nil {
2613 return err
2614 }
2615 future.FutureAPI = &azFuture
2616 future.Result = future.result
2617 return nil
2618 }
2619
2620
2621 func (future *ResourcesValidateMoveResourcesFuture) result(client ResourcesClient) (ar autorest.Response, err error) {
2622 var done bool
2623 done, err = future.DoneWithContext(context.Background(), client)
2624 if err != nil {
2625 err = autorest.NewErrorWithError(err, "features.ResourcesValidateMoveResourcesFuture", "Result", future.Response(), "Polling failure")
2626 return
2627 }
2628 if !done {
2629 ar.Response = future.Response()
2630 err = azure.NewAsyncOpIncompleteError("features.ResourcesValidateMoveResourcesFuture")
2631 return
2632 }
2633 ar.Response = future.Response()
2634 return
2635 }
2636
2637
2638 type Sku struct {
2639
2640 Name *string `json:"name,omitempty"`
2641
2642 Tier *string `json:"tier,omitempty"`
2643
2644 Size *string `json:"size,omitempty"`
2645
2646 Family *string `json:"family,omitempty"`
2647
2648 Model *string `json:"model,omitempty"`
2649
2650 Capacity *int32 `json:"capacity,omitempty"`
2651 }
2652
2653
2654 type SubResource struct {
2655
2656 ID *string `json:"id,omitempty"`
2657 }
2658
2659
2660 type TagCount struct {
2661
2662 Type *string `json:"type,omitempty"`
2663
2664 Value *int32 `json:"value,omitempty"`
2665 }
2666
2667
2668 type TagDetails struct {
2669 autorest.Response `json:"-"`
2670
2671 ID *string `json:"id,omitempty"`
2672
2673 TagName *string `json:"tagName,omitempty"`
2674
2675 Count *TagCount `json:"count,omitempty"`
2676
2677 Values *[]TagValue `json:"values,omitempty"`
2678 }
2679
2680
2681 func (td TagDetails) MarshalJSON() ([]byte, error) {
2682 objectMap := make(map[string]interface{})
2683 if td.TagName != nil {
2684 objectMap["tagName"] = td.TagName
2685 }
2686 if td.Count != nil {
2687 objectMap["count"] = td.Count
2688 }
2689 if td.Values != nil {
2690 objectMap["values"] = td.Values
2691 }
2692 return json.Marshal(objectMap)
2693 }
2694
2695
2696 type TagsListResult struct {
2697 autorest.Response `json:"-"`
2698
2699 Value *[]TagDetails `json:"value,omitempty"`
2700
2701 NextLink *string `json:"nextLink,omitempty"`
2702 }
2703
2704
2705 func (tlr TagsListResult) MarshalJSON() ([]byte, error) {
2706 objectMap := make(map[string]interface{})
2707 if tlr.Value != nil {
2708 objectMap["value"] = tlr.Value
2709 }
2710 return json.Marshal(objectMap)
2711 }
2712
2713
2714 type TagsListResultIterator struct {
2715 i int
2716 page TagsListResultPage
2717 }
2718
2719
2720
2721 func (iter *TagsListResultIterator) NextWithContext(ctx context.Context) (err error) {
2722 if tracing.IsEnabled() {
2723 ctx = tracing.StartSpan(ctx, fqdn+"/TagsListResultIterator.NextWithContext")
2724 defer func() {
2725 sc := -1
2726 if iter.Response().Response.Response != nil {
2727 sc = iter.Response().Response.Response.StatusCode
2728 }
2729 tracing.EndSpan(ctx, sc, err)
2730 }()
2731 }
2732 iter.i++
2733 if iter.i < len(iter.page.Values()) {
2734 return nil
2735 }
2736 err = iter.page.NextWithContext(ctx)
2737 if err != nil {
2738 iter.i--
2739 return err
2740 }
2741 iter.i = 0
2742 return nil
2743 }
2744
2745
2746
2747
2748 func (iter *TagsListResultIterator) Next() error {
2749 return iter.NextWithContext(context.Background())
2750 }
2751
2752
2753 func (iter TagsListResultIterator) NotDone() bool {
2754 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2755 }
2756
2757
2758 func (iter TagsListResultIterator) Response() TagsListResult {
2759 return iter.page.Response()
2760 }
2761
2762
2763
2764 func (iter TagsListResultIterator) Value() TagDetails {
2765 if !iter.page.NotDone() {
2766 return TagDetails{}
2767 }
2768 return iter.page.Values()[iter.i]
2769 }
2770
2771
2772 func NewTagsListResultIterator(page TagsListResultPage) TagsListResultIterator {
2773 return TagsListResultIterator{page: page}
2774 }
2775
2776
2777 func (tlr TagsListResult) IsEmpty() bool {
2778 return tlr.Value == nil || len(*tlr.Value) == 0
2779 }
2780
2781
2782 func (tlr TagsListResult) hasNextLink() bool {
2783 return tlr.NextLink != nil && len(*tlr.NextLink) != 0
2784 }
2785
2786
2787
2788 func (tlr TagsListResult) tagsListResultPreparer(ctx context.Context) (*http.Request, error) {
2789 if !tlr.hasNextLink() {
2790 return nil, nil
2791 }
2792 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2793 autorest.AsJSON(),
2794 autorest.AsGet(),
2795 autorest.WithBaseURL(to.String(tlr.NextLink)))
2796 }
2797
2798
2799 type TagsListResultPage struct {
2800 fn func(context.Context, TagsListResult) (TagsListResult, error)
2801 tlr TagsListResult
2802 }
2803
2804
2805
2806 func (page *TagsListResultPage) NextWithContext(ctx context.Context) (err error) {
2807 if tracing.IsEnabled() {
2808 ctx = tracing.StartSpan(ctx, fqdn+"/TagsListResultPage.NextWithContext")
2809 defer func() {
2810 sc := -1
2811 if page.Response().Response.Response != nil {
2812 sc = page.Response().Response.Response.StatusCode
2813 }
2814 tracing.EndSpan(ctx, sc, err)
2815 }()
2816 }
2817 for {
2818 next, err := page.fn(ctx, page.tlr)
2819 if err != nil {
2820 return err
2821 }
2822 page.tlr = next
2823 if !next.hasNextLink() || !next.IsEmpty() {
2824 break
2825 }
2826 }
2827 return nil
2828 }
2829
2830
2831
2832
2833 func (page *TagsListResultPage) Next() error {
2834 return page.NextWithContext(context.Background())
2835 }
2836
2837
2838 func (page TagsListResultPage) NotDone() bool {
2839 return !page.tlr.IsEmpty()
2840 }
2841
2842
2843 func (page TagsListResultPage) Response() TagsListResult {
2844 return page.tlr
2845 }
2846
2847
2848 func (page TagsListResultPage) Values() []TagDetails {
2849 if page.tlr.IsEmpty() {
2850 return nil
2851 }
2852 return *page.tlr.Value
2853 }
2854
2855
2856 func NewTagsListResultPage(cur TagsListResult, getNextPage func(context.Context, TagsListResult) (TagsListResult, error)) TagsListResultPage {
2857 return TagsListResultPage{
2858 fn: getNextPage,
2859 tlr: cur,
2860 }
2861 }
2862
2863
2864 type TagValue struct {
2865 autorest.Response `json:"-"`
2866
2867 ID *string `json:"id,omitempty"`
2868
2869 TagValue *string `json:"tagValue,omitempty"`
2870
2871 Count *TagCount `json:"count,omitempty"`
2872 }
2873
2874
2875 func (tv TagValue) MarshalJSON() ([]byte, error) {
2876 objectMap := make(map[string]interface{})
2877 if tv.TagValue != nil {
2878 objectMap["tagValue"] = tv.TagValue
2879 }
2880 if tv.Count != nil {
2881 objectMap["count"] = tv.Count
2882 }
2883 return json.Marshal(objectMap)
2884 }
2885
2886
2887 type TargetResource struct {
2888
2889 ID *string `json:"id,omitempty"`
2890
2891 ResourceName *string `json:"resourceName,omitempty"`
2892
2893 ResourceType *string `json:"resourceType,omitempty"`
2894 }
2895
2896
2897
2898 type TemplateHashResult struct {
2899 autorest.Response `json:"-"`
2900
2901 MinifiedTemplate *string `json:"minifiedTemplate,omitempty"`
2902
2903 TemplateHash *string `json:"templateHash,omitempty"`
2904 }
2905
2906
2907 type TemplateLink struct {
2908
2909 URI *string `json:"uri,omitempty"`
2910
2911 ContentVersion *string `json:"contentVersion,omitempty"`
2912 }
2913
2914
2915 type WhatIfChange struct {
2916
2917 ResourceID *string `json:"resourceId,omitempty"`
2918
2919 ChangeType ChangeType `json:"changeType,omitempty"`
2920
2921 Before interface{} `json:"before,omitempty"`
2922
2923 After interface{} `json:"after,omitempty"`
2924
2925 Delta *[]WhatIfPropertyChange `json:"delta,omitempty"`
2926 }
2927
2928
2929 type WhatIfOperationProperties struct {
2930
2931 Changes *[]WhatIfChange `json:"changes,omitempty"`
2932 }
2933
2934
2935
2936 type WhatIfOperationResult struct {
2937 autorest.Response `json:"-"`
2938
2939 Status *string `json:"status,omitempty"`
2940
2941 *WhatIfOperationProperties `json:"properties,omitempty"`
2942
2943 Error *ErrorResponse `json:"error,omitempty"`
2944 }
2945
2946
2947 func (wior WhatIfOperationResult) MarshalJSON() ([]byte, error) {
2948 objectMap := make(map[string]interface{})
2949 if wior.Status != nil {
2950 objectMap["status"] = wior.Status
2951 }
2952 if wior.WhatIfOperationProperties != nil {
2953 objectMap["properties"] = wior.WhatIfOperationProperties
2954 }
2955 if wior.Error != nil {
2956 objectMap["error"] = wior.Error
2957 }
2958 return json.Marshal(objectMap)
2959 }
2960
2961
2962 func (wior *WhatIfOperationResult) UnmarshalJSON(body []byte) error {
2963 var m map[string]*json.RawMessage
2964 err := json.Unmarshal(body, &m)
2965 if err != nil {
2966 return err
2967 }
2968 for k, v := range m {
2969 switch k {
2970 case "status":
2971 if v != nil {
2972 var status string
2973 err = json.Unmarshal(*v, &status)
2974 if err != nil {
2975 return err
2976 }
2977 wior.Status = &status
2978 }
2979 case "properties":
2980 if v != nil {
2981 var whatIfOperationProperties WhatIfOperationProperties
2982 err = json.Unmarshal(*v, &whatIfOperationProperties)
2983 if err != nil {
2984 return err
2985 }
2986 wior.WhatIfOperationProperties = &whatIfOperationProperties
2987 }
2988 case "error":
2989 if v != nil {
2990 var errorVar ErrorResponse
2991 err = json.Unmarshal(*v, &errorVar)
2992 if err != nil {
2993 return err
2994 }
2995 wior.Error = &errorVar
2996 }
2997 }
2998 }
2999
3000 return nil
3001 }
3002
3003
3004 type WhatIfPropertyChange struct {
3005
3006 Path *string `json:"path,omitempty"`
3007
3008 PropertyChangeType PropertyChangeType `json:"propertyChangeType,omitempty"`
3009
3010 Before interface{} `json:"before,omitempty"`
3011
3012 After interface{} `json:"after,omitempty"`
3013
3014 Children *[]WhatIfPropertyChange `json:"children,omitempty"`
3015 }
3016
View as plain text