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