1 package aad
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/domainservices/mgmt/2020-01-01/aad"
22
23
24 type CloudError struct {
25
26 Error *CloudErrorBody `json:"error,omitempty"`
27 }
28
29
30 type CloudErrorBody struct {
31
32 Code *string `json:"code,omitempty"`
33
34 Message *string `json:"message,omitempty"`
35
36 Target *string `json:"target,omitempty"`
37
38 Details *[]CloudErrorBody `json:"details,omitempty"`
39 }
40
41
42 type ContainerAccount struct {
43
44 AccountName *string `json:"accountName,omitempty"`
45
46 Spn *string `json:"spn,omitempty"`
47
48 Password *string `json:"password,omitempty"`
49 }
50
51
52 type DomainSecuritySettings struct {
53
54 NtlmV1 NtlmV1 `json:"ntlmV1,omitempty"`
55
56 TLSV1 TLSV1 `json:"tlsV1,omitempty"`
57
58 SyncNtlmPasswords SyncNtlmPasswords `json:"syncNtlmPasswords,omitempty"`
59
60 SyncKerberosPasswords SyncKerberosPasswords `json:"syncKerberosPasswords,omitempty"`
61
62 SyncOnPremPasswords SyncOnPremPasswords `json:"syncOnPremPasswords,omitempty"`
63 }
64
65
66 type DomainService struct {
67 autorest.Response `json:"-"`
68
69 *DomainServiceProperties `json:"properties,omitempty"`
70
71 ID *string `json:"id,omitempty"`
72
73 Name *string `json:"name,omitempty"`
74
75 Type *string `json:"type,omitempty"`
76
77 Location *string `json:"location,omitempty"`
78
79 Tags map[string]*string `json:"tags"`
80
81 Etag *string `json:"etag,omitempty"`
82 }
83
84
85 func (ds DomainService) MarshalJSON() ([]byte, error) {
86 objectMap := make(map[string]interface{})
87 if ds.DomainServiceProperties != nil {
88 objectMap["properties"] = ds.DomainServiceProperties
89 }
90 if ds.Location != nil {
91 objectMap["location"] = ds.Location
92 }
93 if ds.Tags != nil {
94 objectMap["tags"] = ds.Tags
95 }
96 if ds.Etag != nil {
97 objectMap["etag"] = ds.Etag
98 }
99 return json.Marshal(objectMap)
100 }
101
102
103 func (ds *DomainService) UnmarshalJSON(body []byte) error {
104 var m map[string]*json.RawMessage
105 err := json.Unmarshal(body, &m)
106 if err != nil {
107 return err
108 }
109 for k, v := range m {
110 switch k {
111 case "properties":
112 if v != nil {
113 var domainServiceProperties DomainServiceProperties
114 err = json.Unmarshal(*v, &domainServiceProperties)
115 if err != nil {
116 return err
117 }
118 ds.DomainServiceProperties = &domainServiceProperties
119 }
120 case "id":
121 if v != nil {
122 var ID string
123 err = json.Unmarshal(*v, &ID)
124 if err != nil {
125 return err
126 }
127 ds.ID = &ID
128 }
129 case "name":
130 if v != nil {
131 var name string
132 err = json.Unmarshal(*v, &name)
133 if err != nil {
134 return err
135 }
136 ds.Name = &name
137 }
138 case "type":
139 if v != nil {
140 var typeVar string
141 err = json.Unmarshal(*v, &typeVar)
142 if err != nil {
143 return err
144 }
145 ds.Type = &typeVar
146 }
147 case "location":
148 if v != nil {
149 var location string
150 err = json.Unmarshal(*v, &location)
151 if err != nil {
152 return err
153 }
154 ds.Location = &location
155 }
156 case "tags":
157 if v != nil {
158 var tags map[string]*string
159 err = json.Unmarshal(*v, &tags)
160 if err != nil {
161 return err
162 }
163 ds.Tags = tags
164 }
165 case "etag":
166 if v != nil {
167 var etag string
168 err = json.Unmarshal(*v, &etag)
169 if err != nil {
170 return err
171 }
172 ds.Etag = &etag
173 }
174 }
175 }
176
177 return nil
178 }
179
180
181 type DomainServiceListResult struct {
182 autorest.Response `json:"-"`
183
184 Value *[]DomainService `json:"value,omitempty"`
185
186 NextLink *string `json:"nextLink,omitempty"`
187 }
188
189
190 func (dslr DomainServiceListResult) MarshalJSON() ([]byte, error) {
191 objectMap := make(map[string]interface{})
192 if dslr.Value != nil {
193 objectMap["value"] = dslr.Value
194 }
195 return json.Marshal(objectMap)
196 }
197
198
199 type DomainServiceListResultIterator struct {
200 i int
201 page DomainServiceListResultPage
202 }
203
204
205
206 func (iter *DomainServiceListResultIterator) NextWithContext(ctx context.Context) (err error) {
207 if tracing.IsEnabled() {
208 ctx = tracing.StartSpan(ctx, fqdn+"/DomainServiceListResultIterator.NextWithContext")
209 defer func() {
210 sc := -1
211 if iter.Response().Response.Response != nil {
212 sc = iter.Response().Response.Response.StatusCode
213 }
214 tracing.EndSpan(ctx, sc, err)
215 }()
216 }
217 iter.i++
218 if iter.i < len(iter.page.Values()) {
219 return nil
220 }
221 err = iter.page.NextWithContext(ctx)
222 if err != nil {
223 iter.i--
224 return err
225 }
226 iter.i = 0
227 return nil
228 }
229
230
231
232
233 func (iter *DomainServiceListResultIterator) Next() error {
234 return iter.NextWithContext(context.Background())
235 }
236
237
238 func (iter DomainServiceListResultIterator) NotDone() bool {
239 return iter.page.NotDone() && iter.i < len(iter.page.Values())
240 }
241
242
243 func (iter DomainServiceListResultIterator) Response() DomainServiceListResult {
244 return iter.page.Response()
245 }
246
247
248
249 func (iter DomainServiceListResultIterator) Value() DomainService {
250 if !iter.page.NotDone() {
251 return DomainService{}
252 }
253 return iter.page.Values()[iter.i]
254 }
255
256
257 func NewDomainServiceListResultIterator(page DomainServiceListResultPage) DomainServiceListResultIterator {
258 return DomainServiceListResultIterator{page: page}
259 }
260
261
262 func (dslr DomainServiceListResult) IsEmpty() bool {
263 return dslr.Value == nil || len(*dslr.Value) == 0
264 }
265
266
267 func (dslr DomainServiceListResult) hasNextLink() bool {
268 return dslr.NextLink != nil && len(*dslr.NextLink) != 0
269 }
270
271
272
273 func (dslr DomainServiceListResult) domainServiceListResultPreparer(ctx context.Context) (*http.Request, error) {
274 if !dslr.hasNextLink() {
275 return nil, nil
276 }
277 return autorest.Prepare((&http.Request{}).WithContext(ctx),
278 autorest.AsJSON(),
279 autorest.AsGet(),
280 autorest.WithBaseURL(to.String(dslr.NextLink)))
281 }
282
283
284 type DomainServiceListResultPage struct {
285 fn func(context.Context, DomainServiceListResult) (DomainServiceListResult, error)
286 dslr DomainServiceListResult
287 }
288
289
290
291 func (page *DomainServiceListResultPage) NextWithContext(ctx context.Context) (err error) {
292 if tracing.IsEnabled() {
293 ctx = tracing.StartSpan(ctx, fqdn+"/DomainServiceListResultPage.NextWithContext")
294 defer func() {
295 sc := -1
296 if page.Response().Response.Response != nil {
297 sc = page.Response().Response.Response.StatusCode
298 }
299 tracing.EndSpan(ctx, sc, err)
300 }()
301 }
302 for {
303 next, err := page.fn(ctx, page.dslr)
304 if err != nil {
305 return err
306 }
307 page.dslr = next
308 if !next.hasNextLink() || !next.IsEmpty() {
309 break
310 }
311 }
312 return nil
313 }
314
315
316
317
318 func (page *DomainServiceListResultPage) Next() error {
319 return page.NextWithContext(context.Background())
320 }
321
322
323 func (page DomainServiceListResultPage) NotDone() bool {
324 return !page.dslr.IsEmpty()
325 }
326
327
328 func (page DomainServiceListResultPage) Response() DomainServiceListResult {
329 return page.dslr
330 }
331
332
333 func (page DomainServiceListResultPage) Values() []DomainService {
334 if page.dslr.IsEmpty() {
335 return nil
336 }
337 return *page.dslr.Value
338 }
339
340
341 func NewDomainServiceListResultPage(cur DomainServiceListResult, getNextPage func(context.Context, DomainServiceListResult) (DomainServiceListResult, error)) DomainServiceListResultPage {
342 return DomainServiceListResultPage{
343 fn: getNextPage,
344 dslr: cur,
345 }
346 }
347
348
349 type DomainServiceProperties struct {
350
351 Version *int32 `json:"version,omitempty"`
352
353 TenantID *string `json:"tenantId,omitempty"`
354
355 DomainName *string `json:"domainName,omitempty"`
356
357 DeploymentID *string `json:"deploymentId,omitempty"`
358
359 SyncOwner *string `json:"syncOwner,omitempty"`
360
361 ReplicaSets *[]ReplicaSet `json:"replicaSets,omitempty"`
362
363 LdapsSettings *LdapsSettings `json:"ldapsSettings,omitempty"`
364
365 ResourceForestSettings *ResourceForestSettings `json:"resourceForestSettings,omitempty"`
366
367 DomainSecuritySettings *DomainSecuritySettings `json:"domainSecuritySettings,omitempty"`
368
369 DomainConfigurationType *string `json:"domainConfigurationType,omitempty"`
370
371 Sku *string `json:"sku,omitempty"`
372
373 FilteredSync FilteredSync `json:"filteredSync,omitempty"`
374
375 NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"`
376
377 ProvisioningState *string `json:"provisioningState,omitempty"`
378 }
379
380
381 func (dsp DomainServiceProperties) MarshalJSON() ([]byte, error) {
382 objectMap := make(map[string]interface{})
383 if dsp.DomainName != nil {
384 objectMap["domainName"] = dsp.DomainName
385 }
386 if dsp.ReplicaSets != nil {
387 objectMap["replicaSets"] = dsp.ReplicaSets
388 }
389 if dsp.LdapsSettings != nil {
390 objectMap["ldapsSettings"] = dsp.LdapsSettings
391 }
392 if dsp.ResourceForestSettings != nil {
393 objectMap["resourceForestSettings"] = dsp.ResourceForestSettings
394 }
395 if dsp.DomainSecuritySettings != nil {
396 objectMap["domainSecuritySettings"] = dsp.DomainSecuritySettings
397 }
398 if dsp.DomainConfigurationType != nil {
399 objectMap["domainConfigurationType"] = dsp.DomainConfigurationType
400 }
401 if dsp.Sku != nil {
402 objectMap["sku"] = dsp.Sku
403 }
404 if dsp.FilteredSync != "" {
405 objectMap["filteredSync"] = dsp.FilteredSync
406 }
407 if dsp.NotificationSettings != nil {
408 objectMap["notificationSettings"] = dsp.NotificationSettings
409 }
410 return json.Marshal(objectMap)
411 }
412
413
414
415 type DomainServicesCreateOrUpdateFuture struct {
416 azure.FutureAPI
417
418
419 Result func(DomainServicesClient) (DomainService, error)
420 }
421
422
423 func (future *DomainServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
424 var azFuture azure.Future
425 if err := json.Unmarshal(body, &azFuture); err != nil {
426 return err
427 }
428 future.FutureAPI = &azFuture
429 future.Result = future.result
430 return nil
431 }
432
433
434 func (future *DomainServicesCreateOrUpdateFuture) result(client DomainServicesClient) (ds DomainService, err error) {
435 var done bool
436 done, err = future.DoneWithContext(context.Background(), client)
437 if err != nil {
438 err = autorest.NewErrorWithError(err, "aad.DomainServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
439 return
440 }
441 if !done {
442 ds.Response.Response = future.Response()
443 err = azure.NewAsyncOpIncompleteError("aad.DomainServicesCreateOrUpdateFuture")
444 return
445 }
446 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
447 if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent {
448 ds, err = client.CreateOrUpdateResponder(ds.Response.Response)
449 if err != nil {
450 err = autorest.NewErrorWithError(err, "aad.DomainServicesCreateOrUpdateFuture", "Result", ds.Response.Response, "Failure responding to request")
451 }
452 }
453 return
454 }
455
456
457
458 type DomainServicesDeleteFuture struct {
459 azure.FutureAPI
460
461
462 Result func(DomainServicesClient) (autorest.Response, error)
463 }
464
465
466 func (future *DomainServicesDeleteFuture) UnmarshalJSON(body []byte) error {
467 var azFuture azure.Future
468 if err := json.Unmarshal(body, &azFuture); err != nil {
469 return err
470 }
471 future.FutureAPI = &azFuture
472 future.Result = future.result
473 return nil
474 }
475
476
477 func (future *DomainServicesDeleteFuture) result(client DomainServicesClient) (ar autorest.Response, err error) {
478 var done bool
479 done, err = future.DoneWithContext(context.Background(), client)
480 if err != nil {
481 err = autorest.NewErrorWithError(err, "aad.DomainServicesDeleteFuture", "Result", future.Response(), "Polling failure")
482 return
483 }
484 if !done {
485 ar.Response = future.Response()
486 err = azure.NewAsyncOpIncompleteError("aad.DomainServicesDeleteFuture")
487 return
488 }
489 ar.Response = future.Response()
490 return
491 }
492
493
494
495 type DomainServicesUpdateFuture struct {
496 azure.FutureAPI
497
498
499 Result func(DomainServicesClient) (DomainService, error)
500 }
501
502
503 func (future *DomainServicesUpdateFuture) UnmarshalJSON(body []byte) error {
504 var azFuture azure.Future
505 if err := json.Unmarshal(body, &azFuture); err != nil {
506 return err
507 }
508 future.FutureAPI = &azFuture
509 future.Result = future.result
510 return nil
511 }
512
513
514 func (future *DomainServicesUpdateFuture) result(client DomainServicesClient) (ds DomainService, err error) {
515 var done bool
516 done, err = future.DoneWithContext(context.Background(), client)
517 if err != nil {
518 err = autorest.NewErrorWithError(err, "aad.DomainServicesUpdateFuture", "Result", future.Response(), "Polling failure")
519 return
520 }
521 if !done {
522 ds.Response.Response = future.Response()
523 err = azure.NewAsyncOpIncompleteError("aad.DomainServicesUpdateFuture")
524 return
525 }
526 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
527 if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent {
528 ds, err = client.UpdateResponder(ds.Response.Response)
529 if err != nil {
530 err = autorest.NewErrorWithError(err, "aad.DomainServicesUpdateFuture", "Result", ds.Response.Response, "Failure responding to request")
531 }
532 }
533 return
534 }
535
536
537 type ForestTrust struct {
538
539 TrustedDomainFqdn *string `json:"trustedDomainFqdn,omitempty"`
540
541 TrustDirection *string `json:"trustDirection,omitempty"`
542
543 FriendlyName *string `json:"friendlyName,omitempty"`
544
545 RemoteDNSIps *string `json:"remoteDnsIps,omitempty"`
546
547 TrustPassword *string `json:"trustPassword,omitempty"`
548 }
549
550
551 type HealthAlert struct {
552
553 ID *string `json:"id,omitempty"`
554
555 Name *string `json:"name,omitempty"`
556
557 Issue *string `json:"issue,omitempty"`
558
559 Severity *string `json:"severity,omitempty"`
560
561 Raised *date.Time `json:"raised,omitempty"`
562
563 LastDetected *date.Time `json:"lastDetected,omitempty"`
564
565 ResolutionURI *string `json:"resolutionUri,omitempty"`
566 }
567
568
569 func (ha HealthAlert) MarshalJSON() ([]byte, error) {
570 objectMap := make(map[string]interface{})
571 return json.Marshal(objectMap)
572 }
573
574
575 type HealthMonitor struct {
576
577 ID *string `json:"id,omitempty"`
578
579 Name *string `json:"name,omitempty"`
580
581 Details *string `json:"details,omitempty"`
582 }
583
584
585 func (hm HealthMonitor) MarshalJSON() ([]byte, error) {
586 objectMap := make(map[string]interface{})
587 return json.Marshal(objectMap)
588 }
589
590
591 type LdapsSettings struct {
592
593 Ldaps Ldaps `json:"ldaps,omitempty"`
594
595 PfxCertificate *string `json:"pfxCertificate,omitempty"`
596
597 PfxCertificatePassword *string `json:"pfxCertificatePassword,omitempty"`
598
599 PublicCertificate *string `json:"publicCertificate,omitempty"`
600
601 CertificateThumbprint *string `json:"certificateThumbprint,omitempty"`
602
603 CertificateNotAfter *date.Time `json:"certificateNotAfter,omitempty"`
604
605 ExternalAccess ExternalAccess `json:"externalAccess,omitempty"`
606 }
607
608
609 func (ls LdapsSettings) MarshalJSON() ([]byte, error) {
610 objectMap := make(map[string]interface{})
611 if ls.Ldaps != "" {
612 objectMap["ldaps"] = ls.Ldaps
613 }
614 if ls.PfxCertificate != nil {
615 objectMap["pfxCertificate"] = ls.PfxCertificate
616 }
617 if ls.PfxCertificatePassword != nil {
618 objectMap["pfxCertificatePassword"] = ls.PfxCertificatePassword
619 }
620 if ls.ExternalAccess != "" {
621 objectMap["externalAccess"] = ls.ExternalAccess
622 }
623 return json.Marshal(objectMap)
624 }
625
626
627 type NotificationSettings struct {
628
629 NotifyGlobalAdmins NotifyGlobalAdmins `json:"notifyGlobalAdmins,omitempty"`
630
631 NotifyDcAdmins NotifyDcAdmins `json:"notifyDcAdmins,omitempty"`
632
633 AdditionalRecipients *[]string `json:"additionalRecipients,omitempty"`
634 }
635
636
637 type OperationDisplayInfo struct {
638
639 Description *string `json:"description,omitempty"`
640
641 Operation *string `json:"operation,omitempty"`
642
643 Provider *string `json:"provider,omitempty"`
644
645 Resource *string `json:"resource,omitempty"`
646 }
647
648
649 type OperationEntity struct {
650
651 Name *string `json:"name,omitempty"`
652
653 Display *OperationDisplayInfo `json:"display,omitempty"`
654
655 Origin *string `json:"origin,omitempty"`
656 }
657
658
659 type OperationEntityListResult struct {
660 autorest.Response `json:"-"`
661
662 Value *[]OperationEntity `json:"value,omitempty"`
663
664 NextLink *string `json:"nextLink,omitempty"`
665 }
666
667
668 func (oelr OperationEntityListResult) MarshalJSON() ([]byte, error) {
669 objectMap := make(map[string]interface{})
670 if oelr.Value != nil {
671 objectMap["value"] = oelr.Value
672 }
673 return json.Marshal(objectMap)
674 }
675
676
677 type OperationEntityListResultIterator struct {
678 i int
679 page OperationEntityListResultPage
680 }
681
682
683
684 func (iter *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) {
685 if tracing.IsEnabled() {
686 ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.NextWithContext")
687 defer func() {
688 sc := -1
689 if iter.Response().Response.Response != nil {
690 sc = iter.Response().Response.Response.StatusCode
691 }
692 tracing.EndSpan(ctx, sc, err)
693 }()
694 }
695 iter.i++
696 if iter.i < len(iter.page.Values()) {
697 return nil
698 }
699 err = iter.page.NextWithContext(ctx)
700 if err != nil {
701 iter.i--
702 return err
703 }
704 iter.i = 0
705 return nil
706 }
707
708
709
710
711 func (iter *OperationEntityListResultIterator) Next() error {
712 return iter.NextWithContext(context.Background())
713 }
714
715
716 func (iter OperationEntityListResultIterator) NotDone() bool {
717 return iter.page.NotDone() && iter.i < len(iter.page.Values())
718 }
719
720
721 func (iter OperationEntityListResultIterator) Response() OperationEntityListResult {
722 return iter.page.Response()
723 }
724
725
726
727 func (iter OperationEntityListResultIterator) Value() OperationEntity {
728 if !iter.page.NotDone() {
729 return OperationEntity{}
730 }
731 return iter.page.Values()[iter.i]
732 }
733
734
735 func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator {
736 return OperationEntityListResultIterator{page: page}
737 }
738
739
740 func (oelr OperationEntityListResult) IsEmpty() bool {
741 return oelr.Value == nil || len(*oelr.Value) == 0
742 }
743
744
745 func (oelr OperationEntityListResult) hasNextLink() bool {
746 return oelr.NextLink != nil && len(*oelr.NextLink) != 0
747 }
748
749
750
751 func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) {
752 if !oelr.hasNextLink() {
753 return nil, nil
754 }
755 return autorest.Prepare((&http.Request{}).WithContext(ctx),
756 autorest.AsJSON(),
757 autorest.AsGet(),
758 autorest.WithBaseURL(to.String(oelr.NextLink)))
759 }
760
761
762 type OperationEntityListResultPage struct {
763 fn func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)
764 oelr OperationEntityListResult
765 }
766
767
768
769 func (page *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) {
770 if tracing.IsEnabled() {
771 ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.NextWithContext")
772 defer func() {
773 sc := -1
774 if page.Response().Response.Response != nil {
775 sc = page.Response().Response.Response.StatusCode
776 }
777 tracing.EndSpan(ctx, sc, err)
778 }()
779 }
780 for {
781 next, err := page.fn(ctx, page.oelr)
782 if err != nil {
783 return err
784 }
785 page.oelr = next
786 if !next.hasNextLink() || !next.IsEmpty() {
787 break
788 }
789 }
790 return nil
791 }
792
793
794
795
796 func (page *OperationEntityListResultPage) Next() error {
797 return page.NextWithContext(context.Background())
798 }
799
800
801 func (page OperationEntityListResultPage) NotDone() bool {
802 return !page.oelr.IsEmpty()
803 }
804
805
806 func (page OperationEntityListResultPage) Response() OperationEntityListResult {
807 return page.oelr
808 }
809
810
811 func (page OperationEntityListResultPage) Values() []OperationEntity {
812 if page.oelr.IsEmpty() {
813 return nil
814 }
815 return *page.oelr.Value
816 }
817
818
819 func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage {
820 return OperationEntityListResultPage{
821 fn: getNextPage,
822 oelr: cur,
823 }
824 }
825
826
827 type OuContainer struct {
828 autorest.Response `json:"-"`
829
830 *OuContainerProperties `json:"properties,omitempty"`
831
832 ID *string `json:"id,omitempty"`
833
834 Name *string `json:"name,omitempty"`
835
836 Type *string `json:"type,omitempty"`
837
838 Location *string `json:"location,omitempty"`
839
840 Tags map[string]*string `json:"tags"`
841
842 Etag *string `json:"etag,omitempty"`
843 }
844
845
846 func (oc OuContainer) MarshalJSON() ([]byte, error) {
847 objectMap := make(map[string]interface{})
848 if oc.OuContainerProperties != nil {
849 objectMap["properties"] = oc.OuContainerProperties
850 }
851 if oc.Location != nil {
852 objectMap["location"] = oc.Location
853 }
854 if oc.Tags != nil {
855 objectMap["tags"] = oc.Tags
856 }
857 if oc.Etag != nil {
858 objectMap["etag"] = oc.Etag
859 }
860 return json.Marshal(objectMap)
861 }
862
863
864 func (oc *OuContainer) UnmarshalJSON(body []byte) error {
865 var m map[string]*json.RawMessage
866 err := json.Unmarshal(body, &m)
867 if err != nil {
868 return err
869 }
870 for k, v := range m {
871 switch k {
872 case "properties":
873 if v != nil {
874 var ouContainerProperties OuContainerProperties
875 err = json.Unmarshal(*v, &ouContainerProperties)
876 if err != nil {
877 return err
878 }
879 oc.OuContainerProperties = &ouContainerProperties
880 }
881 case "id":
882 if v != nil {
883 var ID string
884 err = json.Unmarshal(*v, &ID)
885 if err != nil {
886 return err
887 }
888 oc.ID = &ID
889 }
890 case "name":
891 if v != nil {
892 var name string
893 err = json.Unmarshal(*v, &name)
894 if err != nil {
895 return err
896 }
897 oc.Name = &name
898 }
899 case "type":
900 if v != nil {
901 var typeVar string
902 err = json.Unmarshal(*v, &typeVar)
903 if err != nil {
904 return err
905 }
906 oc.Type = &typeVar
907 }
908 case "location":
909 if v != nil {
910 var location string
911 err = json.Unmarshal(*v, &location)
912 if err != nil {
913 return err
914 }
915 oc.Location = &location
916 }
917 case "tags":
918 if v != nil {
919 var tags map[string]*string
920 err = json.Unmarshal(*v, &tags)
921 if err != nil {
922 return err
923 }
924 oc.Tags = tags
925 }
926 case "etag":
927 if v != nil {
928 var etag string
929 err = json.Unmarshal(*v, &etag)
930 if err != nil {
931 return err
932 }
933 oc.Etag = &etag
934 }
935 }
936 }
937
938 return nil
939 }
940
941
942
943 type OuContainerCreateFuture struct {
944 azure.FutureAPI
945
946
947 Result func(OuContainerClient) (OuContainer, error)
948 }
949
950
951 func (future *OuContainerCreateFuture) UnmarshalJSON(body []byte) error {
952 var azFuture azure.Future
953 if err := json.Unmarshal(body, &azFuture); err != nil {
954 return err
955 }
956 future.FutureAPI = &azFuture
957 future.Result = future.result
958 return nil
959 }
960
961
962 func (future *OuContainerCreateFuture) result(client OuContainerClient) (oc OuContainer, err error) {
963 var done bool
964 done, err = future.DoneWithContext(context.Background(), client)
965 if err != nil {
966 err = autorest.NewErrorWithError(err, "aad.OuContainerCreateFuture", "Result", future.Response(), "Polling failure")
967 return
968 }
969 if !done {
970 oc.Response.Response = future.Response()
971 err = azure.NewAsyncOpIncompleteError("aad.OuContainerCreateFuture")
972 return
973 }
974 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
975 if oc.Response.Response, err = future.GetResult(sender); err == nil && oc.Response.Response.StatusCode != http.StatusNoContent {
976 oc, err = client.CreateResponder(oc.Response.Response)
977 if err != nil {
978 err = autorest.NewErrorWithError(err, "aad.OuContainerCreateFuture", "Result", oc.Response.Response, "Failure responding to request")
979 }
980 }
981 return
982 }
983
984
985
986 type OuContainerDeleteFuture struct {
987 azure.FutureAPI
988
989
990 Result func(OuContainerClient) (autorest.Response, error)
991 }
992
993
994 func (future *OuContainerDeleteFuture) UnmarshalJSON(body []byte) error {
995 var azFuture azure.Future
996 if err := json.Unmarshal(body, &azFuture); err != nil {
997 return err
998 }
999 future.FutureAPI = &azFuture
1000 future.Result = future.result
1001 return nil
1002 }
1003
1004
1005 func (future *OuContainerDeleteFuture) result(client OuContainerClient) (ar autorest.Response, err error) {
1006 var done bool
1007 done, err = future.DoneWithContext(context.Background(), client)
1008 if err != nil {
1009 err = autorest.NewErrorWithError(err, "aad.OuContainerDeleteFuture", "Result", future.Response(), "Polling failure")
1010 return
1011 }
1012 if !done {
1013 ar.Response = future.Response()
1014 err = azure.NewAsyncOpIncompleteError("aad.OuContainerDeleteFuture")
1015 return
1016 }
1017 ar.Response = future.Response()
1018 return
1019 }
1020
1021
1022 type OuContainerListResult struct {
1023 autorest.Response `json:"-"`
1024
1025 Value *[]OuContainer `json:"value,omitempty"`
1026
1027 NextLink *string `json:"nextLink,omitempty"`
1028 }
1029
1030
1031 func (oclr OuContainerListResult) MarshalJSON() ([]byte, error) {
1032 objectMap := make(map[string]interface{})
1033 if oclr.Value != nil {
1034 objectMap["value"] = oclr.Value
1035 }
1036 return json.Marshal(objectMap)
1037 }
1038
1039
1040 type OuContainerListResultIterator struct {
1041 i int
1042 page OuContainerListResultPage
1043 }
1044
1045
1046
1047 func (iter *OuContainerListResultIterator) NextWithContext(ctx context.Context) (err error) {
1048 if tracing.IsEnabled() {
1049 ctx = tracing.StartSpan(ctx, fqdn+"/OuContainerListResultIterator.NextWithContext")
1050 defer func() {
1051 sc := -1
1052 if iter.Response().Response.Response != nil {
1053 sc = iter.Response().Response.Response.StatusCode
1054 }
1055 tracing.EndSpan(ctx, sc, err)
1056 }()
1057 }
1058 iter.i++
1059 if iter.i < len(iter.page.Values()) {
1060 return nil
1061 }
1062 err = iter.page.NextWithContext(ctx)
1063 if err != nil {
1064 iter.i--
1065 return err
1066 }
1067 iter.i = 0
1068 return nil
1069 }
1070
1071
1072
1073
1074 func (iter *OuContainerListResultIterator) Next() error {
1075 return iter.NextWithContext(context.Background())
1076 }
1077
1078
1079 func (iter OuContainerListResultIterator) NotDone() bool {
1080 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1081 }
1082
1083
1084 func (iter OuContainerListResultIterator) Response() OuContainerListResult {
1085 return iter.page.Response()
1086 }
1087
1088
1089
1090 func (iter OuContainerListResultIterator) Value() OuContainer {
1091 if !iter.page.NotDone() {
1092 return OuContainer{}
1093 }
1094 return iter.page.Values()[iter.i]
1095 }
1096
1097
1098 func NewOuContainerListResultIterator(page OuContainerListResultPage) OuContainerListResultIterator {
1099 return OuContainerListResultIterator{page: page}
1100 }
1101
1102
1103 func (oclr OuContainerListResult) IsEmpty() bool {
1104 return oclr.Value == nil || len(*oclr.Value) == 0
1105 }
1106
1107
1108 func (oclr OuContainerListResult) hasNextLink() bool {
1109 return oclr.NextLink != nil && len(*oclr.NextLink) != 0
1110 }
1111
1112
1113
1114 func (oclr OuContainerListResult) ouContainerListResultPreparer(ctx context.Context) (*http.Request, error) {
1115 if !oclr.hasNextLink() {
1116 return nil, nil
1117 }
1118 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1119 autorest.AsJSON(),
1120 autorest.AsGet(),
1121 autorest.WithBaseURL(to.String(oclr.NextLink)))
1122 }
1123
1124
1125 type OuContainerListResultPage struct {
1126 fn func(context.Context, OuContainerListResult) (OuContainerListResult, error)
1127 oclr OuContainerListResult
1128 }
1129
1130
1131
1132 func (page *OuContainerListResultPage) NextWithContext(ctx context.Context) (err error) {
1133 if tracing.IsEnabled() {
1134 ctx = tracing.StartSpan(ctx, fqdn+"/OuContainerListResultPage.NextWithContext")
1135 defer func() {
1136 sc := -1
1137 if page.Response().Response.Response != nil {
1138 sc = page.Response().Response.Response.StatusCode
1139 }
1140 tracing.EndSpan(ctx, sc, err)
1141 }()
1142 }
1143 for {
1144 next, err := page.fn(ctx, page.oclr)
1145 if err != nil {
1146 return err
1147 }
1148 page.oclr = next
1149 if !next.hasNextLink() || !next.IsEmpty() {
1150 break
1151 }
1152 }
1153 return nil
1154 }
1155
1156
1157
1158
1159 func (page *OuContainerListResultPage) Next() error {
1160 return page.NextWithContext(context.Background())
1161 }
1162
1163
1164 func (page OuContainerListResultPage) NotDone() bool {
1165 return !page.oclr.IsEmpty()
1166 }
1167
1168
1169 func (page OuContainerListResultPage) Response() OuContainerListResult {
1170 return page.oclr
1171 }
1172
1173
1174 func (page OuContainerListResultPage) Values() []OuContainer {
1175 if page.oclr.IsEmpty() {
1176 return nil
1177 }
1178 return *page.oclr.Value
1179 }
1180
1181
1182 func NewOuContainerListResultPage(cur OuContainerListResult, getNextPage func(context.Context, OuContainerListResult) (OuContainerListResult, error)) OuContainerListResultPage {
1183 return OuContainerListResultPage{
1184 fn: getNextPage,
1185 oclr: cur,
1186 }
1187 }
1188
1189
1190 type OuContainerProperties struct {
1191
1192 TenantID *string `json:"tenantId,omitempty"`
1193
1194 DomainName *string `json:"domainName,omitempty"`
1195
1196 DeploymentID *string `json:"deploymentId,omitempty"`
1197
1198 ContainerID *string `json:"containerId,omitempty"`
1199
1200 Accounts *[]ContainerAccount `json:"accounts,omitempty"`
1201
1202 ServiceStatus *string `json:"serviceStatus,omitempty"`
1203
1204 DistinguishedName *string `json:"distinguishedName,omitempty"`
1205
1206 ProvisioningState *string `json:"provisioningState,omitempty"`
1207 }
1208
1209
1210 func (ocp OuContainerProperties) MarshalJSON() ([]byte, error) {
1211 objectMap := make(map[string]interface{})
1212 if ocp.Accounts != nil {
1213 objectMap["accounts"] = ocp.Accounts
1214 }
1215 return json.Marshal(objectMap)
1216 }
1217
1218
1219
1220 type OuContainerUpdateFuture struct {
1221 azure.FutureAPI
1222
1223
1224 Result func(OuContainerClient) (OuContainer, error)
1225 }
1226
1227
1228 func (future *OuContainerUpdateFuture) UnmarshalJSON(body []byte) error {
1229 var azFuture azure.Future
1230 if err := json.Unmarshal(body, &azFuture); err != nil {
1231 return err
1232 }
1233 future.FutureAPI = &azFuture
1234 future.Result = future.result
1235 return nil
1236 }
1237
1238
1239 func (future *OuContainerUpdateFuture) result(client OuContainerClient) (oc OuContainer, err error) {
1240 var done bool
1241 done, err = future.DoneWithContext(context.Background(), client)
1242 if err != nil {
1243 err = autorest.NewErrorWithError(err, "aad.OuContainerUpdateFuture", "Result", future.Response(), "Polling failure")
1244 return
1245 }
1246 if !done {
1247 oc.Response.Response = future.Response()
1248 err = azure.NewAsyncOpIncompleteError("aad.OuContainerUpdateFuture")
1249 return
1250 }
1251 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1252 if oc.Response.Response, err = future.GetResult(sender); err == nil && oc.Response.Response.StatusCode != http.StatusNoContent {
1253 oc, err = client.UpdateResponder(oc.Response.Response)
1254 if err != nil {
1255 err = autorest.NewErrorWithError(err, "aad.OuContainerUpdateFuture", "Result", oc.Response.Response, "Failure responding to request")
1256 }
1257 }
1258 return
1259 }
1260
1261
1262 type ReplicaSet struct {
1263
1264 ReplicaSetID *string `json:"replicaSetId,omitempty"`
1265
1266 Location *string `json:"location,omitempty"`
1267
1268 VnetSiteID *string `json:"vnetSiteId,omitempty"`
1269
1270 SubnetID *string `json:"subnetId,omitempty"`
1271
1272 DomainControllerIPAddress *[]string `json:"domainControllerIpAddress,omitempty"`
1273
1274 ExternalAccessIPAddress *string `json:"externalAccessIpAddress,omitempty"`
1275
1276 ServiceStatus *string `json:"serviceStatus,omitempty"`
1277
1278 HealthLastEvaluated *date.TimeRFC1123 `json:"healthLastEvaluated,omitempty"`
1279
1280 HealthMonitors *[]HealthMonitor `json:"healthMonitors,omitempty"`
1281
1282 HealthAlerts *[]HealthAlert `json:"healthAlerts,omitempty"`
1283 }
1284
1285
1286 func (rs ReplicaSet) MarshalJSON() ([]byte, error) {
1287 objectMap := make(map[string]interface{})
1288 if rs.Location != nil {
1289 objectMap["location"] = rs.Location
1290 }
1291 if rs.SubnetID != nil {
1292 objectMap["subnetId"] = rs.SubnetID
1293 }
1294 return json.Marshal(objectMap)
1295 }
1296
1297
1298 type Resource struct {
1299
1300 ID *string `json:"id,omitempty"`
1301
1302 Name *string `json:"name,omitempty"`
1303
1304 Type *string `json:"type,omitempty"`
1305
1306 Location *string `json:"location,omitempty"`
1307
1308 Tags map[string]*string `json:"tags"`
1309
1310 Etag *string `json:"etag,omitempty"`
1311 }
1312
1313
1314 func (r Resource) MarshalJSON() ([]byte, error) {
1315 objectMap := make(map[string]interface{})
1316 if r.Location != nil {
1317 objectMap["location"] = r.Location
1318 }
1319 if r.Tags != nil {
1320 objectMap["tags"] = r.Tags
1321 }
1322 if r.Etag != nil {
1323 objectMap["etag"] = r.Etag
1324 }
1325 return json.Marshal(objectMap)
1326 }
1327
1328
1329 type ResourceForestSettings struct {
1330
1331 Settings *[]ForestTrust `json:"settings,omitempty"`
1332
1333 ResourceForest *string `json:"resourceForest,omitempty"`
1334 }
1335
View as plain text