1 package managementgroups
2
3
4
5
6
7
8
9 import (
10 "context"
11 "encoding/json"
12 "github.com/Azure/go-autorest/autorest"
13 "github.com/Azure/go-autorest/autorest/azure"
14 "github.com/Azure/go-autorest/autorest/date"
15 "github.com/Azure/go-autorest/autorest/to"
16 "github.com/Azure/go-autorest/tracing"
17 "net/http"
18 )
19
20
21 const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-02-01/managementgroups"
22
23
24 type AzureAsyncOperationResults struct {
25 autorest.Response `json:"-"`
26
27 ID *string `json:"id,omitempty"`
28
29 Type *string `json:"type,omitempty"`
30
31 Name *string `json:"name,omitempty"`
32
33 Status *string `json:"status,omitempty"`
34 *InfoProperties `json:"properties,omitempty"`
35 }
36
37
38 func (aaor AzureAsyncOperationResults) MarshalJSON() ([]byte, error) {
39 objectMap := make(map[string]interface{})
40 if aaor.InfoProperties != nil {
41 objectMap["properties"] = aaor.InfoProperties
42 }
43 return json.Marshal(objectMap)
44 }
45
46
47 func (aaor *AzureAsyncOperationResults) UnmarshalJSON(body []byte) error {
48 var m map[string]*json.RawMessage
49 err := json.Unmarshal(body, &m)
50 if err != nil {
51 return err
52 }
53 for k, v := range m {
54 switch k {
55 case "id":
56 if v != nil {
57 var ID string
58 err = json.Unmarshal(*v, &ID)
59 if err != nil {
60 return err
61 }
62 aaor.ID = &ID
63 }
64 case "type":
65 if v != nil {
66 var typeVar string
67 err = json.Unmarshal(*v, &typeVar)
68 if err != nil {
69 return err
70 }
71 aaor.Type = &typeVar
72 }
73 case "name":
74 if v != nil {
75 var name string
76 err = json.Unmarshal(*v, &name)
77 if err != nil {
78 return err
79 }
80 aaor.Name = &name
81 }
82 case "status":
83 if v != nil {
84 var status string
85 err = json.Unmarshal(*v, &status)
86 if err != nil {
87 return err
88 }
89 aaor.Status = &status
90 }
91 case "properties":
92 if v != nil {
93 var infoProperties InfoProperties
94 err = json.Unmarshal(*v, &infoProperties)
95 if err != nil {
96 return err
97 }
98 aaor.InfoProperties = &infoProperties
99 }
100 }
101 }
102
103 return nil
104 }
105
106
107 type CheckNameAvailabilityRequest struct {
108
109 Name *string `json:"name,omitempty"`
110
111 Type Type `json:"type,omitempty"`
112 }
113
114
115
116 type CheckNameAvailabilityResult struct {
117 autorest.Response `json:"-"`
118
119 NameAvailable *bool `json:"nameAvailable,omitempty"`
120
121 Reason Reason `json:"reason,omitempty"`
122
123 Message *string `json:"message,omitempty"`
124 }
125
126
127 func (cnar CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) {
128 objectMap := make(map[string]interface{})
129 return json.Marshal(objectMap)
130 }
131
132
133 type ChildInfo struct {
134
135 Type Type1 `json:"type,omitempty"`
136
137 ID *string `json:"id,omitempty"`
138
139 Name *string `json:"name,omitempty"`
140
141 DisplayName *string `json:"displayName,omitempty"`
142
143 Roles *[]string `json:"roles,omitempty"`
144
145 Children *[]ChildInfo `json:"children,omitempty"`
146 }
147
148
149 type CreateManagementGroupChildInfo struct {
150
151 Type Type2 `json:"type,omitempty"`
152
153 ID *string `json:"id,omitempty"`
154
155 Name *string `json:"name,omitempty"`
156
157 DisplayName *string `json:"displayName,omitempty"`
158
159 Roles *[]string `json:"roles,omitempty"`
160
161 Children *[]CreateManagementGroupChildInfo `json:"children,omitempty"`
162 }
163
164
165 func (cmgci CreateManagementGroupChildInfo) MarshalJSON() ([]byte, error) {
166 objectMap := make(map[string]interface{})
167 return json.Marshal(objectMap)
168 }
169
170
171 type CreateManagementGroupDetails struct {
172
173 Version *float64 `json:"version,omitempty"`
174
175 UpdatedTime *date.Time `json:"updatedTime,omitempty"`
176
177 UpdatedBy *string `json:"updatedBy,omitempty"`
178 Parent *CreateParentGroupInfo `json:"parent,omitempty"`
179 }
180
181
182 func (cmgd CreateManagementGroupDetails) MarshalJSON() ([]byte, error) {
183 objectMap := make(map[string]interface{})
184 if cmgd.Parent != nil {
185 objectMap["parent"] = cmgd.Parent
186 }
187 return json.Marshal(objectMap)
188 }
189
190
191 type CreateManagementGroupProperties struct {
192
193 TenantID *string `json:"tenantId,omitempty"`
194
195 DisplayName *string `json:"displayName,omitempty"`
196
197 Roles *[]string `json:"roles,omitempty"`
198 Details *CreateManagementGroupDetails `json:"details,omitempty"`
199
200 Children *[]CreateManagementGroupChildInfo `json:"children,omitempty"`
201 }
202
203
204 func (cmgp CreateManagementGroupProperties) MarshalJSON() ([]byte, error) {
205 objectMap := make(map[string]interface{})
206 if cmgp.DisplayName != nil {
207 objectMap["displayName"] = cmgp.DisplayName
208 }
209 if cmgp.Details != nil {
210 objectMap["details"] = cmgp.Details
211 }
212 return json.Marshal(objectMap)
213 }
214
215
216 type CreateManagementGroupRequest struct {
217
218 ID *string `json:"id,omitempty"`
219
220 Type *string `json:"type,omitempty"`
221
222 Name *string `json:"name,omitempty"`
223 *CreateManagementGroupProperties `json:"properties,omitempty"`
224 }
225
226
227 func (cmgr CreateManagementGroupRequest) MarshalJSON() ([]byte, error) {
228 objectMap := make(map[string]interface{})
229 if cmgr.Name != nil {
230 objectMap["name"] = cmgr.Name
231 }
232 if cmgr.CreateManagementGroupProperties != nil {
233 objectMap["properties"] = cmgr.CreateManagementGroupProperties
234 }
235 return json.Marshal(objectMap)
236 }
237
238
239 func (cmgr *CreateManagementGroupRequest) UnmarshalJSON(body []byte) error {
240 var m map[string]*json.RawMessage
241 err := json.Unmarshal(body, &m)
242 if err != nil {
243 return err
244 }
245 for k, v := range m {
246 switch k {
247 case "id":
248 if v != nil {
249 var ID string
250 err = json.Unmarshal(*v, &ID)
251 if err != nil {
252 return err
253 }
254 cmgr.ID = &ID
255 }
256 case "type":
257 if v != nil {
258 var typeVar string
259 err = json.Unmarshal(*v, &typeVar)
260 if err != nil {
261 return err
262 }
263 cmgr.Type = &typeVar
264 }
265 case "name":
266 if v != nil {
267 var name string
268 err = json.Unmarshal(*v, &name)
269 if err != nil {
270 return err
271 }
272 cmgr.Name = &name
273 }
274 case "properties":
275 if v != nil {
276 var createManagementGroupProperties CreateManagementGroupProperties
277 err = json.Unmarshal(*v, &createManagementGroupProperties)
278 if err != nil {
279 return err
280 }
281 cmgr.CreateManagementGroupProperties = &createManagementGroupProperties
282 }
283 }
284 }
285
286 return nil
287 }
288
289
290
291 type CreateOrUpdateFuture struct {
292 azure.FutureAPI
293
294
295 Result func(Client) (SetObject, error)
296 }
297
298
299 func (future *CreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
300 var azFuture azure.Future
301 if err := json.Unmarshal(body, &azFuture); err != nil {
302 return err
303 }
304 future.FutureAPI = &azFuture
305 future.Result = future.result
306 return nil
307 }
308
309
310 func (future *CreateOrUpdateFuture) result(client Client) (so SetObject, err error) {
311 var done bool
312 done, err = future.DoneWithContext(context.Background(), client)
313 if err != nil {
314 err = autorest.NewErrorWithError(err, "managementgroups.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
315 return
316 }
317 if !done {
318 so.Response.Response = future.Response()
319 err = azure.NewAsyncOpIncompleteError("managementgroups.CreateOrUpdateFuture")
320 return
321 }
322 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
323 if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
324 so, err = client.CreateOrUpdateResponder(so.Response.Response)
325 if err != nil {
326 err = autorest.NewErrorWithError(err, "managementgroups.CreateOrUpdateFuture", "Result", so.Response.Response, "Failure responding to request")
327 }
328 }
329 return
330 }
331
332
333
334 type CreateOrUpdateSettingsProperties struct {
335
336 RequireAuthorizationForGroupCreation *bool `json:"requireAuthorizationForGroupCreation,omitempty"`
337
338 DefaultManagementGroup *string `json:"defaultManagementGroup,omitempty"`
339 }
340
341
342 type CreateOrUpdateSettingsRequest struct {
343 *CreateOrUpdateSettingsProperties `json:"properties,omitempty"`
344 }
345
346
347 func (cousr CreateOrUpdateSettingsRequest) MarshalJSON() ([]byte, error) {
348 objectMap := make(map[string]interface{})
349 if cousr.CreateOrUpdateSettingsProperties != nil {
350 objectMap["properties"] = cousr.CreateOrUpdateSettingsProperties
351 }
352 return json.Marshal(objectMap)
353 }
354
355
356 func (cousr *CreateOrUpdateSettingsRequest) UnmarshalJSON(body []byte) error {
357 var m map[string]*json.RawMessage
358 err := json.Unmarshal(body, &m)
359 if err != nil {
360 return err
361 }
362 for k, v := range m {
363 switch k {
364 case "properties":
365 if v != nil {
366 var createOrUpdateSettingsProperties CreateOrUpdateSettingsProperties
367 err = json.Unmarshal(*v, &createOrUpdateSettingsProperties)
368 if err != nil {
369 return err
370 }
371 cousr.CreateOrUpdateSettingsProperties = &createOrUpdateSettingsProperties
372 }
373 }
374 }
375
376 return nil
377 }
378
379
380 type CreateParentGroupInfo struct {
381
382 ID *string `json:"id,omitempty"`
383
384 Name *string `json:"name,omitempty"`
385
386 DisplayName *string `json:"displayName,omitempty"`
387 }
388
389
390 func (cpgi CreateParentGroupInfo) MarshalJSON() ([]byte, error) {
391 objectMap := make(map[string]interface{})
392 if cpgi.ID != nil {
393 objectMap["id"] = cpgi.ID
394 }
395 return json.Marshal(objectMap)
396 }
397
398
399 type DeleteFuture struct {
400 azure.FutureAPI
401
402
403 Result func(Client) (AzureAsyncOperationResults, error)
404 }
405
406
407 func (future *DeleteFuture) UnmarshalJSON(body []byte) error {
408 var azFuture azure.Future
409 if err := json.Unmarshal(body, &azFuture); err != nil {
410 return err
411 }
412 future.FutureAPI = &azFuture
413 future.Result = future.result
414 return nil
415 }
416
417
418 func (future *DeleteFuture) result(client Client) (aaor AzureAsyncOperationResults, err error) {
419 var done bool
420 done, err = future.DoneWithContext(context.Background(), client)
421 if err != nil {
422 err = autorest.NewErrorWithError(err, "managementgroups.DeleteFuture", "Result", future.Response(), "Polling failure")
423 return
424 }
425 if !done {
426 aaor.Response.Response = future.Response()
427 err = azure.NewAsyncOpIncompleteError("managementgroups.DeleteFuture")
428 return
429 }
430 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
431 if aaor.Response.Response, err = future.GetResult(sender); err == nil && aaor.Response.Response.StatusCode != http.StatusNoContent {
432 aaor, err = client.DeleteResponder(aaor.Response.Response)
433 if err != nil {
434 err = autorest.NewErrorWithError(err, "managementgroups.DeleteFuture", "Result", aaor.Response.Response, "Failure responding to request")
435 }
436 }
437 return
438 }
439
440
441 type DescendantInfo struct {
442
443 ID *string `json:"id,omitempty"`
444
445 Type *string `json:"type,omitempty"`
446
447 Name *string `json:"name,omitempty"`
448 *DescendantInfoProperties `json:"properties,omitempty"`
449 }
450
451
452 func (di DescendantInfo) MarshalJSON() ([]byte, error) {
453 objectMap := make(map[string]interface{})
454 if di.DescendantInfoProperties != nil {
455 objectMap["properties"] = di.DescendantInfoProperties
456 }
457 return json.Marshal(objectMap)
458 }
459
460
461 func (di *DescendantInfo) UnmarshalJSON(body []byte) error {
462 var m map[string]*json.RawMessage
463 err := json.Unmarshal(body, &m)
464 if err != nil {
465 return err
466 }
467 for k, v := range m {
468 switch k {
469 case "id":
470 if v != nil {
471 var ID string
472 err = json.Unmarshal(*v, &ID)
473 if err != nil {
474 return err
475 }
476 di.ID = &ID
477 }
478 case "type":
479 if v != nil {
480 var typeVar string
481 err = json.Unmarshal(*v, &typeVar)
482 if err != nil {
483 return err
484 }
485 di.Type = &typeVar
486 }
487 case "name":
488 if v != nil {
489 var name string
490 err = json.Unmarshal(*v, &name)
491 if err != nil {
492 return err
493 }
494 di.Name = &name
495 }
496 case "properties":
497 if v != nil {
498 var descendantInfoProperties DescendantInfoProperties
499 err = json.Unmarshal(*v, &descendantInfoProperties)
500 if err != nil {
501 return err
502 }
503 di.DescendantInfoProperties = &descendantInfoProperties
504 }
505 }
506 }
507
508 return nil
509 }
510
511
512 type DescendantInfoProperties struct {
513
514 DisplayName *string `json:"displayName,omitempty"`
515 Parent *DescendantParentGroupInfo `json:"parent,omitempty"`
516 }
517
518
519 type DescendantListResult struct {
520 autorest.Response `json:"-"`
521
522 Value *[]DescendantInfo `json:"value,omitempty"`
523
524 NextLink *string `json:"nextLink,omitempty"`
525 }
526
527
528 func (dlr DescendantListResult) MarshalJSON() ([]byte, error) {
529 objectMap := make(map[string]interface{})
530 if dlr.Value != nil {
531 objectMap["value"] = dlr.Value
532 }
533 return json.Marshal(objectMap)
534 }
535
536
537 type DescendantListResultIterator struct {
538 i int
539 page DescendantListResultPage
540 }
541
542
543
544 func (iter *DescendantListResultIterator) NextWithContext(ctx context.Context) (err error) {
545 if tracing.IsEnabled() {
546 ctx = tracing.StartSpan(ctx, fqdn+"/DescendantListResultIterator.NextWithContext")
547 defer func() {
548 sc := -1
549 if iter.Response().Response.Response != nil {
550 sc = iter.Response().Response.Response.StatusCode
551 }
552 tracing.EndSpan(ctx, sc, err)
553 }()
554 }
555 iter.i++
556 if iter.i < len(iter.page.Values()) {
557 return nil
558 }
559 err = iter.page.NextWithContext(ctx)
560 if err != nil {
561 iter.i--
562 return err
563 }
564 iter.i = 0
565 return nil
566 }
567
568
569
570
571 func (iter *DescendantListResultIterator) Next() error {
572 return iter.NextWithContext(context.Background())
573 }
574
575
576 func (iter DescendantListResultIterator) NotDone() bool {
577 return iter.page.NotDone() && iter.i < len(iter.page.Values())
578 }
579
580
581 func (iter DescendantListResultIterator) Response() DescendantListResult {
582 return iter.page.Response()
583 }
584
585
586
587 func (iter DescendantListResultIterator) Value() DescendantInfo {
588 if !iter.page.NotDone() {
589 return DescendantInfo{}
590 }
591 return iter.page.Values()[iter.i]
592 }
593
594
595 func NewDescendantListResultIterator(page DescendantListResultPage) DescendantListResultIterator {
596 return DescendantListResultIterator{page: page}
597 }
598
599
600 func (dlr DescendantListResult) IsEmpty() bool {
601 return dlr.Value == nil || len(*dlr.Value) == 0
602 }
603
604
605 func (dlr DescendantListResult) hasNextLink() bool {
606 return dlr.NextLink != nil && len(*dlr.NextLink) != 0
607 }
608
609
610
611 func (dlr DescendantListResult) descendantListResultPreparer(ctx context.Context) (*http.Request, error) {
612 if !dlr.hasNextLink() {
613 return nil, nil
614 }
615 return autorest.Prepare((&http.Request{}).WithContext(ctx),
616 autorest.AsJSON(),
617 autorest.AsGet(),
618 autorest.WithBaseURL(to.String(dlr.NextLink)))
619 }
620
621
622 type DescendantListResultPage struct {
623 fn func(context.Context, DescendantListResult) (DescendantListResult, error)
624 dlr DescendantListResult
625 }
626
627
628
629 func (page *DescendantListResultPage) NextWithContext(ctx context.Context) (err error) {
630 if tracing.IsEnabled() {
631 ctx = tracing.StartSpan(ctx, fqdn+"/DescendantListResultPage.NextWithContext")
632 defer func() {
633 sc := -1
634 if page.Response().Response.Response != nil {
635 sc = page.Response().Response.Response.StatusCode
636 }
637 tracing.EndSpan(ctx, sc, err)
638 }()
639 }
640 for {
641 next, err := page.fn(ctx, page.dlr)
642 if err != nil {
643 return err
644 }
645 page.dlr = next
646 if !next.hasNextLink() || !next.IsEmpty() {
647 break
648 }
649 }
650 return nil
651 }
652
653
654
655
656 func (page *DescendantListResultPage) Next() error {
657 return page.NextWithContext(context.Background())
658 }
659
660
661 func (page DescendantListResultPage) NotDone() bool {
662 return !page.dlr.IsEmpty()
663 }
664
665
666 func (page DescendantListResultPage) Response() DescendantListResult {
667 return page.dlr
668 }
669
670
671 func (page DescendantListResultPage) Values() []DescendantInfo {
672 if page.dlr.IsEmpty() {
673 return nil
674 }
675 return *page.dlr.Value
676 }
677
678
679 func NewDescendantListResultPage(cur DescendantListResult, getNextPage func(context.Context, DescendantListResult) (DescendantListResult, error)) DescendantListResultPage {
680 return DescendantListResultPage{
681 fn: getNextPage,
682 dlr: cur,
683 }
684 }
685
686
687 type DescendantParentGroupInfo struct {
688
689 ID *string `json:"id,omitempty"`
690 }
691
692
693 type Details struct {
694
695 Version *float64 `json:"version,omitempty"`
696
697 UpdatedTime *date.Time `json:"updatedTime,omitempty"`
698
699 UpdatedBy *string `json:"updatedBy,omitempty"`
700 Parent *ParentGroupInfo `json:"parent,omitempty"`
701 }
702
703
704 type EntityHierarchyItem struct {
705
706 ID *string `json:"id,omitempty"`
707
708 Type *string `json:"type,omitempty"`
709
710 Name *string `json:"name,omitempty"`
711 *EntityHierarchyItemProperties `json:"properties,omitempty"`
712 }
713
714
715 func (ehi EntityHierarchyItem) MarshalJSON() ([]byte, error) {
716 objectMap := make(map[string]interface{})
717 if ehi.EntityHierarchyItemProperties != nil {
718 objectMap["properties"] = ehi.EntityHierarchyItemProperties
719 }
720 return json.Marshal(objectMap)
721 }
722
723
724 func (ehi *EntityHierarchyItem) UnmarshalJSON(body []byte) error {
725 var m map[string]*json.RawMessage
726 err := json.Unmarshal(body, &m)
727 if err != nil {
728 return err
729 }
730 for k, v := range m {
731 switch k {
732 case "id":
733 if v != nil {
734 var ID string
735 err = json.Unmarshal(*v, &ID)
736 if err != nil {
737 return err
738 }
739 ehi.ID = &ID
740 }
741 case "type":
742 if v != nil {
743 var typeVar string
744 err = json.Unmarshal(*v, &typeVar)
745 if err != nil {
746 return err
747 }
748 ehi.Type = &typeVar
749 }
750 case "name":
751 if v != nil {
752 var name string
753 err = json.Unmarshal(*v, &name)
754 if err != nil {
755 return err
756 }
757 ehi.Name = &name
758 }
759 case "properties":
760 if v != nil {
761 var entityHierarchyItemProperties EntityHierarchyItemProperties
762 err = json.Unmarshal(*v, &entityHierarchyItemProperties)
763 if err != nil {
764 return err
765 }
766 ehi.EntityHierarchyItemProperties = &entityHierarchyItemProperties
767 }
768 }
769 }
770
771 return nil
772 }
773
774
775 type EntityHierarchyItemProperties struct {
776
777 DisplayName *string `json:"displayName,omitempty"`
778
779 Permissions Permissions1 `json:"permissions,omitempty"`
780
781 Children *[]EntityHierarchyItem `json:"children,omitempty"`
782 }
783
784
785 type EntityInfo struct {
786
787 ID *string `json:"id,omitempty"`
788
789 Type *string `json:"type,omitempty"`
790
791 Name *string `json:"name,omitempty"`
792 *EntityInfoProperties `json:"properties,omitempty"`
793 }
794
795
796 func (ei EntityInfo) MarshalJSON() ([]byte, error) {
797 objectMap := make(map[string]interface{})
798 if ei.EntityInfoProperties != nil {
799 objectMap["properties"] = ei.EntityInfoProperties
800 }
801 return json.Marshal(objectMap)
802 }
803
804
805 func (ei *EntityInfo) UnmarshalJSON(body []byte) error {
806 var m map[string]*json.RawMessage
807 err := json.Unmarshal(body, &m)
808 if err != nil {
809 return err
810 }
811 for k, v := range m {
812 switch k {
813 case "id":
814 if v != nil {
815 var ID string
816 err = json.Unmarshal(*v, &ID)
817 if err != nil {
818 return err
819 }
820 ei.ID = &ID
821 }
822 case "type":
823 if v != nil {
824 var typeVar string
825 err = json.Unmarshal(*v, &typeVar)
826 if err != nil {
827 return err
828 }
829 ei.Type = &typeVar
830 }
831 case "name":
832 if v != nil {
833 var name string
834 err = json.Unmarshal(*v, &name)
835 if err != nil {
836 return err
837 }
838 ei.Name = &name
839 }
840 case "properties":
841 if v != nil {
842 var entityInfoProperties EntityInfoProperties
843 err = json.Unmarshal(*v, &entityInfoProperties)
844 if err != nil {
845 return err
846 }
847 ei.EntityInfoProperties = &entityInfoProperties
848 }
849 }
850 }
851
852 return nil
853 }
854
855
856 type EntityInfoProperties struct {
857
858 TenantID *string `json:"tenantId,omitempty"`
859
860 DisplayName *string `json:"displayName,omitempty"`
861 Parent *EntityParentGroupInfo `json:"parent,omitempty"`
862
863 Permissions Permissions `json:"permissions,omitempty"`
864
865 InheritedPermissions InheritedPermissions `json:"inheritedPermissions,omitempty"`
866 NumberOfDescendants *int32 `json:"numberOfDescendants,omitempty"`
867
868 NumberOfChildren *int32 `json:"numberOfChildren,omitempty"`
869
870 NumberOfChildGroups *int32 `json:"numberOfChildGroups,omitempty"`
871
872 ParentDisplayNameChain *[]string `json:"parentDisplayNameChain,omitempty"`
873
874 ParentNameChain *[]string `json:"parentNameChain,omitempty"`
875 }
876
877
878 type EntityListResult struct {
879 autorest.Response `json:"-"`
880
881 Value *[]EntityInfo `json:"value,omitempty"`
882
883 Count *int32 `json:"count,omitempty"`
884
885 NextLink *string `json:"nextLink,omitempty"`
886 }
887
888
889 func (elr EntityListResult) MarshalJSON() ([]byte, error) {
890 objectMap := make(map[string]interface{})
891 if elr.Value != nil {
892 objectMap["value"] = elr.Value
893 }
894 return json.Marshal(objectMap)
895 }
896
897
898 type EntityListResultIterator struct {
899 i int
900 page EntityListResultPage
901 }
902
903
904
905 func (iter *EntityListResultIterator) NextWithContext(ctx context.Context) (err error) {
906 if tracing.IsEnabled() {
907 ctx = tracing.StartSpan(ctx, fqdn+"/EntityListResultIterator.NextWithContext")
908 defer func() {
909 sc := -1
910 if iter.Response().Response.Response != nil {
911 sc = iter.Response().Response.Response.StatusCode
912 }
913 tracing.EndSpan(ctx, sc, err)
914 }()
915 }
916 iter.i++
917 if iter.i < len(iter.page.Values()) {
918 return nil
919 }
920 err = iter.page.NextWithContext(ctx)
921 if err != nil {
922 iter.i--
923 return err
924 }
925 iter.i = 0
926 return nil
927 }
928
929
930
931
932 func (iter *EntityListResultIterator) Next() error {
933 return iter.NextWithContext(context.Background())
934 }
935
936
937 func (iter EntityListResultIterator) NotDone() bool {
938 return iter.page.NotDone() && iter.i < len(iter.page.Values())
939 }
940
941
942 func (iter EntityListResultIterator) Response() EntityListResult {
943 return iter.page.Response()
944 }
945
946
947
948 func (iter EntityListResultIterator) Value() EntityInfo {
949 if !iter.page.NotDone() {
950 return EntityInfo{}
951 }
952 return iter.page.Values()[iter.i]
953 }
954
955
956 func NewEntityListResultIterator(page EntityListResultPage) EntityListResultIterator {
957 return EntityListResultIterator{page: page}
958 }
959
960
961 func (elr EntityListResult) IsEmpty() bool {
962 return elr.Value == nil || len(*elr.Value) == 0
963 }
964
965
966 func (elr EntityListResult) hasNextLink() bool {
967 return elr.NextLink != nil && len(*elr.NextLink) != 0
968 }
969
970
971
972 func (elr EntityListResult) entityListResultPreparer(ctx context.Context) (*http.Request, error) {
973 if !elr.hasNextLink() {
974 return nil, nil
975 }
976 return autorest.Prepare((&http.Request{}).WithContext(ctx),
977 autorest.AsJSON(),
978 autorest.AsGet(),
979 autorest.WithBaseURL(to.String(elr.NextLink)))
980 }
981
982
983 type EntityListResultPage struct {
984 fn func(context.Context, EntityListResult) (EntityListResult, error)
985 elr EntityListResult
986 }
987
988
989
990 func (page *EntityListResultPage) NextWithContext(ctx context.Context) (err error) {
991 if tracing.IsEnabled() {
992 ctx = tracing.StartSpan(ctx, fqdn+"/EntityListResultPage.NextWithContext")
993 defer func() {
994 sc := -1
995 if page.Response().Response.Response != nil {
996 sc = page.Response().Response.Response.StatusCode
997 }
998 tracing.EndSpan(ctx, sc, err)
999 }()
1000 }
1001 for {
1002 next, err := page.fn(ctx, page.elr)
1003 if err != nil {
1004 return err
1005 }
1006 page.elr = next
1007 if !next.hasNextLink() || !next.IsEmpty() {
1008 break
1009 }
1010 }
1011 return nil
1012 }
1013
1014
1015
1016
1017 func (page *EntityListResultPage) Next() error {
1018 return page.NextWithContext(context.Background())
1019 }
1020
1021
1022 func (page EntityListResultPage) NotDone() bool {
1023 return !page.elr.IsEmpty()
1024 }
1025
1026
1027 func (page EntityListResultPage) Response() EntityListResult {
1028 return page.elr
1029 }
1030
1031
1032 func (page EntityListResultPage) Values() []EntityInfo {
1033 if page.elr.IsEmpty() {
1034 return nil
1035 }
1036 return *page.elr.Value
1037 }
1038
1039
1040 func NewEntityListResultPage(cur EntityListResult, getNextPage func(context.Context, EntityListResult) (EntityListResult, error)) EntityListResultPage {
1041 return EntityListResultPage{
1042 fn: getNextPage,
1043 elr: cur,
1044 }
1045 }
1046
1047
1048 type EntityParentGroupInfo struct {
1049
1050 ID *string `json:"id,omitempty"`
1051 }
1052
1053
1054 type ErrorDetails struct {
1055
1056 Code *string `json:"code,omitempty"`
1057
1058 Message *string `json:"message,omitempty"`
1059
1060 Details *string `json:"details,omitempty"`
1061 }
1062
1063
1064 type ErrorResponse struct {
1065 Error *ErrorDetails `json:"error,omitempty"`
1066 }
1067
1068
1069 type HierarchySettings struct {
1070 autorest.Response `json:"-"`
1071
1072 ID *string `json:"id,omitempty"`
1073
1074 Type *string `json:"type,omitempty"`
1075
1076 Name *string `json:"name,omitempty"`
1077 *HierarchySettingsProperties `json:"properties,omitempty"`
1078 }
1079
1080
1081 func (hs HierarchySettings) MarshalJSON() ([]byte, error) {
1082 objectMap := make(map[string]interface{})
1083 if hs.HierarchySettingsProperties != nil {
1084 objectMap["properties"] = hs.HierarchySettingsProperties
1085 }
1086 return json.Marshal(objectMap)
1087 }
1088
1089
1090 func (hs *HierarchySettings) UnmarshalJSON(body []byte) error {
1091 var m map[string]*json.RawMessage
1092 err := json.Unmarshal(body, &m)
1093 if err != nil {
1094 return err
1095 }
1096 for k, v := range m {
1097 switch k {
1098 case "id":
1099 if v != nil {
1100 var ID string
1101 err = json.Unmarshal(*v, &ID)
1102 if err != nil {
1103 return err
1104 }
1105 hs.ID = &ID
1106 }
1107 case "type":
1108 if v != nil {
1109 var typeVar string
1110 err = json.Unmarshal(*v, &typeVar)
1111 if err != nil {
1112 return err
1113 }
1114 hs.Type = &typeVar
1115 }
1116 case "name":
1117 if v != nil {
1118 var name string
1119 err = json.Unmarshal(*v, &name)
1120 if err != nil {
1121 return err
1122 }
1123 hs.Name = &name
1124 }
1125 case "properties":
1126 if v != nil {
1127 var hierarchySettingsProperties HierarchySettingsProperties
1128 err = json.Unmarshal(*v, &hierarchySettingsProperties)
1129 if err != nil {
1130 return err
1131 }
1132 hs.HierarchySettingsProperties = &hierarchySettingsProperties
1133 }
1134 }
1135 }
1136
1137 return nil
1138 }
1139
1140
1141 type HierarchySettingsInfo struct {
1142
1143 ID *string `json:"id,omitempty"`
1144
1145 Type *string `json:"type,omitempty"`
1146
1147 Name *string `json:"name,omitempty"`
1148 *HierarchySettingsProperties `json:"properties,omitempty"`
1149 }
1150
1151
1152 func (hsi HierarchySettingsInfo) MarshalJSON() ([]byte, error) {
1153 objectMap := make(map[string]interface{})
1154 if hsi.HierarchySettingsProperties != nil {
1155 objectMap["properties"] = hsi.HierarchySettingsProperties
1156 }
1157 return json.Marshal(objectMap)
1158 }
1159
1160
1161 func (hsi *HierarchySettingsInfo) UnmarshalJSON(body []byte) error {
1162 var m map[string]*json.RawMessage
1163 err := json.Unmarshal(body, &m)
1164 if err != nil {
1165 return err
1166 }
1167 for k, v := range m {
1168 switch k {
1169 case "id":
1170 if v != nil {
1171 var ID string
1172 err = json.Unmarshal(*v, &ID)
1173 if err != nil {
1174 return err
1175 }
1176 hsi.ID = &ID
1177 }
1178 case "type":
1179 if v != nil {
1180 var typeVar string
1181 err = json.Unmarshal(*v, &typeVar)
1182 if err != nil {
1183 return err
1184 }
1185 hsi.Type = &typeVar
1186 }
1187 case "name":
1188 if v != nil {
1189 var name string
1190 err = json.Unmarshal(*v, &name)
1191 if err != nil {
1192 return err
1193 }
1194 hsi.Name = &name
1195 }
1196 case "properties":
1197 if v != nil {
1198 var hierarchySettingsProperties HierarchySettingsProperties
1199 err = json.Unmarshal(*v, &hierarchySettingsProperties)
1200 if err != nil {
1201 return err
1202 }
1203 hsi.HierarchySettingsProperties = &hierarchySettingsProperties
1204 }
1205 }
1206 }
1207
1208 return nil
1209 }
1210
1211
1212 type HierarchySettingsList struct {
1213 autorest.Response `json:"-"`
1214
1215 Value *[]HierarchySettingsInfo `json:"value,omitempty"`
1216
1217 NextLink *string `json:"nextLink,omitempty"`
1218 }
1219
1220
1221 func (hsl HierarchySettingsList) MarshalJSON() ([]byte, error) {
1222 objectMap := make(map[string]interface{})
1223 if hsl.Value != nil {
1224 objectMap["value"] = hsl.Value
1225 }
1226 return json.Marshal(objectMap)
1227 }
1228
1229
1230 type HierarchySettingsProperties struct {
1231
1232 TenantID *string `json:"tenantId,omitempty"`
1233
1234 RequireAuthorizationForGroupCreation *bool `json:"requireAuthorizationForGroupCreation,omitempty"`
1235
1236 DefaultManagementGroup *string `json:"defaultManagementGroup,omitempty"`
1237 }
1238
1239
1240 type Info struct {
1241
1242 ID *string `json:"id,omitempty"`
1243
1244 Type *string `json:"type,omitempty"`
1245
1246 Name *string `json:"name,omitempty"`
1247 *InfoProperties `json:"properties,omitempty"`
1248 }
1249
1250
1251 func (i Info) MarshalJSON() ([]byte, error) {
1252 objectMap := make(map[string]interface{})
1253 if i.InfoProperties != nil {
1254 objectMap["properties"] = i.InfoProperties
1255 }
1256 return json.Marshal(objectMap)
1257 }
1258
1259
1260 func (i *Info) UnmarshalJSON(body []byte) error {
1261 var m map[string]*json.RawMessage
1262 err := json.Unmarshal(body, &m)
1263 if err != nil {
1264 return err
1265 }
1266 for k, v := range m {
1267 switch k {
1268 case "id":
1269 if v != nil {
1270 var ID string
1271 err = json.Unmarshal(*v, &ID)
1272 if err != nil {
1273 return err
1274 }
1275 i.ID = &ID
1276 }
1277 case "type":
1278 if v != nil {
1279 var typeVar string
1280 err = json.Unmarshal(*v, &typeVar)
1281 if err != nil {
1282 return err
1283 }
1284 i.Type = &typeVar
1285 }
1286 case "name":
1287 if v != nil {
1288 var name string
1289 err = json.Unmarshal(*v, &name)
1290 if err != nil {
1291 return err
1292 }
1293 i.Name = &name
1294 }
1295 case "properties":
1296 if v != nil {
1297 var infoProperties InfoProperties
1298 err = json.Unmarshal(*v, &infoProperties)
1299 if err != nil {
1300 return err
1301 }
1302 i.InfoProperties = &infoProperties
1303 }
1304 }
1305 }
1306
1307 return nil
1308 }
1309
1310
1311 type InfoProperties struct {
1312
1313 TenantID *string `json:"tenantId,omitempty"`
1314
1315 DisplayName *string `json:"displayName,omitempty"`
1316 }
1317
1318
1319 type ListResult struct {
1320 autorest.Response `json:"-"`
1321
1322 Value *[]Info `json:"value,omitempty"`
1323
1324 NextLink *string `json:"nextLink,omitempty"`
1325 }
1326
1327
1328 func (lr ListResult) MarshalJSON() ([]byte, error) {
1329 objectMap := make(map[string]interface{})
1330 if lr.Value != nil {
1331 objectMap["value"] = lr.Value
1332 }
1333 return json.Marshal(objectMap)
1334 }
1335
1336
1337 type ListResultIterator struct {
1338 i int
1339 page ListResultPage
1340 }
1341
1342
1343
1344 func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) {
1345 if tracing.IsEnabled() {
1346 ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext")
1347 defer func() {
1348 sc := -1
1349 if iter.Response().Response.Response != nil {
1350 sc = iter.Response().Response.Response.StatusCode
1351 }
1352 tracing.EndSpan(ctx, sc, err)
1353 }()
1354 }
1355 iter.i++
1356 if iter.i < len(iter.page.Values()) {
1357 return nil
1358 }
1359 err = iter.page.NextWithContext(ctx)
1360 if err != nil {
1361 iter.i--
1362 return err
1363 }
1364 iter.i = 0
1365 return nil
1366 }
1367
1368
1369
1370
1371 func (iter *ListResultIterator) Next() error {
1372 return iter.NextWithContext(context.Background())
1373 }
1374
1375
1376 func (iter ListResultIterator) NotDone() bool {
1377 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1378 }
1379
1380
1381 func (iter ListResultIterator) Response() ListResult {
1382 return iter.page.Response()
1383 }
1384
1385
1386
1387 func (iter ListResultIterator) Value() Info {
1388 if !iter.page.NotDone() {
1389 return Info{}
1390 }
1391 return iter.page.Values()[iter.i]
1392 }
1393
1394
1395 func NewListResultIterator(page ListResultPage) ListResultIterator {
1396 return ListResultIterator{page: page}
1397 }
1398
1399
1400 func (lr ListResult) IsEmpty() bool {
1401 return lr.Value == nil || len(*lr.Value) == 0
1402 }
1403
1404
1405 func (lr ListResult) hasNextLink() bool {
1406 return lr.NextLink != nil && len(*lr.NextLink) != 0
1407 }
1408
1409
1410
1411 func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) {
1412 if !lr.hasNextLink() {
1413 return nil, nil
1414 }
1415 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1416 autorest.AsJSON(),
1417 autorest.AsGet(),
1418 autorest.WithBaseURL(to.String(lr.NextLink)))
1419 }
1420
1421
1422 type ListResultPage struct {
1423 fn func(context.Context, ListResult) (ListResult, error)
1424 lr ListResult
1425 }
1426
1427
1428
1429 func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) {
1430 if tracing.IsEnabled() {
1431 ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext")
1432 defer func() {
1433 sc := -1
1434 if page.Response().Response.Response != nil {
1435 sc = page.Response().Response.Response.StatusCode
1436 }
1437 tracing.EndSpan(ctx, sc, err)
1438 }()
1439 }
1440 for {
1441 next, err := page.fn(ctx, page.lr)
1442 if err != nil {
1443 return err
1444 }
1445 page.lr = next
1446 if !next.hasNextLink() || !next.IsEmpty() {
1447 break
1448 }
1449 }
1450 return nil
1451 }
1452
1453
1454
1455
1456 func (page *ListResultPage) Next() error {
1457 return page.NextWithContext(context.Background())
1458 }
1459
1460
1461 func (page ListResultPage) NotDone() bool {
1462 return !page.lr.IsEmpty()
1463 }
1464
1465
1466 func (page ListResultPage) Response() ListResult {
1467 return page.lr
1468 }
1469
1470
1471 func (page ListResultPage) Values() []Info {
1472 if page.lr.IsEmpty() {
1473 return nil
1474 }
1475 return *page.lr.Value
1476 }
1477
1478
1479 func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage {
1480 return ListResultPage{
1481 fn: getNextPage,
1482 lr: cur,
1483 }
1484 }
1485
1486
1487 type ManagementGroup struct {
1488 autorest.Response `json:"-"`
1489
1490 ID *string `json:"id,omitempty"`
1491
1492 Type *string `json:"type,omitempty"`
1493
1494 Name *string `json:"name,omitempty"`
1495 *Properties `json:"properties,omitempty"`
1496 }
1497
1498
1499 func (mg ManagementGroup) MarshalJSON() ([]byte, error) {
1500 objectMap := make(map[string]interface{})
1501 if mg.Properties != nil {
1502 objectMap["properties"] = mg.Properties
1503 }
1504 return json.Marshal(objectMap)
1505 }
1506
1507
1508 func (mg *ManagementGroup) UnmarshalJSON(body []byte) error {
1509 var m map[string]*json.RawMessage
1510 err := json.Unmarshal(body, &m)
1511 if err != nil {
1512 return err
1513 }
1514 for k, v := range m {
1515 switch k {
1516 case "id":
1517 if v != nil {
1518 var ID string
1519 err = json.Unmarshal(*v, &ID)
1520 if err != nil {
1521 return err
1522 }
1523 mg.ID = &ID
1524 }
1525 case "type":
1526 if v != nil {
1527 var typeVar string
1528 err = json.Unmarshal(*v, &typeVar)
1529 if err != nil {
1530 return err
1531 }
1532 mg.Type = &typeVar
1533 }
1534 case "name":
1535 if v != nil {
1536 var name string
1537 err = json.Unmarshal(*v, &name)
1538 if err != nil {
1539 return err
1540 }
1541 mg.Name = &name
1542 }
1543 case "properties":
1544 if v != nil {
1545 var properties Properties
1546 err = json.Unmarshal(*v, &properties)
1547 if err != nil {
1548 return err
1549 }
1550 mg.Properties = &properties
1551 }
1552 }
1553 }
1554
1555 return nil
1556 }
1557
1558
1559 type Operation struct {
1560
1561 Name *string `json:"name,omitempty"`
1562 Display *OperationDisplayProperties `json:"display,omitempty"`
1563 }
1564
1565
1566 func (o Operation) MarshalJSON() ([]byte, error) {
1567 objectMap := make(map[string]interface{})
1568 if o.Display != nil {
1569 objectMap["display"] = o.Display
1570 }
1571 return json.Marshal(objectMap)
1572 }
1573
1574
1575 type OperationDisplayProperties struct {
1576
1577 Provider *string `json:"provider,omitempty"`
1578
1579 Resource *string `json:"resource,omitempty"`
1580
1581 Operation *string `json:"operation,omitempty"`
1582
1583 Description *string `json:"description,omitempty"`
1584 }
1585
1586
1587 func (odp OperationDisplayProperties) MarshalJSON() ([]byte, error) {
1588 objectMap := make(map[string]interface{})
1589 return json.Marshal(objectMap)
1590 }
1591
1592
1593 type OperationListResult struct {
1594 autorest.Response `json:"-"`
1595
1596 Value *[]Operation `json:"value,omitempty"`
1597
1598 NextLink *string `json:"nextLink,omitempty"`
1599 }
1600
1601
1602 func (olr OperationListResult) MarshalJSON() ([]byte, error) {
1603 objectMap := make(map[string]interface{})
1604 return json.Marshal(objectMap)
1605 }
1606
1607
1608 type OperationListResultIterator struct {
1609 i int
1610 page OperationListResultPage
1611 }
1612
1613
1614
1615 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1616 if tracing.IsEnabled() {
1617 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
1618 defer func() {
1619 sc := -1
1620 if iter.Response().Response.Response != nil {
1621 sc = iter.Response().Response.Response.StatusCode
1622 }
1623 tracing.EndSpan(ctx, sc, err)
1624 }()
1625 }
1626 iter.i++
1627 if iter.i < len(iter.page.Values()) {
1628 return nil
1629 }
1630 err = iter.page.NextWithContext(ctx)
1631 if err != nil {
1632 iter.i--
1633 return err
1634 }
1635 iter.i = 0
1636 return nil
1637 }
1638
1639
1640
1641
1642 func (iter *OperationListResultIterator) Next() error {
1643 return iter.NextWithContext(context.Background())
1644 }
1645
1646
1647 func (iter OperationListResultIterator) NotDone() bool {
1648 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1649 }
1650
1651
1652 func (iter OperationListResultIterator) Response() OperationListResult {
1653 return iter.page.Response()
1654 }
1655
1656
1657
1658 func (iter OperationListResultIterator) Value() Operation {
1659 if !iter.page.NotDone() {
1660 return Operation{}
1661 }
1662 return iter.page.Values()[iter.i]
1663 }
1664
1665
1666 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
1667 return OperationListResultIterator{page: page}
1668 }
1669
1670
1671 func (olr OperationListResult) IsEmpty() bool {
1672 return olr.Value == nil || len(*olr.Value) == 0
1673 }
1674
1675
1676 func (olr OperationListResult) hasNextLink() bool {
1677 return olr.NextLink != nil && len(*olr.NextLink) != 0
1678 }
1679
1680
1681
1682 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
1683 if !olr.hasNextLink() {
1684 return nil, nil
1685 }
1686 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1687 autorest.AsJSON(),
1688 autorest.AsGet(),
1689 autorest.WithBaseURL(to.String(olr.NextLink)))
1690 }
1691
1692
1693 type OperationListResultPage struct {
1694 fn func(context.Context, OperationListResult) (OperationListResult, error)
1695 olr OperationListResult
1696 }
1697
1698
1699
1700 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1701 if tracing.IsEnabled() {
1702 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
1703 defer func() {
1704 sc := -1
1705 if page.Response().Response.Response != nil {
1706 sc = page.Response().Response.Response.StatusCode
1707 }
1708 tracing.EndSpan(ctx, sc, err)
1709 }()
1710 }
1711 for {
1712 next, err := page.fn(ctx, page.olr)
1713 if err != nil {
1714 return err
1715 }
1716 page.olr = next
1717 if !next.hasNextLink() || !next.IsEmpty() {
1718 break
1719 }
1720 }
1721 return nil
1722 }
1723
1724
1725
1726
1727 func (page *OperationListResultPage) Next() error {
1728 return page.NextWithContext(context.Background())
1729 }
1730
1731
1732 func (page OperationListResultPage) NotDone() bool {
1733 return !page.olr.IsEmpty()
1734 }
1735
1736
1737 func (page OperationListResultPage) Response() OperationListResult {
1738 return page.olr
1739 }
1740
1741
1742 func (page OperationListResultPage) Values() []Operation {
1743 if page.olr.IsEmpty() {
1744 return nil
1745 }
1746 return *page.olr.Value
1747 }
1748
1749
1750 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
1751 return OperationListResultPage{
1752 fn: getNextPage,
1753 olr: cur,
1754 }
1755 }
1756
1757
1758 type OperationResults struct {
1759
1760 ID *string `json:"id,omitempty"`
1761
1762 Type *string `json:"type,omitempty"`
1763
1764 Name *string `json:"name,omitempty"`
1765 *InfoProperties `json:"properties,omitempty"`
1766 }
1767
1768
1769 func (or OperationResults) MarshalJSON() ([]byte, error) {
1770 objectMap := make(map[string]interface{})
1771 if or.InfoProperties != nil {
1772 objectMap["properties"] = or.InfoProperties
1773 }
1774 return json.Marshal(objectMap)
1775 }
1776
1777
1778 func (or *OperationResults) UnmarshalJSON(body []byte) error {
1779 var m map[string]*json.RawMessage
1780 err := json.Unmarshal(body, &m)
1781 if err != nil {
1782 return err
1783 }
1784 for k, v := range m {
1785 switch k {
1786 case "id":
1787 if v != nil {
1788 var ID string
1789 err = json.Unmarshal(*v, &ID)
1790 if err != nil {
1791 return err
1792 }
1793 or.ID = &ID
1794 }
1795 case "type":
1796 if v != nil {
1797 var typeVar string
1798 err = json.Unmarshal(*v, &typeVar)
1799 if err != nil {
1800 return err
1801 }
1802 or.Type = &typeVar
1803 }
1804 case "name":
1805 if v != nil {
1806 var name string
1807 err = json.Unmarshal(*v, &name)
1808 if err != nil {
1809 return err
1810 }
1811 or.Name = &name
1812 }
1813 case "properties":
1814 if v != nil {
1815 var infoProperties InfoProperties
1816 err = json.Unmarshal(*v, &infoProperties)
1817 if err != nil {
1818 return err
1819 }
1820 or.InfoProperties = &infoProperties
1821 }
1822 }
1823 }
1824
1825 return nil
1826 }
1827
1828
1829 type ParentGroupInfo struct {
1830
1831 ID *string `json:"id,omitempty"`
1832
1833 Name *string `json:"name,omitempty"`
1834
1835 DisplayName *string `json:"displayName,omitempty"`
1836 }
1837
1838
1839 type PatchManagementGroupRequest struct {
1840
1841 DisplayName *string `json:"displayName,omitempty"`
1842
1843 ParentID *string `json:"parentId,omitempty"`
1844 }
1845
1846
1847 type PathElement struct {
1848
1849 Name *string `json:"name,omitempty"`
1850
1851 DisplayName *string `json:"displayName,omitempty"`
1852 }
1853
1854
1855 type Properties struct {
1856
1857 TenantID *string `json:"tenantId,omitempty"`
1858
1859 DisplayName *string `json:"displayName,omitempty"`
1860
1861 Roles *[]string `json:"roles,omitempty"`
1862 Details *Details `json:"details,omitempty"`
1863
1864 Children *[]ChildInfo `json:"children,omitempty"`
1865
1866 Path *[]PathElement `json:"path,omitempty"`
1867 }
1868
1869
1870 type SetObject struct {
1871 autorest.Response `json:"-"`
1872 Value interface{} `json:"value,omitempty"`
1873 }
1874
1875
1876 type TenantBackfillStatusResult struct {
1877 autorest.Response `json:"-"`
1878
1879 TenantID *string `json:"tenantId,omitempty"`
1880
1881 Status Status `json:"status,omitempty"`
1882 }
1883
1884
1885 func (tbsr TenantBackfillStatusResult) MarshalJSON() ([]byte, error) {
1886 objectMap := make(map[string]interface{})
1887 return json.Marshal(objectMap)
1888 }
1889
View as plain text