1 package managedapplications
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/to"
15 "github.com/Azure/go-autorest/tracing"
16 "net/http"
17 )
18
19
20 const fqdn = "github.com/Azure/azure-sdk-for-go/services/solutions/mgmt/2018-02-01/managedapplications"
21
22
23 type Application struct {
24 autorest.Response `json:"-"`
25
26 *ApplicationProperties `json:"properties,omitempty"`
27
28 Plan *Plan `json:"plan,omitempty"`
29
30 Kind *string `json:"kind,omitempty"`
31
32 Identity *Identity `json:"identity,omitempty"`
33
34 ManagedBy *string `json:"managedBy,omitempty"`
35
36 Sku *Sku `json:"sku,omitempty"`
37
38 ID *string `json:"id,omitempty"`
39
40 Name *string `json:"name,omitempty"`
41
42 Type *string `json:"type,omitempty"`
43
44 Location *string `json:"location,omitempty"`
45
46 Tags map[string]*string `json:"tags"`
47 }
48
49
50 func (a Application) MarshalJSON() ([]byte, error) {
51 objectMap := make(map[string]interface{})
52 if a.ApplicationProperties != nil {
53 objectMap["properties"] = a.ApplicationProperties
54 }
55 if a.Plan != nil {
56 objectMap["plan"] = a.Plan
57 }
58 if a.Kind != nil {
59 objectMap["kind"] = a.Kind
60 }
61 if a.Identity != nil {
62 objectMap["identity"] = a.Identity
63 }
64 if a.ManagedBy != nil {
65 objectMap["managedBy"] = a.ManagedBy
66 }
67 if a.Sku != nil {
68 objectMap["sku"] = a.Sku
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 *Application) 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 applicationProperties ApplicationProperties
91 err = json.Unmarshal(*v, &applicationProperties)
92 if err != nil {
93 return err
94 }
95 a.ApplicationProperties = &applicationProperties
96 }
97 case "plan":
98 if v != nil {
99 var plan Plan
100 err = json.Unmarshal(*v, &plan)
101 if err != nil {
102 return err
103 }
104 a.Plan = &plan
105 }
106 case "kind":
107 if v != nil {
108 var kind string
109 err = json.Unmarshal(*v, &kind)
110 if err != nil {
111 return err
112 }
113 a.Kind = &kind
114 }
115 case "identity":
116 if v != nil {
117 var identity Identity
118 err = json.Unmarshal(*v, &identity)
119 if err != nil {
120 return err
121 }
122 a.Identity = &identity
123 }
124 case "managedBy":
125 if v != nil {
126 var managedBy string
127 err = json.Unmarshal(*v, &managedBy)
128 if err != nil {
129 return err
130 }
131 a.ManagedBy = &managedBy
132 }
133 case "sku":
134 if v != nil {
135 var sku Sku
136 err = json.Unmarshal(*v, &sku)
137 if err != nil {
138 return err
139 }
140 a.Sku = &sku
141 }
142 case "id":
143 if v != nil {
144 var ID string
145 err = json.Unmarshal(*v, &ID)
146 if err != nil {
147 return err
148 }
149 a.ID = &ID
150 }
151 case "name":
152 if v != nil {
153 var name string
154 err = json.Unmarshal(*v, &name)
155 if err != nil {
156 return err
157 }
158 a.Name = &name
159 }
160 case "type":
161 if v != nil {
162 var typeVar string
163 err = json.Unmarshal(*v, &typeVar)
164 if err != nil {
165 return err
166 }
167 a.Type = &typeVar
168 }
169 case "location":
170 if v != nil {
171 var location string
172 err = json.Unmarshal(*v, &location)
173 if err != nil {
174 return err
175 }
176 a.Location = &location
177 }
178 case "tags":
179 if v != nil {
180 var tags map[string]*string
181 err = json.Unmarshal(*v, &tags)
182 if err != nil {
183 return err
184 }
185 a.Tags = tags
186 }
187 }
188 }
189
190 return nil
191 }
192
193
194 type ApplicationArtifact struct {
195
196 Name ApplicationArtifactName `json:"name,omitempty"`
197
198 URI *string `json:"uri,omitempty"`
199
200 Type ApplicationArtifactType `json:"type,omitempty"`
201 }
202
203
204 type ApplicationAuthorization struct {
205
206 PrincipalID *string `json:"principalId,omitempty"`
207
208 RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
209 }
210
211
212 type ApplicationBillingDetailsDefinition struct {
213
214 ResourceUsageID *string `json:"resourceUsageId,omitempty"`
215 }
216
217
218
219 type ApplicationClientDetails struct {
220
221 Oid *string `json:"oid,omitempty"`
222
223 Puid *string `json:"puid,omitempty"`
224
225 ApplicationID *string `json:"applicationId,omitempty"`
226 }
227
228
229 type ApplicationDefinition struct {
230 autorest.Response `json:"-"`
231
232 *ApplicationDefinitionProperties `json:"properties,omitempty"`
233
234 ManagedBy *string `json:"managedBy,omitempty"`
235
236 Sku *Sku `json:"sku,omitempty"`
237
238 ID *string `json:"id,omitempty"`
239
240 Name *string `json:"name,omitempty"`
241
242 Type *string `json:"type,omitempty"`
243
244 Location *string `json:"location,omitempty"`
245
246 Tags map[string]*string `json:"tags"`
247 }
248
249
250 func (ad ApplicationDefinition) MarshalJSON() ([]byte, error) {
251 objectMap := make(map[string]interface{})
252 if ad.ApplicationDefinitionProperties != nil {
253 objectMap["properties"] = ad.ApplicationDefinitionProperties
254 }
255 if ad.ManagedBy != nil {
256 objectMap["managedBy"] = ad.ManagedBy
257 }
258 if ad.Sku != nil {
259 objectMap["sku"] = ad.Sku
260 }
261 if ad.Location != nil {
262 objectMap["location"] = ad.Location
263 }
264 if ad.Tags != nil {
265 objectMap["tags"] = ad.Tags
266 }
267 return json.Marshal(objectMap)
268 }
269
270
271 func (ad *ApplicationDefinition) UnmarshalJSON(body []byte) error {
272 var m map[string]*json.RawMessage
273 err := json.Unmarshal(body, &m)
274 if err != nil {
275 return err
276 }
277 for k, v := range m {
278 switch k {
279 case "properties":
280 if v != nil {
281 var applicationDefinitionProperties ApplicationDefinitionProperties
282 err = json.Unmarshal(*v, &applicationDefinitionProperties)
283 if err != nil {
284 return err
285 }
286 ad.ApplicationDefinitionProperties = &applicationDefinitionProperties
287 }
288 case "managedBy":
289 if v != nil {
290 var managedBy string
291 err = json.Unmarshal(*v, &managedBy)
292 if err != nil {
293 return err
294 }
295 ad.ManagedBy = &managedBy
296 }
297 case "sku":
298 if v != nil {
299 var sku Sku
300 err = json.Unmarshal(*v, &sku)
301 if err != nil {
302 return err
303 }
304 ad.Sku = &sku
305 }
306 case "id":
307 if v != nil {
308 var ID string
309 err = json.Unmarshal(*v, &ID)
310 if err != nil {
311 return err
312 }
313 ad.ID = &ID
314 }
315 case "name":
316 if v != nil {
317 var name string
318 err = json.Unmarshal(*v, &name)
319 if err != nil {
320 return err
321 }
322 ad.Name = &name
323 }
324 case "type":
325 if v != nil {
326 var typeVar string
327 err = json.Unmarshal(*v, &typeVar)
328 if err != nil {
329 return err
330 }
331 ad.Type = &typeVar
332 }
333 case "location":
334 if v != nil {
335 var location string
336 err = json.Unmarshal(*v, &location)
337 if err != nil {
338 return err
339 }
340 ad.Location = &location
341 }
342 case "tags":
343 if v != nil {
344 var tags map[string]*string
345 err = json.Unmarshal(*v, &tags)
346 if err != nil {
347 return err
348 }
349 ad.Tags = tags
350 }
351 }
352 }
353
354 return nil
355 }
356
357
358 type ApplicationDefinitionArtifact struct {
359
360 Name ApplicationDefinitionArtifactName `json:"name,omitempty"`
361
362 URI *string `json:"uri,omitempty"`
363
364 Type ApplicationArtifactType `json:"type,omitempty"`
365 }
366
367
368 type ApplicationDefinitionListResult struct {
369 autorest.Response `json:"-"`
370
371 Value *[]ApplicationDefinition `json:"value,omitempty"`
372
373 NextLink *string `json:"nextLink,omitempty"`
374 }
375
376
377
378 type ApplicationDefinitionListResultIterator struct {
379 i int
380 page ApplicationDefinitionListResultPage
381 }
382
383
384
385 func (iter *ApplicationDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) {
386 if tracing.IsEnabled() {
387 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationDefinitionListResultIterator.NextWithContext")
388 defer func() {
389 sc := -1
390 if iter.Response().Response.Response != nil {
391 sc = iter.Response().Response.Response.StatusCode
392 }
393 tracing.EndSpan(ctx, sc, err)
394 }()
395 }
396 iter.i++
397 if iter.i < len(iter.page.Values()) {
398 return nil
399 }
400 err = iter.page.NextWithContext(ctx)
401 if err != nil {
402 iter.i--
403 return err
404 }
405 iter.i = 0
406 return nil
407 }
408
409
410
411
412 func (iter *ApplicationDefinitionListResultIterator) Next() error {
413 return iter.NextWithContext(context.Background())
414 }
415
416
417 func (iter ApplicationDefinitionListResultIterator) NotDone() bool {
418 return iter.page.NotDone() && iter.i < len(iter.page.Values())
419 }
420
421
422 func (iter ApplicationDefinitionListResultIterator) Response() ApplicationDefinitionListResult {
423 return iter.page.Response()
424 }
425
426
427
428 func (iter ApplicationDefinitionListResultIterator) Value() ApplicationDefinition {
429 if !iter.page.NotDone() {
430 return ApplicationDefinition{}
431 }
432 return iter.page.Values()[iter.i]
433 }
434
435
436 func NewApplicationDefinitionListResultIterator(page ApplicationDefinitionListResultPage) ApplicationDefinitionListResultIterator {
437 return ApplicationDefinitionListResultIterator{page: page}
438 }
439
440
441 func (adlr ApplicationDefinitionListResult) IsEmpty() bool {
442 return adlr.Value == nil || len(*adlr.Value) == 0
443 }
444
445
446 func (adlr ApplicationDefinitionListResult) hasNextLink() bool {
447 return adlr.NextLink != nil && len(*adlr.NextLink) != 0
448 }
449
450
451
452 func (adlr ApplicationDefinitionListResult) applicationDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) {
453 if !adlr.hasNextLink() {
454 return nil, nil
455 }
456 return autorest.Prepare((&http.Request{}).WithContext(ctx),
457 autorest.AsJSON(),
458 autorest.AsGet(),
459 autorest.WithBaseURL(to.String(adlr.NextLink)))
460 }
461
462
463 type ApplicationDefinitionListResultPage struct {
464 fn func(context.Context, ApplicationDefinitionListResult) (ApplicationDefinitionListResult, error)
465 adlr ApplicationDefinitionListResult
466 }
467
468
469
470 func (page *ApplicationDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) {
471 if tracing.IsEnabled() {
472 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationDefinitionListResultPage.NextWithContext")
473 defer func() {
474 sc := -1
475 if page.Response().Response.Response != nil {
476 sc = page.Response().Response.Response.StatusCode
477 }
478 tracing.EndSpan(ctx, sc, err)
479 }()
480 }
481 for {
482 next, err := page.fn(ctx, page.adlr)
483 if err != nil {
484 return err
485 }
486 page.adlr = next
487 if !next.hasNextLink() || !next.IsEmpty() {
488 break
489 }
490 }
491 return nil
492 }
493
494
495
496
497 func (page *ApplicationDefinitionListResultPage) Next() error {
498 return page.NextWithContext(context.Background())
499 }
500
501
502 func (page ApplicationDefinitionListResultPage) NotDone() bool {
503 return !page.adlr.IsEmpty()
504 }
505
506
507 func (page ApplicationDefinitionListResultPage) Response() ApplicationDefinitionListResult {
508 return page.adlr
509 }
510
511
512 func (page ApplicationDefinitionListResultPage) Values() []ApplicationDefinition {
513 if page.adlr.IsEmpty() {
514 return nil
515 }
516 return *page.adlr.Value
517 }
518
519
520 func NewApplicationDefinitionListResultPage(cur ApplicationDefinitionListResult, getNextPage func(context.Context, ApplicationDefinitionListResult) (ApplicationDefinitionListResult, error)) ApplicationDefinitionListResultPage {
521 return ApplicationDefinitionListResultPage{
522 fn: getNextPage,
523 adlr: cur,
524 }
525 }
526
527
528 type ApplicationDefinitionPatchable struct {
529
530 Tags map[string]*string `json:"tags"`
531 }
532
533
534 func (adp ApplicationDefinitionPatchable) MarshalJSON() ([]byte, error) {
535 objectMap := make(map[string]interface{})
536 if adp.Tags != nil {
537 objectMap["tags"] = adp.Tags
538 }
539 return json.Marshal(objectMap)
540 }
541
542
543 type ApplicationDefinitionProperties struct {
544
545 LockLevel ApplicationLockLevel `json:"lockLevel,omitempty"`
546
547 DisplayName *string `json:"displayName,omitempty"`
548
549 IsEnabled *bool `json:"isEnabled,omitempty"`
550
551 Authorizations *[]ApplicationAuthorization `json:"authorizations,omitempty"`
552
553 Artifacts *[]ApplicationDefinitionArtifact `json:"artifacts,omitempty"`
554
555 Description *string `json:"description,omitempty"`
556
557 PackageFileURI *string `json:"packageFileUri,omitempty"`
558
559 MainTemplate interface{} `json:"mainTemplate,omitempty"`
560
561 CreateUIDefinition interface{} `json:"createUiDefinition,omitempty"`
562
563 Policies *[]ApplicationPolicy `json:"policies,omitempty"`
564 }
565
566
567 type ApplicationListResult struct {
568 autorest.Response `json:"-"`
569
570 Value *[]Application `json:"value,omitempty"`
571
572 NextLink *string `json:"nextLink,omitempty"`
573 }
574
575
576 type ApplicationListResultIterator struct {
577 i int
578 page ApplicationListResultPage
579 }
580
581
582
583 func (iter *ApplicationListResultIterator) NextWithContext(ctx context.Context) (err error) {
584 if tracing.IsEnabled() {
585 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListResultIterator.NextWithContext")
586 defer func() {
587 sc := -1
588 if iter.Response().Response.Response != nil {
589 sc = iter.Response().Response.Response.StatusCode
590 }
591 tracing.EndSpan(ctx, sc, err)
592 }()
593 }
594 iter.i++
595 if iter.i < len(iter.page.Values()) {
596 return nil
597 }
598 err = iter.page.NextWithContext(ctx)
599 if err != nil {
600 iter.i--
601 return err
602 }
603 iter.i = 0
604 return nil
605 }
606
607
608
609
610 func (iter *ApplicationListResultIterator) Next() error {
611 return iter.NextWithContext(context.Background())
612 }
613
614
615 func (iter ApplicationListResultIterator) NotDone() bool {
616 return iter.page.NotDone() && iter.i < len(iter.page.Values())
617 }
618
619
620 func (iter ApplicationListResultIterator) Response() ApplicationListResult {
621 return iter.page.Response()
622 }
623
624
625
626 func (iter ApplicationListResultIterator) Value() Application {
627 if !iter.page.NotDone() {
628 return Application{}
629 }
630 return iter.page.Values()[iter.i]
631 }
632
633
634 func NewApplicationListResultIterator(page ApplicationListResultPage) ApplicationListResultIterator {
635 return ApplicationListResultIterator{page: page}
636 }
637
638
639 func (alr ApplicationListResult) IsEmpty() bool {
640 return alr.Value == nil || len(*alr.Value) == 0
641 }
642
643
644 func (alr ApplicationListResult) hasNextLink() bool {
645 return alr.NextLink != nil && len(*alr.NextLink) != 0
646 }
647
648
649
650 func (alr ApplicationListResult) applicationListResultPreparer(ctx context.Context) (*http.Request, error) {
651 if !alr.hasNextLink() {
652 return nil, nil
653 }
654 return autorest.Prepare((&http.Request{}).WithContext(ctx),
655 autorest.AsJSON(),
656 autorest.AsGet(),
657 autorest.WithBaseURL(to.String(alr.NextLink)))
658 }
659
660
661 type ApplicationListResultPage struct {
662 fn func(context.Context, ApplicationListResult) (ApplicationListResult, error)
663 alr ApplicationListResult
664 }
665
666
667
668 func (page *ApplicationListResultPage) NextWithContext(ctx context.Context) (err error) {
669 if tracing.IsEnabled() {
670 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListResultPage.NextWithContext")
671 defer func() {
672 sc := -1
673 if page.Response().Response.Response != nil {
674 sc = page.Response().Response.Response.StatusCode
675 }
676 tracing.EndSpan(ctx, sc, err)
677 }()
678 }
679 for {
680 next, err := page.fn(ctx, page.alr)
681 if err != nil {
682 return err
683 }
684 page.alr = next
685 if !next.hasNextLink() || !next.IsEmpty() {
686 break
687 }
688 }
689 return nil
690 }
691
692
693
694
695 func (page *ApplicationListResultPage) Next() error {
696 return page.NextWithContext(context.Background())
697 }
698
699
700 func (page ApplicationListResultPage) NotDone() bool {
701 return !page.alr.IsEmpty()
702 }
703
704
705 func (page ApplicationListResultPage) Response() ApplicationListResult {
706 return page.alr
707 }
708
709
710 func (page ApplicationListResultPage) Values() []Application {
711 if page.alr.IsEmpty() {
712 return nil
713 }
714 return *page.alr.Value
715 }
716
717
718 func NewApplicationListResultPage(cur ApplicationListResult, getNextPage func(context.Context, ApplicationListResult) (ApplicationListResult, error)) ApplicationListResultPage {
719 return ApplicationListResultPage{
720 fn: getNextPage,
721 alr: cur,
722 }
723 }
724
725
726 type ApplicationPackageContact struct {
727
728 ContactName *string `json:"contactName,omitempty"`
729
730 Email *string `json:"email,omitempty"`
731
732 Phone *string `json:"phone,omitempty"`
733 }
734
735
736 type ApplicationPackageSupportUrls struct {
737
738 PublicAzure *string `json:"publicAzure,omitempty"`
739
740 GovernmentCloud *string `json:"governmentCloud,omitempty"`
741 }
742
743
744 type ApplicationPatchable struct {
745 autorest.Response `json:"-"`
746
747 *ApplicationProperties `json:"properties,omitempty"`
748
749 Plan *PlanPatchable `json:"plan,omitempty"`
750
751 Kind *string `json:"kind,omitempty"`
752
753 Identity *Identity `json:"identity,omitempty"`
754
755 ManagedBy *string `json:"managedBy,omitempty"`
756
757 Sku *Sku `json:"sku,omitempty"`
758
759 ID *string `json:"id,omitempty"`
760
761 Name *string `json:"name,omitempty"`
762
763 Type *string `json:"type,omitempty"`
764
765 Location *string `json:"location,omitempty"`
766
767 Tags map[string]*string `json:"tags"`
768 }
769
770
771 func (ap ApplicationPatchable) MarshalJSON() ([]byte, error) {
772 objectMap := make(map[string]interface{})
773 if ap.ApplicationProperties != nil {
774 objectMap["properties"] = ap.ApplicationProperties
775 }
776 if ap.Plan != nil {
777 objectMap["plan"] = ap.Plan
778 }
779 if ap.Kind != nil {
780 objectMap["kind"] = ap.Kind
781 }
782 if ap.Identity != nil {
783 objectMap["identity"] = ap.Identity
784 }
785 if ap.ManagedBy != nil {
786 objectMap["managedBy"] = ap.ManagedBy
787 }
788 if ap.Sku != nil {
789 objectMap["sku"] = ap.Sku
790 }
791 if ap.Location != nil {
792 objectMap["location"] = ap.Location
793 }
794 if ap.Tags != nil {
795 objectMap["tags"] = ap.Tags
796 }
797 return json.Marshal(objectMap)
798 }
799
800
801 func (ap *ApplicationPatchable) UnmarshalJSON(body []byte) error {
802 var m map[string]*json.RawMessage
803 err := json.Unmarshal(body, &m)
804 if err != nil {
805 return err
806 }
807 for k, v := range m {
808 switch k {
809 case "properties":
810 if v != nil {
811 var applicationProperties ApplicationProperties
812 err = json.Unmarshal(*v, &applicationProperties)
813 if err != nil {
814 return err
815 }
816 ap.ApplicationProperties = &applicationProperties
817 }
818 case "plan":
819 if v != nil {
820 var plan PlanPatchable
821 err = json.Unmarshal(*v, &plan)
822 if err != nil {
823 return err
824 }
825 ap.Plan = &plan
826 }
827 case "kind":
828 if v != nil {
829 var kind string
830 err = json.Unmarshal(*v, &kind)
831 if err != nil {
832 return err
833 }
834 ap.Kind = &kind
835 }
836 case "identity":
837 if v != nil {
838 var identity Identity
839 err = json.Unmarshal(*v, &identity)
840 if err != nil {
841 return err
842 }
843 ap.Identity = &identity
844 }
845 case "managedBy":
846 if v != nil {
847 var managedBy string
848 err = json.Unmarshal(*v, &managedBy)
849 if err != nil {
850 return err
851 }
852 ap.ManagedBy = &managedBy
853 }
854 case "sku":
855 if v != nil {
856 var sku Sku
857 err = json.Unmarshal(*v, &sku)
858 if err != nil {
859 return err
860 }
861 ap.Sku = &sku
862 }
863 case "id":
864 if v != nil {
865 var ID string
866 err = json.Unmarshal(*v, &ID)
867 if err != nil {
868 return err
869 }
870 ap.ID = &ID
871 }
872 case "name":
873 if v != nil {
874 var name string
875 err = json.Unmarshal(*v, &name)
876 if err != nil {
877 return err
878 }
879 ap.Name = &name
880 }
881 case "type":
882 if v != nil {
883 var typeVar string
884 err = json.Unmarshal(*v, &typeVar)
885 if err != nil {
886 return err
887 }
888 ap.Type = &typeVar
889 }
890 case "location":
891 if v != nil {
892 var location string
893 err = json.Unmarshal(*v, &location)
894 if err != nil {
895 return err
896 }
897 ap.Location = &location
898 }
899 case "tags":
900 if v != nil {
901 var tags map[string]*string
902 err = json.Unmarshal(*v, &tags)
903 if err != nil {
904 return err
905 }
906 ap.Tags = tags
907 }
908 }
909 }
910
911 return nil
912 }
913
914
915 type ApplicationPolicy struct {
916
917 Name *string `json:"name,omitempty"`
918
919 PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"`
920
921 Parameters *string `json:"parameters,omitempty"`
922 }
923
924
925 type ApplicationProperties struct {
926
927 ManagedResourceGroupID *string `json:"managedResourceGroupId,omitempty"`
928
929 ApplicationDefinitionID *string `json:"applicationDefinitionId,omitempty"`
930
931 PublisherPackageID *string `json:"publisherPackageId,omitempty"`
932
933 Parameters interface{} `json:"parameters,omitempty"`
934
935 Outputs interface{} `json:"outputs,omitempty"`
936
937 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
938
939 BillingDetails *ApplicationBillingDetailsDefinition `json:"billingDetails,omitempty"`
940
941 PublisherTenantID *string `json:"publisherTenantId,omitempty"`
942
943 Authorizations *[]ApplicationAuthorization `json:"authorizations,omitempty"`
944
945 CustomerSupport *ApplicationPackageContact `json:"customerSupport,omitempty"`
946
947 SupportUrls *ApplicationPackageSupportUrls `json:"supportUrls,omitempty"`
948
949 Artifacts *[]ApplicationArtifact `json:"artifacts,omitempty"`
950
951 CreatedBy *ApplicationClientDetails `json:"createdBy,omitempty"`
952
953 UpdatedBy *ApplicationClientDetails `json:"updatedBy,omitempty"`
954 }
955
956
957 func (ap ApplicationProperties) MarshalJSON() ([]byte, error) {
958 objectMap := make(map[string]interface{})
959 if ap.ManagedResourceGroupID != nil {
960 objectMap["managedResourceGroupId"] = ap.ManagedResourceGroupID
961 }
962 if ap.ApplicationDefinitionID != nil {
963 objectMap["applicationDefinitionId"] = ap.ApplicationDefinitionID
964 }
965 if ap.PublisherPackageID != nil {
966 objectMap["publisherPackageId"] = ap.PublisherPackageID
967 }
968 if ap.Parameters != nil {
969 objectMap["parameters"] = ap.Parameters
970 }
971 return json.Marshal(objectMap)
972 }
973
974
975 type ApplicationPropertiesPatchable struct {
976
977 ManagedResourceGroupID *string `json:"managedResourceGroupId,omitempty"`
978
979 ApplicationDefinitionID *string `json:"applicationDefinitionId,omitempty"`
980
981 Parameters interface{} `json:"parameters,omitempty"`
982
983 Outputs interface{} `json:"outputs,omitempty"`
984
985 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
986 }
987
988
989 func (app ApplicationPropertiesPatchable) MarshalJSON() ([]byte, error) {
990 objectMap := make(map[string]interface{})
991 if app.ManagedResourceGroupID != nil {
992 objectMap["managedResourceGroupId"] = app.ManagedResourceGroupID
993 }
994 if app.ApplicationDefinitionID != nil {
995 objectMap["applicationDefinitionId"] = app.ApplicationDefinitionID
996 }
997 if app.Parameters != nil {
998 objectMap["parameters"] = app.Parameters
999 }
1000 return json.Marshal(objectMap)
1001 }
1002
1003
1004
1005 type ApplicationsCreateOrUpdateByIDFuture struct {
1006 azure.FutureAPI
1007
1008
1009 Result func(ApplicationsClient) (Application, error)
1010 }
1011
1012
1013 func (future *ApplicationsCreateOrUpdateByIDFuture) UnmarshalJSON(body []byte) error {
1014 var azFuture azure.Future
1015 if err := json.Unmarshal(body, &azFuture); err != nil {
1016 return err
1017 }
1018 future.FutureAPI = &azFuture
1019 future.Result = future.result
1020 return nil
1021 }
1022
1023
1024 func (future *ApplicationsCreateOrUpdateByIDFuture) result(client ApplicationsClient) (a Application, err error) {
1025 var done bool
1026 done, err = future.DoneWithContext(context.Background(), client)
1027 if err != nil {
1028 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure")
1029 return
1030 }
1031 if !done {
1032 a.Response.Response = future.Response()
1033 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsCreateOrUpdateByIDFuture")
1034 return
1035 }
1036 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1037 if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
1038 a, err = client.CreateOrUpdateByIDResponder(a.Response.Response)
1039 if err != nil {
1040 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateByIDFuture", "Result", a.Response.Response, "Failure responding to request")
1041 }
1042 }
1043 return
1044 }
1045
1046
1047
1048 type ApplicationsCreateOrUpdateFuture struct {
1049 azure.FutureAPI
1050
1051
1052 Result func(ApplicationsClient) (Application, error)
1053 }
1054
1055
1056 func (future *ApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1057 var azFuture azure.Future
1058 if err := json.Unmarshal(body, &azFuture); err != nil {
1059 return err
1060 }
1061 future.FutureAPI = &azFuture
1062 future.Result = future.result
1063 return nil
1064 }
1065
1066
1067 func (future *ApplicationsCreateOrUpdateFuture) result(client ApplicationsClient) (a Application, err error) {
1068 var done bool
1069 done, err = future.DoneWithContext(context.Background(), client)
1070 if err != nil {
1071 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1072 return
1073 }
1074 if !done {
1075 a.Response.Response = future.Response()
1076 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsCreateOrUpdateFuture")
1077 return
1078 }
1079 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1080 if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
1081 a, err = client.CreateOrUpdateResponder(a.Response.Response)
1082 if err != nil {
1083 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request")
1084 }
1085 }
1086 return
1087 }
1088
1089
1090
1091 type ApplicationsDeleteByIDFuture struct {
1092 azure.FutureAPI
1093
1094
1095 Result func(ApplicationsClient) (autorest.Response, error)
1096 }
1097
1098
1099 func (future *ApplicationsDeleteByIDFuture) UnmarshalJSON(body []byte) error {
1100 var azFuture azure.Future
1101 if err := json.Unmarshal(body, &azFuture); err != nil {
1102 return err
1103 }
1104 future.FutureAPI = &azFuture
1105 future.Result = future.result
1106 return nil
1107 }
1108
1109
1110 func (future *ApplicationsDeleteByIDFuture) result(client ApplicationsClient) (ar autorest.Response, err error) {
1111 var done bool
1112 done, err = future.DoneWithContext(context.Background(), client)
1113 if err != nil {
1114 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsDeleteByIDFuture", "Result", future.Response(), "Polling failure")
1115 return
1116 }
1117 if !done {
1118 ar.Response = future.Response()
1119 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsDeleteByIDFuture")
1120 return
1121 }
1122 ar.Response = future.Response()
1123 return
1124 }
1125
1126
1127
1128 type ApplicationsDeleteFuture struct {
1129 azure.FutureAPI
1130
1131
1132 Result func(ApplicationsClient) (autorest.Response, error)
1133 }
1134
1135
1136 func (future *ApplicationsDeleteFuture) UnmarshalJSON(body []byte) error {
1137 var azFuture azure.Future
1138 if err := json.Unmarshal(body, &azFuture); err != nil {
1139 return err
1140 }
1141 future.FutureAPI = &azFuture
1142 future.Result = future.result
1143 return nil
1144 }
1145
1146
1147 func (future *ApplicationsDeleteFuture) result(client ApplicationsClient) (ar autorest.Response, err error) {
1148 var done bool
1149 done, err = future.DoneWithContext(context.Background(), client)
1150 if err != nil {
1151 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsDeleteFuture", "Result", future.Response(), "Polling failure")
1152 return
1153 }
1154 if !done {
1155 ar.Response = future.Response()
1156 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsDeleteFuture")
1157 return
1158 }
1159 ar.Response = future.Response()
1160 return
1161 }
1162
1163
1164
1165 type ApplicationsRefreshPermissionsFuture struct {
1166 azure.FutureAPI
1167
1168
1169 Result func(ApplicationsClient) (autorest.Response, error)
1170 }
1171
1172
1173 func (future *ApplicationsRefreshPermissionsFuture) UnmarshalJSON(body []byte) error {
1174 var azFuture azure.Future
1175 if err := json.Unmarshal(body, &azFuture); err != nil {
1176 return err
1177 }
1178 future.FutureAPI = &azFuture
1179 future.Result = future.result
1180 return nil
1181 }
1182
1183
1184 func (future *ApplicationsRefreshPermissionsFuture) result(client ApplicationsClient) (ar autorest.Response, err error) {
1185 var done bool
1186 done, err = future.DoneWithContext(context.Background(), client)
1187 if err != nil {
1188 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsRefreshPermissionsFuture", "Result", future.Response(), "Polling failure")
1189 return
1190 }
1191 if !done {
1192 ar.Response = future.Response()
1193 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsRefreshPermissionsFuture")
1194 return
1195 }
1196 ar.Response = future.Response()
1197 return
1198 }
1199
1200
1201
1202 type ApplicationsUpdateByIDFuture struct {
1203 azure.FutureAPI
1204
1205
1206 Result func(ApplicationsClient) (ApplicationPatchable, error)
1207 }
1208
1209
1210 func (future *ApplicationsUpdateByIDFuture) UnmarshalJSON(body []byte) error {
1211 var azFuture azure.Future
1212 if err := json.Unmarshal(body, &azFuture); err != nil {
1213 return err
1214 }
1215 future.FutureAPI = &azFuture
1216 future.Result = future.result
1217 return nil
1218 }
1219
1220
1221 func (future *ApplicationsUpdateByIDFuture) result(client ApplicationsClient) (ap ApplicationPatchable, err error) {
1222 var done bool
1223 done, err = future.DoneWithContext(context.Background(), client)
1224 if err != nil {
1225 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateByIDFuture", "Result", future.Response(), "Polling failure")
1226 return
1227 }
1228 if !done {
1229 ap.Response.Response = future.Response()
1230 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsUpdateByIDFuture")
1231 return
1232 }
1233 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1234 if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
1235 ap, err = client.UpdateByIDResponder(ap.Response.Response)
1236 if err != nil {
1237 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateByIDFuture", "Result", ap.Response.Response, "Failure responding to request")
1238 }
1239 }
1240 return
1241 }
1242
1243
1244
1245 type ApplicationsUpdateFuture struct {
1246 azure.FutureAPI
1247
1248
1249 Result func(ApplicationsClient) (ApplicationPatchable, error)
1250 }
1251
1252
1253 func (future *ApplicationsUpdateFuture) UnmarshalJSON(body []byte) error {
1254 var azFuture azure.Future
1255 if err := json.Unmarshal(body, &azFuture); err != nil {
1256 return err
1257 }
1258 future.FutureAPI = &azFuture
1259 future.Result = future.result
1260 return nil
1261 }
1262
1263
1264 func (future *ApplicationsUpdateFuture) result(client ApplicationsClient) (ap ApplicationPatchable, err error) {
1265 var done bool
1266 done, err = future.DoneWithContext(context.Background(), client)
1267 if err != nil {
1268 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateFuture", "Result", future.Response(), "Polling failure")
1269 return
1270 }
1271 if !done {
1272 ap.Response.Response = future.Response()
1273 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsUpdateFuture")
1274 return
1275 }
1276 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1277 if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
1278 ap, err = client.UpdateResponder(ap.Response.Response)
1279 if err != nil {
1280 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateFuture", "Result", ap.Response.Response, "Failure responding to request")
1281 }
1282 }
1283 return
1284 }
1285
1286
1287 type ErrorAdditionalInfo struct {
1288
1289 Type *string `json:"type,omitempty"`
1290
1291 Info interface{} `json:"info,omitempty"`
1292 }
1293
1294
1295 func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
1296 objectMap := make(map[string]interface{})
1297 return json.Marshal(objectMap)
1298 }
1299
1300
1301 type ErrorDetail struct {
1302
1303 Code *string `json:"code,omitempty"`
1304
1305 Message *string `json:"message,omitempty"`
1306
1307 Target *string `json:"target,omitempty"`
1308
1309 Details *[]ErrorDetail `json:"details,omitempty"`
1310
1311 AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
1312 }
1313
1314
1315 func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
1316 objectMap := make(map[string]interface{})
1317 return json.Marshal(objectMap)
1318 }
1319
1320
1321
1322 type ErrorResponse struct {
1323
1324 Error *ErrorDetail `json:"error,omitempty"`
1325 }
1326
1327
1328 type GenericResource struct {
1329
1330 ManagedBy *string `json:"managedBy,omitempty"`
1331
1332 Sku *Sku `json:"sku,omitempty"`
1333
1334 ID *string `json:"id,omitempty"`
1335
1336 Name *string `json:"name,omitempty"`
1337
1338 Type *string `json:"type,omitempty"`
1339
1340 Location *string `json:"location,omitempty"`
1341
1342 Tags map[string]*string `json:"tags"`
1343 }
1344
1345
1346 func (gr GenericResource) MarshalJSON() ([]byte, error) {
1347 objectMap := make(map[string]interface{})
1348 if gr.ManagedBy != nil {
1349 objectMap["managedBy"] = gr.ManagedBy
1350 }
1351 if gr.Sku != nil {
1352 objectMap["sku"] = gr.Sku
1353 }
1354 if gr.Location != nil {
1355 objectMap["location"] = gr.Location
1356 }
1357 if gr.Tags != nil {
1358 objectMap["tags"] = gr.Tags
1359 }
1360 return json.Marshal(objectMap)
1361 }
1362
1363
1364 type Identity struct {
1365
1366 PrincipalID *string `json:"principalId,omitempty"`
1367
1368 TenantID *string `json:"tenantId,omitempty"`
1369
1370 Type ResourceIdentityType `json:"type,omitempty"`
1371
1372 UserAssignedIdentities map[string]*UserAssignedResourceIdentity `json:"userAssignedIdentities"`
1373 }
1374
1375
1376 func (i Identity) MarshalJSON() ([]byte, error) {
1377 objectMap := make(map[string]interface{})
1378 if i.Type != "" {
1379 objectMap["type"] = i.Type
1380 }
1381 if i.UserAssignedIdentities != nil {
1382 objectMap["userAssignedIdentities"] = i.UserAssignedIdentities
1383 }
1384 return json.Marshal(objectMap)
1385 }
1386
1387
1388 type Operation struct {
1389
1390 Name *string `json:"name,omitempty"`
1391
1392 Display *OperationDisplay `json:"display,omitempty"`
1393 }
1394
1395
1396 type OperationDisplay struct {
1397
1398 Provider *string `json:"provider,omitempty"`
1399
1400 Resource *string `json:"resource,omitempty"`
1401
1402 Operation *string `json:"operation,omitempty"`
1403 }
1404
1405
1406
1407 type OperationListResult struct {
1408 autorest.Response `json:"-"`
1409
1410 Value *[]Operation `json:"value,omitempty"`
1411
1412 NextLink *string `json:"nextLink,omitempty"`
1413 }
1414
1415
1416 func (olr OperationListResult) MarshalJSON() ([]byte, error) {
1417 objectMap := make(map[string]interface{})
1418 return json.Marshal(objectMap)
1419 }
1420
1421
1422 type OperationListResultIterator struct {
1423 i int
1424 page OperationListResultPage
1425 }
1426
1427
1428
1429 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1430 if tracing.IsEnabled() {
1431 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
1432 defer func() {
1433 sc := -1
1434 if iter.Response().Response.Response != nil {
1435 sc = iter.Response().Response.Response.StatusCode
1436 }
1437 tracing.EndSpan(ctx, sc, err)
1438 }()
1439 }
1440 iter.i++
1441 if iter.i < len(iter.page.Values()) {
1442 return nil
1443 }
1444 err = iter.page.NextWithContext(ctx)
1445 if err != nil {
1446 iter.i--
1447 return err
1448 }
1449 iter.i = 0
1450 return nil
1451 }
1452
1453
1454
1455
1456 func (iter *OperationListResultIterator) Next() error {
1457 return iter.NextWithContext(context.Background())
1458 }
1459
1460
1461 func (iter OperationListResultIterator) NotDone() bool {
1462 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1463 }
1464
1465
1466 func (iter OperationListResultIterator) Response() OperationListResult {
1467 return iter.page.Response()
1468 }
1469
1470
1471
1472 func (iter OperationListResultIterator) Value() Operation {
1473 if !iter.page.NotDone() {
1474 return Operation{}
1475 }
1476 return iter.page.Values()[iter.i]
1477 }
1478
1479
1480 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
1481 return OperationListResultIterator{page: page}
1482 }
1483
1484
1485 func (olr OperationListResult) IsEmpty() bool {
1486 return olr.Value == nil || len(*olr.Value) == 0
1487 }
1488
1489
1490 func (olr OperationListResult) hasNextLink() bool {
1491 return olr.NextLink != nil && len(*olr.NextLink) != 0
1492 }
1493
1494
1495
1496 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
1497 if !olr.hasNextLink() {
1498 return nil, nil
1499 }
1500 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1501 autorest.AsJSON(),
1502 autorest.AsGet(),
1503 autorest.WithBaseURL(to.String(olr.NextLink)))
1504 }
1505
1506
1507 type OperationListResultPage struct {
1508 fn func(context.Context, OperationListResult) (OperationListResult, error)
1509 olr OperationListResult
1510 }
1511
1512
1513
1514 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1515 if tracing.IsEnabled() {
1516 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
1517 defer func() {
1518 sc := -1
1519 if page.Response().Response.Response != nil {
1520 sc = page.Response().Response.Response.StatusCode
1521 }
1522 tracing.EndSpan(ctx, sc, err)
1523 }()
1524 }
1525 for {
1526 next, err := page.fn(ctx, page.olr)
1527 if err != nil {
1528 return err
1529 }
1530 page.olr = next
1531 if !next.hasNextLink() || !next.IsEmpty() {
1532 break
1533 }
1534 }
1535 return nil
1536 }
1537
1538
1539
1540
1541 func (page *OperationListResultPage) Next() error {
1542 return page.NextWithContext(context.Background())
1543 }
1544
1545
1546 func (page OperationListResultPage) NotDone() bool {
1547 return !page.olr.IsEmpty()
1548 }
1549
1550
1551 func (page OperationListResultPage) Response() OperationListResult {
1552 return page.olr
1553 }
1554
1555
1556 func (page OperationListResultPage) Values() []Operation {
1557 if page.olr.IsEmpty() {
1558 return nil
1559 }
1560 return *page.olr.Value
1561 }
1562
1563
1564 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
1565 return OperationListResultPage{
1566 fn: getNextPage,
1567 olr: cur,
1568 }
1569 }
1570
1571
1572 type Plan struct {
1573
1574 Name *string `json:"name,omitempty"`
1575
1576 Publisher *string `json:"publisher,omitempty"`
1577
1578 Product *string `json:"product,omitempty"`
1579
1580 PromotionCode *string `json:"promotionCode,omitempty"`
1581
1582 Version *string `json:"version,omitempty"`
1583 }
1584
1585
1586 type PlanPatchable struct {
1587
1588 Name *string `json:"name,omitempty"`
1589
1590 Publisher *string `json:"publisher,omitempty"`
1591
1592 Product *string `json:"product,omitempty"`
1593
1594 PromotionCode *string `json:"promotionCode,omitempty"`
1595
1596 Version *string `json:"version,omitempty"`
1597 }
1598
1599
1600 type Resource struct {
1601
1602 ID *string `json:"id,omitempty"`
1603
1604 Name *string `json:"name,omitempty"`
1605
1606 Type *string `json:"type,omitempty"`
1607
1608 Location *string `json:"location,omitempty"`
1609
1610 Tags map[string]*string `json:"tags"`
1611 }
1612
1613
1614 func (r Resource) MarshalJSON() ([]byte, error) {
1615 objectMap := make(map[string]interface{})
1616 if r.Location != nil {
1617 objectMap["location"] = r.Location
1618 }
1619 if r.Tags != nil {
1620 objectMap["tags"] = r.Tags
1621 }
1622 return json.Marshal(objectMap)
1623 }
1624
1625
1626 type Sku struct {
1627
1628 Name *string `json:"name,omitempty"`
1629
1630 Tier *string `json:"tier,omitempty"`
1631
1632 Size *string `json:"size,omitempty"`
1633
1634 Family *string `json:"family,omitempty"`
1635
1636 Model *string `json:"model,omitempty"`
1637
1638 Capacity *int32 `json:"capacity,omitempty"`
1639 }
1640
1641
1642
1643 type UserAssignedResourceIdentity struct {
1644
1645 PrincipalID *string `json:"principalId,omitempty"`
1646
1647 TenantID *string `json:"tenantId,omitempty"`
1648 }
1649
1650
1651 func (uari UserAssignedResourceIdentity) MarshalJSON() ([]byte, error) {
1652 objectMap := make(map[string]interface{})
1653 return json.Marshal(objectMap)
1654 }
1655
View as plain text