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