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/preview/solutions/mgmt/2021-02-01-preview/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 type ApplicationPropertiesPatchable struct {
1073
1074 ManagedResourceGroupID *string `json:"managedResourceGroupId,omitempty"`
1075
1076 ApplicationDefinitionID *string `json:"applicationDefinitionId,omitempty"`
1077
1078 Parameters interface{} `json:"parameters,omitempty"`
1079
1080 Outputs interface{} `json:"outputs,omitempty"`
1081
1082 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1083 }
1084
1085
1086 func (app ApplicationPropertiesPatchable) MarshalJSON() ([]byte, error) {
1087 objectMap := make(map[string]interface{})
1088 if app.ManagedResourceGroupID != nil {
1089 objectMap["managedResourceGroupId"] = app.ManagedResourceGroupID
1090 }
1091 if app.ApplicationDefinitionID != nil {
1092 objectMap["applicationDefinitionId"] = app.ApplicationDefinitionID
1093 }
1094 if app.Parameters != nil {
1095 objectMap["parameters"] = app.Parameters
1096 }
1097 return json.Marshal(objectMap)
1098 }
1099
1100
1101
1102 type ApplicationsCreateOrUpdateByIDFuture struct {
1103 azure.FutureAPI
1104
1105
1106 Result func(ApplicationsClient) (Application, error)
1107 }
1108
1109
1110 func (future *ApplicationsCreateOrUpdateByIDFuture) UnmarshalJSON(body []byte) error {
1111 var azFuture azure.Future
1112 if err := json.Unmarshal(body, &azFuture); err != nil {
1113 return err
1114 }
1115 future.FutureAPI = &azFuture
1116 future.Result = future.result
1117 return nil
1118 }
1119
1120
1121 func (future *ApplicationsCreateOrUpdateByIDFuture) result(client ApplicationsClient) (a Application, err error) {
1122 var done bool
1123 done, err = future.DoneWithContext(context.Background(), client)
1124 if err != nil {
1125 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure")
1126 return
1127 }
1128 if !done {
1129 a.Response.Response = future.Response()
1130 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsCreateOrUpdateByIDFuture")
1131 return
1132 }
1133 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1134 if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
1135 a, err = client.CreateOrUpdateByIDResponder(a.Response.Response)
1136 if err != nil {
1137 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateByIDFuture", "Result", a.Response.Response, "Failure responding to request")
1138 }
1139 }
1140 return
1141 }
1142
1143
1144
1145 type ApplicationsCreateOrUpdateFuture struct {
1146 azure.FutureAPI
1147
1148
1149 Result func(ApplicationsClient) (Application, error)
1150 }
1151
1152
1153 func (future *ApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1154 var azFuture azure.Future
1155 if err := json.Unmarshal(body, &azFuture); err != nil {
1156 return err
1157 }
1158 future.FutureAPI = &azFuture
1159 future.Result = future.result
1160 return nil
1161 }
1162
1163
1164 func (future *ApplicationsCreateOrUpdateFuture) result(client ApplicationsClient) (a Application, err error) {
1165 var done bool
1166 done, err = future.DoneWithContext(context.Background(), client)
1167 if err != nil {
1168 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1169 return
1170 }
1171 if !done {
1172 a.Response.Response = future.Response()
1173 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsCreateOrUpdateFuture")
1174 return
1175 }
1176 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1177 if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
1178 a, err = client.CreateOrUpdateResponder(a.Response.Response)
1179 if err != nil {
1180 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request")
1181 }
1182 }
1183 return
1184 }
1185
1186
1187
1188 type ApplicationsDeleteByIDFuture struct {
1189 azure.FutureAPI
1190
1191
1192 Result func(ApplicationsClient) (autorest.Response, error)
1193 }
1194
1195
1196 func (future *ApplicationsDeleteByIDFuture) UnmarshalJSON(body []byte) error {
1197 var azFuture azure.Future
1198 if err := json.Unmarshal(body, &azFuture); err != nil {
1199 return err
1200 }
1201 future.FutureAPI = &azFuture
1202 future.Result = future.result
1203 return nil
1204 }
1205
1206
1207 func (future *ApplicationsDeleteByIDFuture) result(client ApplicationsClient) (ar autorest.Response, err error) {
1208 var done bool
1209 done, err = future.DoneWithContext(context.Background(), client)
1210 if err != nil {
1211 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsDeleteByIDFuture", "Result", future.Response(), "Polling failure")
1212 return
1213 }
1214 if !done {
1215 ar.Response = future.Response()
1216 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsDeleteByIDFuture")
1217 return
1218 }
1219 ar.Response = future.Response()
1220 return
1221 }
1222
1223
1224
1225 type ApplicationsDeleteFuture struct {
1226 azure.FutureAPI
1227
1228
1229 Result func(ApplicationsClient) (autorest.Response, error)
1230 }
1231
1232
1233 func (future *ApplicationsDeleteFuture) UnmarshalJSON(body []byte) error {
1234 var azFuture azure.Future
1235 if err := json.Unmarshal(body, &azFuture); err != nil {
1236 return err
1237 }
1238 future.FutureAPI = &azFuture
1239 future.Result = future.result
1240 return nil
1241 }
1242
1243
1244 func (future *ApplicationsDeleteFuture) result(client ApplicationsClient) (ar autorest.Response, err error) {
1245 var done bool
1246 done, err = future.DoneWithContext(context.Background(), client)
1247 if err != nil {
1248 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsDeleteFuture", "Result", future.Response(), "Polling failure")
1249 return
1250 }
1251 if !done {
1252 ar.Response = future.Response()
1253 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsDeleteFuture")
1254 return
1255 }
1256 ar.Response = future.Response()
1257 return
1258 }
1259
1260
1261
1262 type ApplicationsRefreshPermissionsFuture struct {
1263 azure.FutureAPI
1264
1265
1266 Result func(ApplicationsClient) (autorest.Response, error)
1267 }
1268
1269
1270 func (future *ApplicationsRefreshPermissionsFuture) UnmarshalJSON(body []byte) error {
1271 var azFuture azure.Future
1272 if err := json.Unmarshal(body, &azFuture); err != nil {
1273 return err
1274 }
1275 future.FutureAPI = &azFuture
1276 future.Result = future.result
1277 return nil
1278 }
1279
1280
1281 func (future *ApplicationsRefreshPermissionsFuture) result(client ApplicationsClient) (ar autorest.Response, err error) {
1282 var done bool
1283 done, err = future.DoneWithContext(context.Background(), client)
1284 if err != nil {
1285 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsRefreshPermissionsFuture", "Result", future.Response(), "Polling failure")
1286 return
1287 }
1288 if !done {
1289 ar.Response = future.Response()
1290 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsRefreshPermissionsFuture")
1291 return
1292 }
1293 ar.Response = future.Response()
1294 return
1295 }
1296
1297
1298
1299 type ApplicationsUpdateAccessFuture struct {
1300 azure.FutureAPI
1301
1302
1303 Result func(ApplicationsClient) (UpdateAccessDefinition, error)
1304 }
1305
1306
1307 func (future *ApplicationsUpdateAccessFuture) UnmarshalJSON(body []byte) error {
1308 var azFuture azure.Future
1309 if err := json.Unmarshal(body, &azFuture); err != nil {
1310 return err
1311 }
1312 future.FutureAPI = &azFuture
1313 future.Result = future.result
1314 return nil
1315 }
1316
1317
1318 func (future *ApplicationsUpdateAccessFuture) result(client ApplicationsClient) (uad UpdateAccessDefinition, err error) {
1319 var done bool
1320 done, err = future.DoneWithContext(context.Background(), client)
1321 if err != nil {
1322 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateAccessFuture", "Result", future.Response(), "Polling failure")
1323 return
1324 }
1325 if !done {
1326 uad.Response.Response = future.Response()
1327 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsUpdateAccessFuture")
1328 return
1329 }
1330 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1331 if uad.Response.Response, err = future.GetResult(sender); err == nil && uad.Response.Response.StatusCode != http.StatusNoContent {
1332 uad, err = client.UpdateAccessResponder(uad.Response.Response)
1333 if err != nil {
1334 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateAccessFuture", "Result", uad.Response.Response, "Failure responding to request")
1335 }
1336 }
1337 return
1338 }
1339
1340
1341
1342 type ApplicationsUpdateByIDFuture struct {
1343 azure.FutureAPI
1344
1345
1346 Result func(ApplicationsClient) (ApplicationPatchable, error)
1347 }
1348
1349
1350 func (future *ApplicationsUpdateByIDFuture) UnmarshalJSON(body []byte) error {
1351 var azFuture azure.Future
1352 if err := json.Unmarshal(body, &azFuture); err != nil {
1353 return err
1354 }
1355 future.FutureAPI = &azFuture
1356 future.Result = future.result
1357 return nil
1358 }
1359
1360
1361 func (future *ApplicationsUpdateByIDFuture) result(client ApplicationsClient) (ap ApplicationPatchable, err error) {
1362 var done bool
1363 done, err = future.DoneWithContext(context.Background(), client)
1364 if err != nil {
1365 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateByIDFuture", "Result", future.Response(), "Polling failure")
1366 return
1367 }
1368 if !done {
1369 ap.Response.Response = future.Response()
1370 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsUpdateByIDFuture")
1371 return
1372 }
1373 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1374 if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
1375 ap, err = client.UpdateByIDResponder(ap.Response.Response)
1376 if err != nil {
1377 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateByIDFuture", "Result", ap.Response.Response, "Failure responding to request")
1378 }
1379 }
1380 return
1381 }
1382
1383
1384
1385 type ApplicationsUpdateFuture struct {
1386 azure.FutureAPI
1387
1388
1389 Result func(ApplicationsClient) (ApplicationPatchable, error)
1390 }
1391
1392
1393 func (future *ApplicationsUpdateFuture) UnmarshalJSON(body []byte) error {
1394 var azFuture azure.Future
1395 if err := json.Unmarshal(body, &azFuture); err != nil {
1396 return err
1397 }
1398 future.FutureAPI = &azFuture
1399 future.Result = future.result
1400 return nil
1401 }
1402
1403
1404 func (future *ApplicationsUpdateFuture) result(client ApplicationsClient) (ap ApplicationPatchable, err error) {
1405 var done bool
1406 done, err = future.DoneWithContext(context.Background(), client)
1407 if err != nil {
1408 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateFuture", "Result", future.Response(), "Polling failure")
1409 return
1410 }
1411 if !done {
1412 ap.Response.Response = future.Response()
1413 err = azure.NewAsyncOpIncompleteError("managedapplications.ApplicationsUpdateFuture")
1414 return
1415 }
1416 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1417 if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
1418 ap, err = client.UpdateResponder(ap.Response.Response)
1419 if err != nil {
1420 err = autorest.NewErrorWithError(err, "managedapplications.ApplicationsUpdateFuture", "Result", ap.Response.Response, "Failure responding to request")
1421 }
1422 }
1423 return
1424 }
1425
1426
1427 type ErrorAdditionalInfo struct {
1428
1429 Type *string `json:"type,omitempty"`
1430
1431 Info interface{} `json:"info,omitempty"`
1432 }
1433
1434
1435 func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
1436 objectMap := make(map[string]interface{})
1437 return json.Marshal(objectMap)
1438 }
1439
1440
1441 type ErrorDetail struct {
1442
1443 Code *string `json:"code,omitempty"`
1444
1445 Message *string `json:"message,omitempty"`
1446
1447 Target *string `json:"target,omitempty"`
1448
1449 Details *[]ErrorDetail `json:"details,omitempty"`
1450
1451 AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
1452 }
1453
1454
1455 func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
1456 objectMap := make(map[string]interface{})
1457 return json.Marshal(objectMap)
1458 }
1459
1460
1461
1462 type ErrorResponse struct {
1463
1464 Error *ErrorDetail `json:"error,omitempty"`
1465 }
1466
1467
1468 type GenericResource struct {
1469
1470 ManagedBy *string `json:"managedBy,omitempty"`
1471
1472 Sku *Sku `json:"sku,omitempty"`
1473
1474 ID *string `json:"id,omitempty"`
1475
1476 Name *string `json:"name,omitempty"`
1477
1478 Type *string `json:"type,omitempty"`
1479
1480 Location *string `json:"location,omitempty"`
1481
1482 Tags map[string]*string `json:"tags"`
1483
1484 SystemData *SystemData `json:"systemData,omitempty"`
1485 }
1486
1487
1488 func (gr GenericResource) MarshalJSON() ([]byte, error) {
1489 objectMap := make(map[string]interface{})
1490 if gr.ManagedBy != nil {
1491 objectMap["managedBy"] = gr.ManagedBy
1492 }
1493 if gr.Sku != nil {
1494 objectMap["sku"] = gr.Sku
1495 }
1496 if gr.Location != nil {
1497 objectMap["location"] = gr.Location
1498 }
1499 if gr.Tags != nil {
1500 objectMap["tags"] = gr.Tags
1501 }
1502 return json.Marshal(objectMap)
1503 }
1504
1505
1506 type Identity struct {
1507
1508 PrincipalID *string `json:"principalId,omitempty"`
1509
1510 TenantID *string `json:"tenantId,omitempty"`
1511
1512 Type ResourceIdentityType `json:"type,omitempty"`
1513
1514 UserAssignedIdentities map[string]*UserAssignedResourceIdentity `json:"userAssignedIdentities"`
1515 }
1516
1517
1518 func (i Identity) MarshalJSON() ([]byte, error) {
1519 objectMap := make(map[string]interface{})
1520 if i.Type != "" {
1521 objectMap["type"] = i.Type
1522 }
1523 if i.UserAssignedIdentities != nil {
1524 objectMap["userAssignedIdentities"] = i.UserAssignedIdentities
1525 }
1526 return json.Marshal(objectMap)
1527 }
1528
1529
1530 type JitApproverDefinition struct {
1531
1532 ID *string `json:"id,omitempty"`
1533
1534 Type JitApproverType `json:"type,omitempty"`
1535
1536 DisplayName *string `json:"displayName,omitempty"`
1537 }
1538
1539
1540 type JitAuthorizationPolicies struct {
1541
1542 PrincipalID *string `json:"principalId,omitempty"`
1543
1544 RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
1545 }
1546
1547
1548 type JitRequestDefinition struct {
1549 autorest.Response `json:"-"`
1550
1551 *JitRequestProperties `json:"properties,omitempty"`
1552
1553 ID *string `json:"id,omitempty"`
1554
1555 Name *string `json:"name,omitempty"`
1556
1557 Type *string `json:"type,omitempty"`
1558
1559 Location *string `json:"location,omitempty"`
1560
1561 Tags map[string]*string `json:"tags"`
1562
1563 SystemData *SystemData `json:"systemData,omitempty"`
1564 }
1565
1566
1567 func (jrd JitRequestDefinition) MarshalJSON() ([]byte, error) {
1568 objectMap := make(map[string]interface{})
1569 if jrd.JitRequestProperties != nil {
1570 objectMap["properties"] = jrd.JitRequestProperties
1571 }
1572 if jrd.Location != nil {
1573 objectMap["location"] = jrd.Location
1574 }
1575 if jrd.Tags != nil {
1576 objectMap["tags"] = jrd.Tags
1577 }
1578 return json.Marshal(objectMap)
1579 }
1580
1581
1582 func (jrd *JitRequestDefinition) UnmarshalJSON(body []byte) error {
1583 var m map[string]*json.RawMessage
1584 err := json.Unmarshal(body, &m)
1585 if err != nil {
1586 return err
1587 }
1588 for k, v := range m {
1589 switch k {
1590 case "properties":
1591 if v != nil {
1592 var jitRequestProperties JitRequestProperties
1593 err = json.Unmarshal(*v, &jitRequestProperties)
1594 if err != nil {
1595 return err
1596 }
1597 jrd.JitRequestProperties = &jitRequestProperties
1598 }
1599 case "id":
1600 if v != nil {
1601 var ID string
1602 err = json.Unmarshal(*v, &ID)
1603 if err != nil {
1604 return err
1605 }
1606 jrd.ID = &ID
1607 }
1608 case "name":
1609 if v != nil {
1610 var name string
1611 err = json.Unmarshal(*v, &name)
1612 if err != nil {
1613 return err
1614 }
1615 jrd.Name = &name
1616 }
1617 case "type":
1618 if v != nil {
1619 var typeVar string
1620 err = json.Unmarshal(*v, &typeVar)
1621 if err != nil {
1622 return err
1623 }
1624 jrd.Type = &typeVar
1625 }
1626 case "location":
1627 if v != nil {
1628 var location string
1629 err = json.Unmarshal(*v, &location)
1630 if err != nil {
1631 return err
1632 }
1633 jrd.Location = &location
1634 }
1635 case "tags":
1636 if v != nil {
1637 var tags map[string]*string
1638 err = json.Unmarshal(*v, &tags)
1639 if err != nil {
1640 return err
1641 }
1642 jrd.Tags = tags
1643 }
1644 case "systemData":
1645 if v != nil {
1646 var systemData SystemData
1647 err = json.Unmarshal(*v, &systemData)
1648 if err != nil {
1649 return err
1650 }
1651 jrd.SystemData = &systemData
1652 }
1653 }
1654 }
1655
1656 return nil
1657 }
1658
1659
1660 type JitRequestDefinitionListResult struct {
1661 autorest.Response `json:"-"`
1662
1663 Value *[]JitRequestDefinition `json:"value,omitempty"`
1664
1665 NextLink *string `json:"nextLink,omitempty"`
1666 }
1667
1668
1669 type JitRequestMetadata struct {
1670
1671 OriginRequestID *string `json:"originRequestId,omitempty"`
1672
1673 RequestorID *string `json:"requestorId,omitempty"`
1674
1675 TenantDisplayName *string `json:"tenantDisplayName,omitempty"`
1676
1677 SubjectDisplayName *string `json:"subjectDisplayName,omitempty"`
1678 }
1679
1680
1681 type JitRequestPatchable struct {
1682
1683 Tags map[string]*string `json:"tags"`
1684 }
1685
1686
1687 func (jrp JitRequestPatchable) MarshalJSON() ([]byte, error) {
1688 objectMap := make(map[string]interface{})
1689 if jrp.Tags != nil {
1690 objectMap["tags"] = jrp.Tags
1691 }
1692 return json.Marshal(objectMap)
1693 }
1694
1695
1696 type JitRequestProperties struct {
1697
1698 ApplicationResourceID *string `json:"applicationResourceId,omitempty"`
1699
1700 PublisherTenantID *string `json:"publisherTenantId,omitempty"`
1701
1702 JitAuthorizationPolicies *[]JitAuthorizationPolicies `json:"jitAuthorizationPolicies,omitempty"`
1703
1704 JitSchedulingPolicy *JitSchedulingPolicy `json:"jitSchedulingPolicy,omitempty"`
1705
1706 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1707
1708 JitRequestState JitRequestState `json:"jitRequestState,omitempty"`
1709
1710 CreatedBy *ApplicationClientDetails `json:"createdBy,omitempty"`
1711
1712 UpdatedBy *ApplicationClientDetails `json:"updatedBy,omitempty"`
1713 }
1714
1715
1716 func (jrp JitRequestProperties) MarshalJSON() ([]byte, error) {
1717 objectMap := make(map[string]interface{})
1718 if jrp.ApplicationResourceID != nil {
1719 objectMap["applicationResourceId"] = jrp.ApplicationResourceID
1720 }
1721 if jrp.JitAuthorizationPolicies != nil {
1722 objectMap["jitAuthorizationPolicies"] = jrp.JitAuthorizationPolicies
1723 }
1724 if jrp.JitSchedulingPolicy != nil {
1725 objectMap["jitSchedulingPolicy"] = jrp.JitSchedulingPolicy
1726 }
1727 return json.Marshal(objectMap)
1728 }
1729
1730
1731
1732 type JitRequestsCreateOrUpdateFuture struct {
1733 azure.FutureAPI
1734
1735
1736 Result func(JitRequestsClient) (JitRequestDefinition, error)
1737 }
1738
1739
1740 func (future *JitRequestsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1741 var azFuture azure.Future
1742 if err := json.Unmarshal(body, &azFuture); err != nil {
1743 return err
1744 }
1745 future.FutureAPI = &azFuture
1746 future.Result = future.result
1747 return nil
1748 }
1749
1750
1751 func (future *JitRequestsCreateOrUpdateFuture) result(client JitRequestsClient) (jrd JitRequestDefinition, err error) {
1752 var done bool
1753 done, err = future.DoneWithContext(context.Background(), client)
1754 if err != nil {
1755 err = autorest.NewErrorWithError(err, "managedapplications.JitRequestsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1756 return
1757 }
1758 if !done {
1759 jrd.Response.Response = future.Response()
1760 err = azure.NewAsyncOpIncompleteError("managedapplications.JitRequestsCreateOrUpdateFuture")
1761 return
1762 }
1763 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1764 if jrd.Response.Response, err = future.GetResult(sender); err == nil && jrd.Response.Response.StatusCode != http.StatusNoContent {
1765 jrd, err = client.CreateOrUpdateResponder(jrd.Response.Response)
1766 if err != nil {
1767 err = autorest.NewErrorWithError(err, "managedapplications.JitRequestsCreateOrUpdateFuture", "Result", jrd.Response.Response, "Failure responding to request")
1768 }
1769 }
1770 return
1771 }
1772
1773
1774 type JitSchedulingPolicy struct {
1775
1776 Type JitSchedulingType `json:"type,omitempty"`
1777 Duration *string `json:"duration,omitempty"`
1778
1779 StartTime *date.Time `json:"startTime,omitempty"`
1780 }
1781
1782
1783 type ListTokenRequest struct {
1784
1785 AuthorizationAudience *string `json:"authorizationAudience,omitempty"`
1786
1787 UserAssignedIdentities *[]string `json:"userAssignedIdentities,omitempty"`
1788 }
1789
1790
1791 type ManagedIdentityToken struct {
1792
1793 AccessToken *string `json:"accessToken,omitempty"`
1794
1795 ExpiresIn *string `json:"expiresIn,omitempty"`
1796
1797 ExpiresOn *string `json:"expiresOn,omitempty"`
1798
1799 NotBefore *string `json:"notBefore,omitempty"`
1800
1801 AuthorizationAudience *string `json:"authorizationAudience,omitempty"`
1802
1803 ResourceID *string `json:"resourceId,omitempty"`
1804
1805 TokenType *string `json:"tokenType,omitempty"`
1806 }
1807
1808
1809 type ManagedIdentityTokenResult struct {
1810 autorest.Response `json:"-"`
1811
1812 Value *[]ManagedIdentityToken `json:"value,omitempty"`
1813 }
1814
1815
1816 type Operation struct {
1817
1818 Name *string `json:"name,omitempty"`
1819
1820 IsDataAction *bool `json:"isDataAction,omitempty"`
1821
1822 Display *OperationDisplay `json:"display,omitempty"`
1823 }
1824
1825
1826 type OperationDisplay struct {
1827
1828 Provider *string `json:"provider,omitempty"`
1829
1830 Resource *string `json:"resource,omitempty"`
1831
1832 Operation *string `json:"operation,omitempty"`
1833
1834 Description *string `json:"description,omitempty"`
1835 }
1836
1837
1838 func (o OperationDisplay) MarshalJSON() ([]byte, error) {
1839 objectMap := make(map[string]interface{})
1840 if o.Provider != nil {
1841 objectMap["provider"] = o.Provider
1842 }
1843 if o.Resource != nil {
1844 objectMap["resource"] = o.Resource
1845 }
1846 if o.Operation != nil {
1847 objectMap["operation"] = o.Operation
1848 }
1849 return json.Marshal(objectMap)
1850 }
1851
1852
1853
1854 type OperationListResult struct {
1855 autorest.Response `json:"-"`
1856
1857 Value *[]Operation `json:"value,omitempty"`
1858
1859 NextLink *string `json:"nextLink,omitempty"`
1860 }
1861
1862
1863 type OperationListResultIterator struct {
1864 i int
1865 page OperationListResultPage
1866 }
1867
1868
1869
1870 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1871 if tracing.IsEnabled() {
1872 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
1873 defer func() {
1874 sc := -1
1875 if iter.Response().Response.Response != nil {
1876 sc = iter.Response().Response.Response.StatusCode
1877 }
1878 tracing.EndSpan(ctx, sc, err)
1879 }()
1880 }
1881 iter.i++
1882 if iter.i < len(iter.page.Values()) {
1883 return nil
1884 }
1885 err = iter.page.NextWithContext(ctx)
1886 if err != nil {
1887 iter.i--
1888 return err
1889 }
1890 iter.i = 0
1891 return nil
1892 }
1893
1894
1895
1896
1897 func (iter *OperationListResultIterator) Next() error {
1898 return iter.NextWithContext(context.Background())
1899 }
1900
1901
1902 func (iter OperationListResultIterator) NotDone() bool {
1903 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1904 }
1905
1906
1907 func (iter OperationListResultIterator) Response() OperationListResult {
1908 return iter.page.Response()
1909 }
1910
1911
1912
1913 func (iter OperationListResultIterator) Value() Operation {
1914 if !iter.page.NotDone() {
1915 return Operation{}
1916 }
1917 return iter.page.Values()[iter.i]
1918 }
1919
1920
1921 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
1922 return OperationListResultIterator{page: page}
1923 }
1924
1925
1926 func (olr OperationListResult) IsEmpty() bool {
1927 return olr.Value == nil || len(*olr.Value) == 0
1928 }
1929
1930
1931 func (olr OperationListResult) hasNextLink() bool {
1932 return olr.NextLink != nil && len(*olr.NextLink) != 0
1933 }
1934
1935
1936
1937 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
1938 if !olr.hasNextLink() {
1939 return nil, nil
1940 }
1941 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1942 autorest.AsJSON(),
1943 autorest.AsGet(),
1944 autorest.WithBaseURL(to.String(olr.NextLink)))
1945 }
1946
1947
1948 type OperationListResultPage struct {
1949 fn func(context.Context, OperationListResult) (OperationListResult, error)
1950 olr OperationListResult
1951 }
1952
1953
1954
1955 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1956 if tracing.IsEnabled() {
1957 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
1958 defer func() {
1959 sc := -1
1960 if page.Response().Response.Response != nil {
1961 sc = page.Response().Response.Response.StatusCode
1962 }
1963 tracing.EndSpan(ctx, sc, err)
1964 }()
1965 }
1966 for {
1967 next, err := page.fn(ctx, page.olr)
1968 if err != nil {
1969 return err
1970 }
1971 page.olr = next
1972 if !next.hasNextLink() || !next.IsEmpty() {
1973 break
1974 }
1975 }
1976 return nil
1977 }
1978
1979
1980
1981
1982 func (page *OperationListResultPage) Next() error {
1983 return page.NextWithContext(context.Background())
1984 }
1985
1986
1987 func (page OperationListResultPage) NotDone() bool {
1988 return !page.olr.IsEmpty()
1989 }
1990
1991
1992 func (page OperationListResultPage) Response() OperationListResult {
1993 return page.olr
1994 }
1995
1996
1997 func (page OperationListResultPage) Values() []Operation {
1998 if page.olr.IsEmpty() {
1999 return nil
2000 }
2001 return *page.olr.Value
2002 }
2003
2004
2005 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
2006 return OperationListResultPage{
2007 fn: getNextPage,
2008 olr: cur,
2009 }
2010 }
2011
2012
2013 type Plan struct {
2014
2015 Name *string `json:"name,omitempty"`
2016
2017 Publisher *string `json:"publisher,omitempty"`
2018
2019 Product *string `json:"product,omitempty"`
2020
2021 PromotionCode *string `json:"promotionCode,omitempty"`
2022
2023 Version *string `json:"version,omitempty"`
2024 }
2025
2026
2027 type PlanPatchable struct {
2028
2029 Name *string `json:"name,omitempty"`
2030
2031 Publisher *string `json:"publisher,omitempty"`
2032
2033 Product *string `json:"product,omitempty"`
2034
2035 PromotionCode *string `json:"promotionCode,omitempty"`
2036
2037 Version *string `json:"version,omitempty"`
2038 }
2039
2040
2041 type Resource struct {
2042
2043 ID *string `json:"id,omitempty"`
2044
2045 Name *string `json:"name,omitempty"`
2046
2047 Type *string `json:"type,omitempty"`
2048
2049 Location *string `json:"location,omitempty"`
2050
2051 Tags map[string]*string `json:"tags"`
2052
2053 SystemData *SystemData `json:"systemData,omitempty"`
2054 }
2055
2056
2057 func (r Resource) MarshalJSON() ([]byte, error) {
2058 objectMap := make(map[string]interface{})
2059 if r.Location != nil {
2060 objectMap["location"] = r.Location
2061 }
2062 if r.Tags != nil {
2063 objectMap["tags"] = r.Tags
2064 }
2065 return json.Marshal(objectMap)
2066 }
2067
2068
2069 type Sku struct {
2070
2071 Name *string `json:"name,omitempty"`
2072
2073 Tier *string `json:"tier,omitempty"`
2074
2075 Size *string `json:"size,omitempty"`
2076
2077 Family *string `json:"family,omitempty"`
2078
2079 Model *string `json:"model,omitempty"`
2080
2081 Capacity *int32 `json:"capacity,omitempty"`
2082 }
2083
2084
2085 type SystemData struct {
2086
2087 CreatedBy *string `json:"createdBy,omitempty"`
2088
2089 CreatedByType CreatedByType `json:"createdByType,omitempty"`
2090
2091 CreatedAt *date.Time `json:"createdAt,omitempty"`
2092
2093 LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
2094
2095 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
2096
2097 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
2098 }
2099
2100
2101 type UpdateAccessDefinition struct {
2102 autorest.Response `json:"-"`
2103
2104 Approver *string `json:"approver,omitempty"`
2105
2106 Metadata *JitRequestMetadata `json:"metadata,omitempty"`
2107
2108 Status Status `json:"status,omitempty"`
2109
2110 SubStatus Substatus `json:"subStatus,omitempty"`
2111 }
2112
2113
2114
2115 type UserAssignedResourceIdentity struct {
2116
2117 PrincipalID *string `json:"principalId,omitempty"`
2118
2119 TenantID *string `json:"tenantId,omitempty"`
2120 }
2121
2122
2123 func (uari UserAssignedResourceIdentity) MarshalJSON() ([]byte, error) {
2124 objectMap := make(map[string]interface{})
2125 return json.Marshal(objectMap)
2126 }
2127
View as plain text