1 package containerservice
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/containerservice/mgmt/2021-03-01/containerservice"
22
23
24 type AccessProfile struct {
25
26 KubeConfig *[]byte `json:"kubeConfig,omitempty"`
27 }
28
29
30 type AgentPool struct {
31 autorest.Response `json:"-"`
32
33 *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"`
34
35 ID *string `json:"id,omitempty"`
36
37 Name *string `json:"name,omitempty"`
38
39 Type *string `json:"type,omitempty"`
40 }
41
42
43 func (ap AgentPool) MarshalJSON() ([]byte, error) {
44 objectMap := make(map[string]interface{})
45 if ap.ManagedClusterAgentPoolProfileProperties != nil {
46 objectMap["properties"] = ap.ManagedClusterAgentPoolProfileProperties
47 }
48 return json.Marshal(objectMap)
49 }
50
51
52 func (ap *AgentPool) UnmarshalJSON(body []byte) error {
53 var m map[string]*json.RawMessage
54 err := json.Unmarshal(body, &m)
55 if err != nil {
56 return err
57 }
58 for k, v := range m {
59 switch k {
60 case "properties":
61 if v != nil {
62 var managedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties
63 err = json.Unmarshal(*v, &managedClusterAgentPoolProfileProperties)
64 if err != nil {
65 return err
66 }
67 ap.ManagedClusterAgentPoolProfileProperties = &managedClusterAgentPoolProfileProperties
68 }
69 case "id":
70 if v != nil {
71 var ID string
72 err = json.Unmarshal(*v, &ID)
73 if err != nil {
74 return err
75 }
76 ap.ID = &ID
77 }
78 case "name":
79 if v != nil {
80 var name string
81 err = json.Unmarshal(*v, &name)
82 if err != nil {
83 return err
84 }
85 ap.Name = &name
86 }
87 case "type":
88 if v != nil {
89 var typeVar string
90 err = json.Unmarshal(*v, &typeVar)
91 if err != nil {
92 return err
93 }
94 ap.Type = &typeVar
95 }
96 }
97 }
98
99 return nil
100 }
101
102
103 type AgentPoolAvailableVersions struct {
104 autorest.Response `json:"-"`
105
106 ID *string `json:"id,omitempty"`
107
108 Name *string `json:"name,omitempty"`
109
110 Type *string `json:"type,omitempty"`
111
112 *AgentPoolAvailableVersionsProperties `json:"properties,omitempty"`
113 }
114
115
116 func (apav AgentPoolAvailableVersions) MarshalJSON() ([]byte, error) {
117 objectMap := make(map[string]interface{})
118 if apav.AgentPoolAvailableVersionsProperties != nil {
119 objectMap["properties"] = apav.AgentPoolAvailableVersionsProperties
120 }
121 return json.Marshal(objectMap)
122 }
123
124
125 func (apav *AgentPoolAvailableVersions) UnmarshalJSON(body []byte) error {
126 var m map[string]*json.RawMessage
127 err := json.Unmarshal(body, &m)
128 if err != nil {
129 return err
130 }
131 for k, v := range m {
132 switch k {
133 case "id":
134 if v != nil {
135 var ID string
136 err = json.Unmarshal(*v, &ID)
137 if err != nil {
138 return err
139 }
140 apav.ID = &ID
141 }
142 case "name":
143 if v != nil {
144 var name string
145 err = json.Unmarshal(*v, &name)
146 if err != nil {
147 return err
148 }
149 apav.Name = &name
150 }
151 case "type":
152 if v != nil {
153 var typeVar string
154 err = json.Unmarshal(*v, &typeVar)
155 if err != nil {
156 return err
157 }
158 apav.Type = &typeVar
159 }
160 case "properties":
161 if v != nil {
162 var agentPoolAvailableVersionsProperties AgentPoolAvailableVersionsProperties
163 err = json.Unmarshal(*v, &agentPoolAvailableVersionsProperties)
164 if err != nil {
165 return err
166 }
167 apav.AgentPoolAvailableVersionsProperties = &agentPoolAvailableVersionsProperties
168 }
169 }
170 }
171
172 return nil
173 }
174
175
176 type AgentPoolAvailableVersionsProperties struct {
177
178 AgentPoolVersions *[]AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem `json:"agentPoolVersions,omitempty"`
179 }
180
181
182 type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem struct {
183
184 Default *bool `json:"default,omitempty"`
185
186 KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
187
188 IsPreview *bool `json:"isPreview,omitempty"`
189 }
190
191
192 type AgentPoolListResult struct {
193 autorest.Response `json:"-"`
194
195 Value *[]AgentPool `json:"value,omitempty"`
196
197 NextLink *string `json:"nextLink,omitempty"`
198 }
199
200
201 func (aplr AgentPoolListResult) MarshalJSON() ([]byte, error) {
202 objectMap := make(map[string]interface{})
203 if aplr.Value != nil {
204 objectMap["value"] = aplr.Value
205 }
206 return json.Marshal(objectMap)
207 }
208
209
210 type AgentPoolListResultIterator struct {
211 i int
212 page AgentPoolListResultPage
213 }
214
215
216
217 func (iter *AgentPoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
218 if tracing.IsEnabled() {
219 ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultIterator.NextWithContext")
220 defer func() {
221 sc := -1
222 if iter.Response().Response.Response != nil {
223 sc = iter.Response().Response.Response.StatusCode
224 }
225 tracing.EndSpan(ctx, sc, err)
226 }()
227 }
228 iter.i++
229 if iter.i < len(iter.page.Values()) {
230 return nil
231 }
232 err = iter.page.NextWithContext(ctx)
233 if err != nil {
234 iter.i--
235 return err
236 }
237 iter.i = 0
238 return nil
239 }
240
241
242
243
244 func (iter *AgentPoolListResultIterator) Next() error {
245 return iter.NextWithContext(context.Background())
246 }
247
248
249 func (iter AgentPoolListResultIterator) NotDone() bool {
250 return iter.page.NotDone() && iter.i < len(iter.page.Values())
251 }
252
253
254 func (iter AgentPoolListResultIterator) Response() AgentPoolListResult {
255 return iter.page.Response()
256 }
257
258
259
260 func (iter AgentPoolListResultIterator) Value() AgentPool {
261 if !iter.page.NotDone() {
262 return AgentPool{}
263 }
264 return iter.page.Values()[iter.i]
265 }
266
267
268 func NewAgentPoolListResultIterator(page AgentPoolListResultPage) AgentPoolListResultIterator {
269 return AgentPoolListResultIterator{page: page}
270 }
271
272
273 func (aplr AgentPoolListResult) IsEmpty() bool {
274 return aplr.Value == nil || len(*aplr.Value) == 0
275 }
276
277
278 func (aplr AgentPoolListResult) hasNextLink() bool {
279 return aplr.NextLink != nil && len(*aplr.NextLink) != 0
280 }
281
282
283
284 func (aplr AgentPoolListResult) agentPoolListResultPreparer(ctx context.Context) (*http.Request, error) {
285 if !aplr.hasNextLink() {
286 return nil, nil
287 }
288 return autorest.Prepare((&http.Request{}).WithContext(ctx),
289 autorest.AsJSON(),
290 autorest.AsGet(),
291 autorest.WithBaseURL(to.String(aplr.NextLink)))
292 }
293
294
295 type AgentPoolListResultPage struct {
296 fn func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)
297 aplr AgentPoolListResult
298 }
299
300
301
302 func (page *AgentPoolListResultPage) NextWithContext(ctx context.Context) (err error) {
303 if tracing.IsEnabled() {
304 ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultPage.NextWithContext")
305 defer func() {
306 sc := -1
307 if page.Response().Response.Response != nil {
308 sc = page.Response().Response.Response.StatusCode
309 }
310 tracing.EndSpan(ctx, sc, err)
311 }()
312 }
313 for {
314 next, err := page.fn(ctx, page.aplr)
315 if err != nil {
316 return err
317 }
318 page.aplr = next
319 if !next.hasNextLink() || !next.IsEmpty() {
320 break
321 }
322 }
323 return nil
324 }
325
326
327
328
329 func (page *AgentPoolListResultPage) Next() error {
330 return page.NextWithContext(context.Background())
331 }
332
333
334 func (page AgentPoolListResultPage) NotDone() bool {
335 return !page.aplr.IsEmpty()
336 }
337
338
339 func (page AgentPoolListResultPage) Response() AgentPoolListResult {
340 return page.aplr
341 }
342
343
344 func (page AgentPoolListResultPage) Values() []AgentPool {
345 if page.aplr.IsEmpty() {
346 return nil
347 }
348 return *page.aplr.Value
349 }
350
351
352 func NewAgentPoolListResultPage(cur AgentPoolListResult, getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage {
353 return AgentPoolListResultPage{
354 fn: getNextPage,
355 aplr: cur,
356 }
357 }
358
359
360
361 type AgentPoolsCreateOrUpdateFuture struct {
362 azure.FutureAPI
363
364
365 Result func(AgentPoolsClient) (AgentPool, error)
366 }
367
368
369 func (future *AgentPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
370 var azFuture azure.Future
371 if err := json.Unmarshal(body, &azFuture); err != nil {
372 return err
373 }
374 future.FutureAPI = &azFuture
375 future.Result = future.result
376 return nil
377 }
378
379
380 func (future *AgentPoolsCreateOrUpdateFuture) result(client AgentPoolsClient) (ap AgentPool, err error) {
381 var done bool
382 done, err = future.DoneWithContext(context.Background(), client)
383 if err != nil {
384 err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
385 return
386 }
387 if !done {
388 ap.Response.Response = future.Response()
389 err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsCreateOrUpdateFuture")
390 return
391 }
392 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
393 if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
394 ap, err = client.CreateOrUpdateResponder(ap.Response.Response)
395 if err != nil {
396 err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", ap.Response.Response, "Failure responding to request")
397 }
398 }
399 return
400 }
401
402
403
404 type AgentPoolsDeleteFuture struct {
405 azure.FutureAPI
406
407
408 Result func(AgentPoolsClient) (autorest.Response, error)
409 }
410
411
412 func (future *AgentPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
413 var azFuture azure.Future
414 if err := json.Unmarshal(body, &azFuture); err != nil {
415 return err
416 }
417 future.FutureAPI = &azFuture
418 future.Result = future.result
419 return nil
420 }
421
422
423 func (future *AgentPoolsDeleteFuture) result(client AgentPoolsClient) (ar autorest.Response, err error) {
424 var done bool
425 done, err = future.DoneWithContext(context.Background(), client)
426 if err != nil {
427 err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
428 return
429 }
430 if !done {
431 ar.Response = future.Response()
432 err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsDeleteFuture")
433 return
434 }
435 ar.Response = future.Response()
436 return
437 }
438
439
440
441 type AgentPoolsUpgradeNodeImageVersionFuture struct {
442 azure.FutureAPI
443
444
445 Result func(AgentPoolsClient) (AgentPool, error)
446 }
447
448
449 func (future *AgentPoolsUpgradeNodeImageVersionFuture) UnmarshalJSON(body []byte) error {
450 var azFuture azure.Future
451 if err := json.Unmarshal(body, &azFuture); err != nil {
452 return err
453 }
454 future.FutureAPI = &azFuture
455 future.Result = future.result
456 return nil
457 }
458
459
460 func (future *AgentPoolsUpgradeNodeImageVersionFuture) result(client AgentPoolsClient) (ap AgentPool, err error) {
461 var done bool
462 done, err = future.DoneWithContext(context.Background(), client)
463 if err != nil {
464 err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsUpgradeNodeImageVersionFuture", "Result", future.Response(), "Polling failure")
465 return
466 }
467 if !done {
468 ap.Response.Response = future.Response()
469 err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsUpgradeNodeImageVersionFuture")
470 return
471 }
472 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
473 if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
474 ap, err = client.UpgradeNodeImageVersionResponder(ap.Response.Response)
475 if err != nil {
476 err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsUpgradeNodeImageVersionFuture", "Result", ap.Response.Response, "Failure responding to request")
477 }
478 }
479 return
480 }
481
482
483 type AgentPoolUpgradeProfile struct {
484 autorest.Response `json:"-"`
485
486 ID *string `json:"id,omitempty"`
487
488 Name *string `json:"name,omitempty"`
489
490 Type *string `json:"type,omitempty"`
491
492 *AgentPoolUpgradeProfileProperties `json:"properties,omitempty"`
493 }
494
495
496 func (apup AgentPoolUpgradeProfile) MarshalJSON() ([]byte, error) {
497 objectMap := make(map[string]interface{})
498 if apup.AgentPoolUpgradeProfileProperties != nil {
499 objectMap["properties"] = apup.AgentPoolUpgradeProfileProperties
500 }
501 return json.Marshal(objectMap)
502 }
503
504
505 func (apup *AgentPoolUpgradeProfile) UnmarshalJSON(body []byte) error {
506 var m map[string]*json.RawMessage
507 err := json.Unmarshal(body, &m)
508 if err != nil {
509 return err
510 }
511 for k, v := range m {
512 switch k {
513 case "id":
514 if v != nil {
515 var ID string
516 err = json.Unmarshal(*v, &ID)
517 if err != nil {
518 return err
519 }
520 apup.ID = &ID
521 }
522 case "name":
523 if v != nil {
524 var name string
525 err = json.Unmarshal(*v, &name)
526 if err != nil {
527 return err
528 }
529 apup.Name = &name
530 }
531 case "type":
532 if v != nil {
533 var typeVar string
534 err = json.Unmarshal(*v, &typeVar)
535 if err != nil {
536 return err
537 }
538 apup.Type = &typeVar
539 }
540 case "properties":
541 if v != nil {
542 var agentPoolUpgradeProfileProperties AgentPoolUpgradeProfileProperties
543 err = json.Unmarshal(*v, &agentPoolUpgradeProfileProperties)
544 if err != nil {
545 return err
546 }
547 apup.AgentPoolUpgradeProfileProperties = &agentPoolUpgradeProfileProperties
548 }
549 }
550 }
551
552 return nil
553 }
554
555
556 type AgentPoolUpgradeProfileProperties struct {
557
558 KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
559
560 OsType OSType `json:"osType,omitempty"`
561
562 Upgrades *[]AgentPoolUpgradeProfilePropertiesUpgradesItem `json:"upgrades,omitempty"`
563
564 LatestNodeImageVersion *string `json:"latestNodeImageVersion,omitempty"`
565 }
566
567
568 type AgentPoolUpgradeProfilePropertiesUpgradesItem struct {
569
570 KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
571
572 IsPreview *bool `json:"isPreview,omitempty"`
573 }
574
575
576 type AgentPoolUpgradeSettings struct {
577
578 MaxSurge *string `json:"maxSurge,omitempty"`
579 }
580
581
582 type CloudError struct {
583
584 Error *CloudErrorBody `json:"error,omitempty"`
585 }
586
587
588 type CloudErrorBody struct {
589
590 Code *string `json:"code,omitempty"`
591
592 Message *string `json:"message,omitempty"`
593
594 Target *string `json:"target,omitempty"`
595
596 Details *[]CloudErrorBody `json:"details,omitempty"`
597 }
598
599
600 type CommandResultProperties struct {
601
602 ProvisioningState *string `json:"provisioningState,omitempty"`
603
604 ExitCode *int32 `json:"exitCode,omitempty"`
605
606 StartedAt *date.Time `json:"startedAt,omitempty"`
607
608 FinishedAt *date.Time `json:"finishedAt,omitempty"`
609
610 Logs *string `json:"logs,omitempty"`
611
612 Reason *string `json:"reason,omitempty"`
613 }
614
615
616 func (crp CommandResultProperties) MarshalJSON() ([]byte, error) {
617 objectMap := make(map[string]interface{})
618 return json.Marshal(objectMap)
619 }
620
621
622 type CredentialResult struct {
623
624 Name *string `json:"name,omitempty"`
625
626 Value *[]byte `json:"value,omitempty"`
627 }
628
629
630 func (cr CredentialResult) MarshalJSON() ([]byte, error) {
631 objectMap := make(map[string]interface{})
632 return json.Marshal(objectMap)
633 }
634
635
636 type CredentialResults struct {
637 autorest.Response `json:"-"`
638
639 Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"`
640 }
641
642
643 func (cr CredentialResults) MarshalJSON() ([]byte, error) {
644 objectMap := make(map[string]interface{})
645 return json.Marshal(objectMap)
646 }
647
648
649 type DiagnosticsProfile struct {
650
651 VMDiagnostics *VMDiagnostics `json:"vmDiagnostics,omitempty"`
652 }
653
654
655 type ExtendedLocation struct {
656
657 Name *string `json:"name,omitempty"`
658
659 Type ExtendedLocationTypes `json:"type,omitempty"`
660 }
661
662
663 type KubeletConfig struct {
664
665 CPUManagerPolicy *string `json:"cpuManagerPolicy,omitempty"`
666
667 CPUCfsQuota *bool `json:"cpuCfsQuota,omitempty"`
668
669 CPUCfsQuotaPeriod *string `json:"cpuCfsQuotaPeriod,omitempty"`
670
671 ImageGcHighThreshold *int32 `json:"imageGcHighThreshold,omitempty"`
672
673 ImageGcLowThreshold *int32 `json:"imageGcLowThreshold,omitempty"`
674
675 TopologyManagerPolicy *string `json:"topologyManagerPolicy,omitempty"`
676
677 AllowedUnsafeSysctls *[]string `json:"allowedUnsafeSysctls,omitempty"`
678
679 FailSwapOn *bool `json:"failSwapOn,omitempty"`
680
681 ContainerLogMaxSizeMB *int32 `json:"containerLogMaxSizeMB,omitempty"`
682
683 ContainerLogMaxFiles *int32 `json:"containerLogMaxFiles,omitempty"`
684
685 PodMaxPids *int32 `json:"podMaxPids,omitempty"`
686 }
687
688
689 type LinuxOSConfig struct {
690
691 Sysctls *SysctlConfig `json:"sysctls,omitempty"`
692
693 TransparentHugePageEnabled *string `json:"transparentHugePageEnabled,omitempty"`
694
695 TransparentHugePageDefrag *string `json:"transparentHugePageDefrag,omitempty"`
696
697 SwapFileSizeMB *int32 `json:"swapFileSizeMB,omitempty"`
698 }
699
700
701 type LinuxProfile struct {
702
703 AdminUsername *string `json:"adminUsername,omitempty"`
704
705 SSH *SSHConfiguration `json:"ssh,omitempty"`
706 }
707
708
709 type MaintenanceConfiguration struct {
710 autorest.Response `json:"-"`
711
712 SystemData *SystemData `json:"systemData,omitempty"`
713
714 *MaintenanceConfigurationProperties `json:"properties,omitempty"`
715
716 ID *string `json:"id,omitempty"`
717
718 Name *string `json:"name,omitempty"`
719
720 Type *string `json:"type,omitempty"`
721 }
722
723
724 func (mc MaintenanceConfiguration) MarshalJSON() ([]byte, error) {
725 objectMap := make(map[string]interface{})
726 if mc.MaintenanceConfigurationProperties != nil {
727 objectMap["properties"] = mc.MaintenanceConfigurationProperties
728 }
729 return json.Marshal(objectMap)
730 }
731
732
733 func (mc *MaintenanceConfiguration) UnmarshalJSON(body []byte) error {
734 var m map[string]*json.RawMessage
735 err := json.Unmarshal(body, &m)
736 if err != nil {
737 return err
738 }
739 for k, v := range m {
740 switch k {
741 case "systemData":
742 if v != nil {
743 var systemData SystemData
744 err = json.Unmarshal(*v, &systemData)
745 if err != nil {
746 return err
747 }
748 mc.SystemData = &systemData
749 }
750 case "properties":
751 if v != nil {
752 var maintenanceConfigurationProperties MaintenanceConfigurationProperties
753 err = json.Unmarshal(*v, &maintenanceConfigurationProperties)
754 if err != nil {
755 return err
756 }
757 mc.MaintenanceConfigurationProperties = &maintenanceConfigurationProperties
758 }
759 case "id":
760 if v != nil {
761 var ID string
762 err = json.Unmarshal(*v, &ID)
763 if err != nil {
764 return err
765 }
766 mc.ID = &ID
767 }
768 case "name":
769 if v != nil {
770 var name string
771 err = json.Unmarshal(*v, &name)
772 if err != nil {
773 return err
774 }
775 mc.Name = &name
776 }
777 case "type":
778 if v != nil {
779 var typeVar string
780 err = json.Unmarshal(*v, &typeVar)
781 if err != nil {
782 return err
783 }
784 mc.Type = &typeVar
785 }
786 }
787 }
788
789 return nil
790 }
791
792
793 type MaintenanceConfigurationListResult struct {
794 autorest.Response `json:"-"`
795
796 Value *[]MaintenanceConfiguration `json:"value,omitempty"`
797
798 NextLink *string `json:"nextLink,omitempty"`
799 }
800
801
802 func (mclr MaintenanceConfigurationListResult) MarshalJSON() ([]byte, error) {
803 objectMap := make(map[string]interface{})
804 if mclr.Value != nil {
805 objectMap["value"] = mclr.Value
806 }
807 return json.Marshal(objectMap)
808 }
809
810
811
812 type MaintenanceConfigurationListResultIterator struct {
813 i int
814 page MaintenanceConfigurationListResultPage
815 }
816
817
818
819 func (iter *MaintenanceConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) {
820 if tracing.IsEnabled() {
821 ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationListResultIterator.NextWithContext")
822 defer func() {
823 sc := -1
824 if iter.Response().Response.Response != nil {
825 sc = iter.Response().Response.Response.StatusCode
826 }
827 tracing.EndSpan(ctx, sc, err)
828 }()
829 }
830 iter.i++
831 if iter.i < len(iter.page.Values()) {
832 return nil
833 }
834 err = iter.page.NextWithContext(ctx)
835 if err != nil {
836 iter.i--
837 return err
838 }
839 iter.i = 0
840 return nil
841 }
842
843
844
845
846 func (iter *MaintenanceConfigurationListResultIterator) Next() error {
847 return iter.NextWithContext(context.Background())
848 }
849
850
851 func (iter MaintenanceConfigurationListResultIterator) NotDone() bool {
852 return iter.page.NotDone() && iter.i < len(iter.page.Values())
853 }
854
855
856 func (iter MaintenanceConfigurationListResultIterator) Response() MaintenanceConfigurationListResult {
857 return iter.page.Response()
858 }
859
860
861
862 func (iter MaintenanceConfigurationListResultIterator) Value() MaintenanceConfiguration {
863 if !iter.page.NotDone() {
864 return MaintenanceConfiguration{}
865 }
866 return iter.page.Values()[iter.i]
867 }
868
869
870 func NewMaintenanceConfigurationListResultIterator(page MaintenanceConfigurationListResultPage) MaintenanceConfigurationListResultIterator {
871 return MaintenanceConfigurationListResultIterator{page: page}
872 }
873
874
875 func (mclr MaintenanceConfigurationListResult) IsEmpty() bool {
876 return mclr.Value == nil || len(*mclr.Value) == 0
877 }
878
879
880 func (mclr MaintenanceConfigurationListResult) hasNextLink() bool {
881 return mclr.NextLink != nil && len(*mclr.NextLink) != 0
882 }
883
884
885
886 func (mclr MaintenanceConfigurationListResult) maintenanceConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) {
887 if !mclr.hasNextLink() {
888 return nil, nil
889 }
890 return autorest.Prepare((&http.Request{}).WithContext(ctx),
891 autorest.AsJSON(),
892 autorest.AsGet(),
893 autorest.WithBaseURL(to.String(mclr.NextLink)))
894 }
895
896
897 type MaintenanceConfigurationListResultPage struct {
898 fn func(context.Context, MaintenanceConfigurationListResult) (MaintenanceConfigurationListResult, error)
899 mclr MaintenanceConfigurationListResult
900 }
901
902
903
904 func (page *MaintenanceConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) {
905 if tracing.IsEnabled() {
906 ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationListResultPage.NextWithContext")
907 defer func() {
908 sc := -1
909 if page.Response().Response.Response != nil {
910 sc = page.Response().Response.Response.StatusCode
911 }
912 tracing.EndSpan(ctx, sc, err)
913 }()
914 }
915 for {
916 next, err := page.fn(ctx, page.mclr)
917 if err != nil {
918 return err
919 }
920 page.mclr = next
921 if !next.hasNextLink() || !next.IsEmpty() {
922 break
923 }
924 }
925 return nil
926 }
927
928
929
930
931 func (page *MaintenanceConfigurationListResultPage) Next() error {
932 return page.NextWithContext(context.Background())
933 }
934
935
936 func (page MaintenanceConfigurationListResultPage) NotDone() bool {
937 return !page.mclr.IsEmpty()
938 }
939
940
941 func (page MaintenanceConfigurationListResultPage) Response() MaintenanceConfigurationListResult {
942 return page.mclr
943 }
944
945
946 func (page MaintenanceConfigurationListResultPage) Values() []MaintenanceConfiguration {
947 if page.mclr.IsEmpty() {
948 return nil
949 }
950 return *page.mclr.Value
951 }
952
953
954 func NewMaintenanceConfigurationListResultPage(cur MaintenanceConfigurationListResult, getNextPage func(context.Context, MaintenanceConfigurationListResult) (MaintenanceConfigurationListResult, error)) MaintenanceConfigurationListResultPage {
955 return MaintenanceConfigurationListResultPage{
956 fn: getNextPage,
957 mclr: cur,
958 }
959 }
960
961
962 type MaintenanceConfigurationProperties struct {
963
964 TimeInWeek *[]TimeInWeek `json:"timeInWeek,omitempty"`
965
966 NotAllowedTime *[]TimeSpan `json:"notAllowedTime,omitempty"`
967 }
968
969
970 type ManagedCluster struct {
971 autorest.Response `json:"-"`
972
973 *ManagedClusterProperties `json:"properties,omitempty"`
974
975 Identity *ManagedClusterIdentity `json:"identity,omitempty"`
976
977 Sku *ManagedClusterSKU `json:"sku,omitempty"`
978
979 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"`
980
981 ID *string `json:"id,omitempty"`
982
983 Name *string `json:"name,omitempty"`
984
985 Type *string `json:"type,omitempty"`
986
987 Location *string `json:"location,omitempty"`
988
989 Tags map[string]*string `json:"tags"`
990 }
991
992
993 func (mc ManagedCluster) MarshalJSON() ([]byte, error) {
994 objectMap := make(map[string]interface{})
995 if mc.ManagedClusterProperties != nil {
996 objectMap["properties"] = mc.ManagedClusterProperties
997 }
998 if mc.Identity != nil {
999 objectMap["identity"] = mc.Identity
1000 }
1001 if mc.Sku != nil {
1002 objectMap["sku"] = mc.Sku
1003 }
1004 if mc.ExtendedLocation != nil {
1005 objectMap["extendedLocation"] = mc.ExtendedLocation
1006 }
1007 if mc.Location != nil {
1008 objectMap["location"] = mc.Location
1009 }
1010 if mc.Tags != nil {
1011 objectMap["tags"] = mc.Tags
1012 }
1013 return json.Marshal(objectMap)
1014 }
1015
1016
1017 func (mc *ManagedCluster) UnmarshalJSON(body []byte) error {
1018 var m map[string]*json.RawMessage
1019 err := json.Unmarshal(body, &m)
1020 if err != nil {
1021 return err
1022 }
1023 for k, v := range m {
1024 switch k {
1025 case "properties":
1026 if v != nil {
1027 var managedClusterProperties ManagedClusterProperties
1028 err = json.Unmarshal(*v, &managedClusterProperties)
1029 if err != nil {
1030 return err
1031 }
1032 mc.ManagedClusterProperties = &managedClusterProperties
1033 }
1034 case "identity":
1035 if v != nil {
1036 var identity ManagedClusterIdentity
1037 err = json.Unmarshal(*v, &identity)
1038 if err != nil {
1039 return err
1040 }
1041 mc.Identity = &identity
1042 }
1043 case "sku":
1044 if v != nil {
1045 var sku ManagedClusterSKU
1046 err = json.Unmarshal(*v, &sku)
1047 if err != nil {
1048 return err
1049 }
1050 mc.Sku = &sku
1051 }
1052 case "extendedLocation":
1053 if v != nil {
1054 var extendedLocation ExtendedLocation
1055 err = json.Unmarshal(*v, &extendedLocation)
1056 if err != nil {
1057 return err
1058 }
1059 mc.ExtendedLocation = &extendedLocation
1060 }
1061 case "id":
1062 if v != nil {
1063 var ID string
1064 err = json.Unmarshal(*v, &ID)
1065 if err != nil {
1066 return err
1067 }
1068 mc.ID = &ID
1069 }
1070 case "name":
1071 if v != nil {
1072 var name string
1073 err = json.Unmarshal(*v, &name)
1074 if err != nil {
1075 return err
1076 }
1077 mc.Name = &name
1078 }
1079 case "type":
1080 if v != nil {
1081 var typeVar string
1082 err = json.Unmarshal(*v, &typeVar)
1083 if err != nil {
1084 return err
1085 }
1086 mc.Type = &typeVar
1087 }
1088 case "location":
1089 if v != nil {
1090 var location string
1091 err = json.Unmarshal(*v, &location)
1092 if err != nil {
1093 return err
1094 }
1095 mc.Location = &location
1096 }
1097 case "tags":
1098 if v != nil {
1099 var tags map[string]*string
1100 err = json.Unmarshal(*v, &tags)
1101 if err != nil {
1102 return err
1103 }
1104 mc.Tags = tags
1105 }
1106 }
1107 }
1108
1109 return nil
1110 }
1111
1112
1113 type ManagedClusterAADProfile struct {
1114
1115 Managed *bool `json:"managed,omitempty"`
1116
1117 EnableAzureRBAC *bool `json:"enableAzureRBAC,omitempty"`
1118
1119 AdminGroupObjectIDs *[]string `json:"adminGroupObjectIDs,omitempty"`
1120
1121 ClientAppID *string `json:"clientAppID,omitempty"`
1122
1123 ServerAppID *string `json:"serverAppID,omitempty"`
1124
1125 ServerAppSecret *string `json:"serverAppSecret,omitempty"`
1126
1127 TenantID *string `json:"tenantID,omitempty"`
1128 }
1129
1130
1131 type ManagedClusterAccessProfile struct {
1132 autorest.Response `json:"-"`
1133
1134 *AccessProfile `json:"properties,omitempty"`
1135
1136 ID *string `json:"id,omitempty"`
1137
1138 Name *string `json:"name,omitempty"`
1139
1140 Type *string `json:"type,omitempty"`
1141
1142 Location *string `json:"location,omitempty"`
1143
1144 Tags map[string]*string `json:"tags"`
1145 }
1146
1147
1148 func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) {
1149 objectMap := make(map[string]interface{})
1150 if mcap.AccessProfile != nil {
1151 objectMap["properties"] = mcap.AccessProfile
1152 }
1153 if mcap.Location != nil {
1154 objectMap["location"] = mcap.Location
1155 }
1156 if mcap.Tags != nil {
1157 objectMap["tags"] = mcap.Tags
1158 }
1159 return json.Marshal(objectMap)
1160 }
1161
1162
1163 func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error {
1164 var m map[string]*json.RawMessage
1165 err := json.Unmarshal(body, &m)
1166 if err != nil {
1167 return err
1168 }
1169 for k, v := range m {
1170 switch k {
1171 case "properties":
1172 if v != nil {
1173 var accessProfile AccessProfile
1174 err = json.Unmarshal(*v, &accessProfile)
1175 if err != nil {
1176 return err
1177 }
1178 mcap.AccessProfile = &accessProfile
1179 }
1180 case "id":
1181 if v != nil {
1182 var ID string
1183 err = json.Unmarshal(*v, &ID)
1184 if err != nil {
1185 return err
1186 }
1187 mcap.ID = &ID
1188 }
1189 case "name":
1190 if v != nil {
1191 var name string
1192 err = json.Unmarshal(*v, &name)
1193 if err != nil {
1194 return err
1195 }
1196 mcap.Name = &name
1197 }
1198 case "type":
1199 if v != nil {
1200 var typeVar string
1201 err = json.Unmarshal(*v, &typeVar)
1202 if err != nil {
1203 return err
1204 }
1205 mcap.Type = &typeVar
1206 }
1207 case "location":
1208 if v != nil {
1209 var location string
1210 err = json.Unmarshal(*v, &location)
1211 if err != nil {
1212 return err
1213 }
1214 mcap.Location = &location
1215 }
1216 case "tags":
1217 if v != nil {
1218 var tags map[string]*string
1219 err = json.Unmarshal(*v, &tags)
1220 if err != nil {
1221 return err
1222 }
1223 mcap.Tags = tags
1224 }
1225 }
1226 }
1227
1228 return nil
1229 }
1230
1231
1232 type ManagedClusterAddonProfile struct {
1233
1234 Enabled *bool `json:"enabled,omitempty"`
1235
1236 Config map[string]*string `json:"config"`
1237
1238 Identity *ManagedClusterAddonProfileIdentity `json:"identity,omitempty"`
1239 }
1240
1241
1242 func (mcap ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) {
1243 objectMap := make(map[string]interface{})
1244 if mcap.Enabled != nil {
1245 objectMap["enabled"] = mcap.Enabled
1246 }
1247 if mcap.Config != nil {
1248 objectMap["config"] = mcap.Config
1249 }
1250 return json.Marshal(objectMap)
1251 }
1252
1253
1254 type ManagedClusterAddonProfileIdentity struct {
1255
1256 ResourceID *string `json:"resourceId,omitempty"`
1257
1258 ClientID *string `json:"clientId,omitempty"`
1259
1260 ObjectID *string `json:"objectId,omitempty"`
1261 }
1262
1263
1264 type ManagedClusterAgentPoolProfile struct {
1265
1266 Name *string `json:"name,omitempty"`
1267
1268 Count *int32 `json:"count,omitempty"`
1269
1270 VMSize *string `json:"vmSize,omitempty"`
1271
1272 OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"`
1273
1274 OsDiskType OSDiskType `json:"osDiskType,omitempty"`
1275
1276 KubeletDiskType KubeletDiskType `json:"kubeletDiskType,omitempty"`
1277
1278 VnetSubnetID *string `json:"vnetSubnetID,omitempty"`
1279
1280 PodSubnetID *string `json:"podSubnetID,omitempty"`
1281
1282 MaxPods *int32 `json:"maxPods,omitempty"`
1283
1284 OsType OSType `json:"osType,omitempty"`
1285
1286 OsSKU OSSKU `json:"osSKU,omitempty"`
1287
1288 MaxCount *int32 `json:"maxCount,omitempty"`
1289
1290 MinCount *int32 `json:"minCount,omitempty"`
1291
1292 EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"`
1293
1294 Type AgentPoolType `json:"type,omitempty"`
1295
1296 Mode AgentPoolMode `json:"mode,omitempty"`
1297
1298 OrchestratorVersion *string `json:"orchestratorVersion,omitempty"`
1299
1300 NodeImageVersion *string `json:"nodeImageVersion,omitempty"`
1301
1302 UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"`
1303
1304 ProvisioningState *string `json:"provisioningState,omitempty"`
1305
1306 PowerState *PowerState `json:"powerState,omitempty"`
1307
1308 AvailabilityZones *[]string `json:"availabilityZones,omitempty"`
1309
1310 EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"`
1311
1312 NodePublicIPPrefixID *string `json:"nodePublicIPPrefixID,omitempty"`
1313
1314 ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"`
1315
1316 ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"`
1317
1318 SpotMaxPrice *float64 `json:"spotMaxPrice,omitempty"`
1319
1320 Tags map[string]*string `json:"tags"`
1321
1322 NodeLabels map[string]*string `json:"nodeLabels"`
1323
1324 NodeTaints *[]string `json:"nodeTaints,omitempty"`
1325
1326 ProximityPlacementGroupID *string `json:"proximityPlacementGroupID,omitempty"`
1327
1328 KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"`
1329
1330 LinuxOSConfig *LinuxOSConfig `json:"linuxOSConfig,omitempty"`
1331
1332 EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"`
1333
1334 EnableFIPS *bool `json:"enableFIPS,omitempty"`
1335
1336 GpuInstanceProfile GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"`
1337 }
1338
1339
1340 func (mcapp ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) {
1341 objectMap := make(map[string]interface{})
1342 if mcapp.Name != nil {
1343 objectMap["name"] = mcapp.Name
1344 }
1345 if mcapp.Count != nil {
1346 objectMap["count"] = mcapp.Count
1347 }
1348 if mcapp.VMSize != nil {
1349 objectMap["vmSize"] = mcapp.VMSize
1350 }
1351 if mcapp.OsDiskSizeGB != nil {
1352 objectMap["osDiskSizeGB"] = mcapp.OsDiskSizeGB
1353 }
1354 if mcapp.OsDiskType != "" {
1355 objectMap["osDiskType"] = mcapp.OsDiskType
1356 }
1357 if mcapp.KubeletDiskType != "" {
1358 objectMap["kubeletDiskType"] = mcapp.KubeletDiskType
1359 }
1360 if mcapp.VnetSubnetID != nil {
1361 objectMap["vnetSubnetID"] = mcapp.VnetSubnetID
1362 }
1363 if mcapp.PodSubnetID != nil {
1364 objectMap["podSubnetID"] = mcapp.PodSubnetID
1365 }
1366 if mcapp.MaxPods != nil {
1367 objectMap["maxPods"] = mcapp.MaxPods
1368 }
1369 if mcapp.OsType != "" {
1370 objectMap["osType"] = mcapp.OsType
1371 }
1372 if mcapp.OsSKU != "" {
1373 objectMap["osSKU"] = mcapp.OsSKU
1374 }
1375 if mcapp.MaxCount != nil {
1376 objectMap["maxCount"] = mcapp.MaxCount
1377 }
1378 if mcapp.MinCount != nil {
1379 objectMap["minCount"] = mcapp.MinCount
1380 }
1381 if mcapp.EnableAutoScaling != nil {
1382 objectMap["enableAutoScaling"] = mcapp.EnableAutoScaling
1383 }
1384 if mcapp.Type != "" {
1385 objectMap["type"] = mcapp.Type
1386 }
1387 if mcapp.Mode != "" {
1388 objectMap["mode"] = mcapp.Mode
1389 }
1390 if mcapp.OrchestratorVersion != nil {
1391 objectMap["orchestratorVersion"] = mcapp.OrchestratorVersion
1392 }
1393 if mcapp.UpgradeSettings != nil {
1394 objectMap["upgradeSettings"] = mcapp.UpgradeSettings
1395 }
1396 if mcapp.AvailabilityZones != nil {
1397 objectMap["availabilityZones"] = mcapp.AvailabilityZones
1398 }
1399 if mcapp.EnableNodePublicIP != nil {
1400 objectMap["enableNodePublicIP"] = mcapp.EnableNodePublicIP
1401 }
1402 if mcapp.NodePublicIPPrefixID != nil {
1403 objectMap["nodePublicIPPrefixID"] = mcapp.NodePublicIPPrefixID
1404 }
1405 if mcapp.ScaleSetPriority != "" {
1406 objectMap["scaleSetPriority"] = mcapp.ScaleSetPriority
1407 }
1408 if mcapp.ScaleSetEvictionPolicy != "" {
1409 objectMap["scaleSetEvictionPolicy"] = mcapp.ScaleSetEvictionPolicy
1410 }
1411 if mcapp.SpotMaxPrice != nil {
1412 objectMap["spotMaxPrice"] = mcapp.SpotMaxPrice
1413 }
1414 if mcapp.Tags != nil {
1415 objectMap["tags"] = mcapp.Tags
1416 }
1417 if mcapp.NodeLabels != nil {
1418 objectMap["nodeLabels"] = mcapp.NodeLabels
1419 }
1420 if mcapp.NodeTaints != nil {
1421 objectMap["nodeTaints"] = mcapp.NodeTaints
1422 }
1423 if mcapp.ProximityPlacementGroupID != nil {
1424 objectMap["proximityPlacementGroupID"] = mcapp.ProximityPlacementGroupID
1425 }
1426 if mcapp.KubeletConfig != nil {
1427 objectMap["kubeletConfig"] = mcapp.KubeletConfig
1428 }
1429 if mcapp.LinuxOSConfig != nil {
1430 objectMap["linuxOSConfig"] = mcapp.LinuxOSConfig
1431 }
1432 if mcapp.EnableEncryptionAtHost != nil {
1433 objectMap["enableEncryptionAtHost"] = mcapp.EnableEncryptionAtHost
1434 }
1435 if mcapp.EnableFIPS != nil {
1436 objectMap["enableFIPS"] = mcapp.EnableFIPS
1437 }
1438 if mcapp.GpuInstanceProfile != "" {
1439 objectMap["gpuInstanceProfile"] = mcapp.GpuInstanceProfile
1440 }
1441 return json.Marshal(objectMap)
1442 }
1443
1444
1445 type ManagedClusterAgentPoolProfileProperties struct {
1446
1447 Count *int32 `json:"count,omitempty"`
1448
1449 VMSize *string `json:"vmSize,omitempty"`
1450
1451 OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"`
1452
1453 OsDiskType OSDiskType `json:"osDiskType,omitempty"`
1454
1455 KubeletDiskType KubeletDiskType `json:"kubeletDiskType,omitempty"`
1456
1457 VnetSubnetID *string `json:"vnetSubnetID,omitempty"`
1458
1459 PodSubnetID *string `json:"podSubnetID,omitempty"`
1460
1461 MaxPods *int32 `json:"maxPods,omitempty"`
1462
1463 OsType OSType `json:"osType,omitempty"`
1464
1465 OsSKU OSSKU `json:"osSKU,omitempty"`
1466
1467 MaxCount *int32 `json:"maxCount,omitempty"`
1468
1469 MinCount *int32 `json:"minCount,omitempty"`
1470
1471 EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"`
1472
1473 Type AgentPoolType `json:"type,omitempty"`
1474
1475 Mode AgentPoolMode `json:"mode,omitempty"`
1476
1477 OrchestratorVersion *string `json:"orchestratorVersion,omitempty"`
1478
1479 NodeImageVersion *string `json:"nodeImageVersion,omitempty"`
1480
1481 UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"`
1482
1483 ProvisioningState *string `json:"provisioningState,omitempty"`
1484
1485 PowerState *PowerState `json:"powerState,omitempty"`
1486
1487 AvailabilityZones *[]string `json:"availabilityZones,omitempty"`
1488
1489 EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"`
1490
1491 NodePublicIPPrefixID *string `json:"nodePublicIPPrefixID,omitempty"`
1492
1493 ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"`
1494
1495 ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"`
1496
1497 SpotMaxPrice *float64 `json:"spotMaxPrice,omitempty"`
1498
1499 Tags map[string]*string `json:"tags"`
1500
1501 NodeLabels map[string]*string `json:"nodeLabels"`
1502
1503 NodeTaints *[]string `json:"nodeTaints,omitempty"`
1504
1505 ProximityPlacementGroupID *string `json:"proximityPlacementGroupID,omitempty"`
1506
1507 KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"`
1508
1509 LinuxOSConfig *LinuxOSConfig `json:"linuxOSConfig,omitempty"`
1510
1511 EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"`
1512
1513 EnableFIPS *bool `json:"enableFIPS,omitempty"`
1514
1515 GpuInstanceProfile GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"`
1516 }
1517
1518
1519 func (mcappp ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) {
1520 objectMap := make(map[string]interface{})
1521 if mcappp.Count != nil {
1522 objectMap["count"] = mcappp.Count
1523 }
1524 if mcappp.VMSize != nil {
1525 objectMap["vmSize"] = mcappp.VMSize
1526 }
1527 if mcappp.OsDiskSizeGB != nil {
1528 objectMap["osDiskSizeGB"] = mcappp.OsDiskSizeGB
1529 }
1530 if mcappp.OsDiskType != "" {
1531 objectMap["osDiskType"] = mcappp.OsDiskType
1532 }
1533 if mcappp.KubeletDiskType != "" {
1534 objectMap["kubeletDiskType"] = mcappp.KubeletDiskType
1535 }
1536 if mcappp.VnetSubnetID != nil {
1537 objectMap["vnetSubnetID"] = mcappp.VnetSubnetID
1538 }
1539 if mcappp.PodSubnetID != nil {
1540 objectMap["podSubnetID"] = mcappp.PodSubnetID
1541 }
1542 if mcappp.MaxPods != nil {
1543 objectMap["maxPods"] = mcappp.MaxPods
1544 }
1545 if mcappp.OsType != "" {
1546 objectMap["osType"] = mcappp.OsType
1547 }
1548 if mcappp.OsSKU != "" {
1549 objectMap["osSKU"] = mcappp.OsSKU
1550 }
1551 if mcappp.MaxCount != nil {
1552 objectMap["maxCount"] = mcappp.MaxCount
1553 }
1554 if mcappp.MinCount != nil {
1555 objectMap["minCount"] = mcappp.MinCount
1556 }
1557 if mcappp.EnableAutoScaling != nil {
1558 objectMap["enableAutoScaling"] = mcappp.EnableAutoScaling
1559 }
1560 if mcappp.Type != "" {
1561 objectMap["type"] = mcappp.Type
1562 }
1563 if mcappp.Mode != "" {
1564 objectMap["mode"] = mcappp.Mode
1565 }
1566 if mcappp.OrchestratorVersion != nil {
1567 objectMap["orchestratorVersion"] = mcappp.OrchestratorVersion
1568 }
1569 if mcappp.UpgradeSettings != nil {
1570 objectMap["upgradeSettings"] = mcappp.UpgradeSettings
1571 }
1572 if mcappp.AvailabilityZones != nil {
1573 objectMap["availabilityZones"] = mcappp.AvailabilityZones
1574 }
1575 if mcappp.EnableNodePublicIP != nil {
1576 objectMap["enableNodePublicIP"] = mcappp.EnableNodePublicIP
1577 }
1578 if mcappp.NodePublicIPPrefixID != nil {
1579 objectMap["nodePublicIPPrefixID"] = mcappp.NodePublicIPPrefixID
1580 }
1581 if mcappp.ScaleSetPriority != "" {
1582 objectMap["scaleSetPriority"] = mcappp.ScaleSetPriority
1583 }
1584 if mcappp.ScaleSetEvictionPolicy != "" {
1585 objectMap["scaleSetEvictionPolicy"] = mcappp.ScaleSetEvictionPolicy
1586 }
1587 if mcappp.SpotMaxPrice != nil {
1588 objectMap["spotMaxPrice"] = mcappp.SpotMaxPrice
1589 }
1590 if mcappp.Tags != nil {
1591 objectMap["tags"] = mcappp.Tags
1592 }
1593 if mcappp.NodeLabels != nil {
1594 objectMap["nodeLabels"] = mcappp.NodeLabels
1595 }
1596 if mcappp.NodeTaints != nil {
1597 objectMap["nodeTaints"] = mcappp.NodeTaints
1598 }
1599 if mcappp.ProximityPlacementGroupID != nil {
1600 objectMap["proximityPlacementGroupID"] = mcappp.ProximityPlacementGroupID
1601 }
1602 if mcappp.KubeletConfig != nil {
1603 objectMap["kubeletConfig"] = mcappp.KubeletConfig
1604 }
1605 if mcappp.LinuxOSConfig != nil {
1606 objectMap["linuxOSConfig"] = mcappp.LinuxOSConfig
1607 }
1608 if mcappp.EnableEncryptionAtHost != nil {
1609 objectMap["enableEncryptionAtHost"] = mcappp.EnableEncryptionAtHost
1610 }
1611 if mcappp.EnableFIPS != nil {
1612 objectMap["enableFIPS"] = mcappp.EnableFIPS
1613 }
1614 if mcappp.GpuInstanceProfile != "" {
1615 objectMap["gpuInstanceProfile"] = mcappp.GpuInstanceProfile
1616 }
1617 return json.Marshal(objectMap)
1618 }
1619
1620
1621 type ManagedClusterAPIServerAccessProfile struct {
1622
1623 AuthorizedIPRanges *[]string `json:"authorizedIPRanges,omitempty"`
1624
1625 EnablePrivateCluster *bool `json:"enablePrivateCluster,omitempty"`
1626
1627 PrivateDNSZone *string `json:"privateDNSZone,omitempty"`
1628 }
1629
1630
1631 type ManagedClusterAutoUpgradeProfile struct {
1632
1633 UpgradeChannel UpgradeChannel `json:"upgradeChannel,omitempty"`
1634 }
1635
1636
1637 type ManagedClusterHTTPProxyConfig struct {
1638
1639 HTTPProxy *string `json:"httpProxy,omitempty"`
1640
1641 HTTPSProxy *string `json:"httpsProxy,omitempty"`
1642
1643 NoProxy *[]string `json:"noProxy,omitempty"`
1644
1645 TrustedCa *string `json:"trustedCa,omitempty"`
1646 }
1647
1648
1649 type ManagedClusterIdentity struct {
1650
1651 PrincipalID *string `json:"principalId,omitempty"`
1652
1653 TenantID *string `json:"tenantId,omitempty"`
1654
1655 Type ResourceIdentityType `json:"type,omitempty"`
1656
1657 UserAssignedIdentities map[string]*ManagedClusterIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
1658 }
1659
1660
1661 func (mci ManagedClusterIdentity) MarshalJSON() ([]byte, error) {
1662 objectMap := make(map[string]interface{})
1663 if mci.Type != "" {
1664 objectMap["type"] = mci.Type
1665 }
1666 if mci.UserAssignedIdentities != nil {
1667 objectMap["userAssignedIdentities"] = mci.UserAssignedIdentities
1668 }
1669 return json.Marshal(objectMap)
1670 }
1671
1672
1673 type ManagedClusterIdentityUserAssignedIdentitiesValue struct {
1674
1675 PrincipalID *string `json:"principalId,omitempty"`
1676
1677 ClientID *string `json:"clientId,omitempty"`
1678 }
1679
1680
1681 func (mciAiv ManagedClusterIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
1682 objectMap := make(map[string]interface{})
1683 return json.Marshal(objectMap)
1684 }
1685
1686
1687 type ManagedClusterListResult struct {
1688 autorest.Response `json:"-"`
1689
1690 Value *[]ManagedCluster `json:"value,omitempty"`
1691
1692 NextLink *string `json:"nextLink,omitempty"`
1693 }
1694
1695
1696 func (mclr ManagedClusterListResult) MarshalJSON() ([]byte, error) {
1697 objectMap := make(map[string]interface{})
1698 if mclr.Value != nil {
1699 objectMap["value"] = mclr.Value
1700 }
1701 return json.Marshal(objectMap)
1702 }
1703
1704
1705 type ManagedClusterListResultIterator struct {
1706 i int
1707 page ManagedClusterListResultPage
1708 }
1709
1710
1711
1712 func (iter *ManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) {
1713 if tracing.IsEnabled() {
1714 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultIterator.NextWithContext")
1715 defer func() {
1716 sc := -1
1717 if iter.Response().Response.Response != nil {
1718 sc = iter.Response().Response.Response.StatusCode
1719 }
1720 tracing.EndSpan(ctx, sc, err)
1721 }()
1722 }
1723 iter.i++
1724 if iter.i < len(iter.page.Values()) {
1725 return nil
1726 }
1727 err = iter.page.NextWithContext(ctx)
1728 if err != nil {
1729 iter.i--
1730 return err
1731 }
1732 iter.i = 0
1733 return nil
1734 }
1735
1736
1737
1738
1739 func (iter *ManagedClusterListResultIterator) Next() error {
1740 return iter.NextWithContext(context.Background())
1741 }
1742
1743
1744 func (iter ManagedClusterListResultIterator) NotDone() bool {
1745 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1746 }
1747
1748
1749 func (iter ManagedClusterListResultIterator) Response() ManagedClusterListResult {
1750 return iter.page.Response()
1751 }
1752
1753
1754
1755 func (iter ManagedClusterListResultIterator) Value() ManagedCluster {
1756 if !iter.page.NotDone() {
1757 return ManagedCluster{}
1758 }
1759 return iter.page.Values()[iter.i]
1760 }
1761
1762
1763 func NewManagedClusterListResultIterator(page ManagedClusterListResultPage) ManagedClusterListResultIterator {
1764 return ManagedClusterListResultIterator{page: page}
1765 }
1766
1767
1768 func (mclr ManagedClusterListResult) IsEmpty() bool {
1769 return mclr.Value == nil || len(*mclr.Value) == 0
1770 }
1771
1772
1773 func (mclr ManagedClusterListResult) hasNextLink() bool {
1774 return mclr.NextLink != nil && len(*mclr.NextLink) != 0
1775 }
1776
1777
1778
1779 func (mclr ManagedClusterListResult) managedClusterListResultPreparer(ctx context.Context) (*http.Request, error) {
1780 if !mclr.hasNextLink() {
1781 return nil, nil
1782 }
1783 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1784 autorest.AsJSON(),
1785 autorest.AsGet(),
1786 autorest.WithBaseURL(to.String(mclr.NextLink)))
1787 }
1788
1789
1790 type ManagedClusterListResultPage struct {
1791 fn func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)
1792 mclr ManagedClusterListResult
1793 }
1794
1795
1796
1797 func (page *ManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) {
1798 if tracing.IsEnabled() {
1799 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultPage.NextWithContext")
1800 defer func() {
1801 sc := -1
1802 if page.Response().Response.Response != nil {
1803 sc = page.Response().Response.Response.StatusCode
1804 }
1805 tracing.EndSpan(ctx, sc, err)
1806 }()
1807 }
1808 for {
1809 next, err := page.fn(ctx, page.mclr)
1810 if err != nil {
1811 return err
1812 }
1813 page.mclr = next
1814 if !next.hasNextLink() || !next.IsEmpty() {
1815 break
1816 }
1817 }
1818 return nil
1819 }
1820
1821
1822
1823
1824 func (page *ManagedClusterListResultPage) Next() error {
1825 return page.NextWithContext(context.Background())
1826 }
1827
1828
1829 func (page ManagedClusterListResultPage) NotDone() bool {
1830 return !page.mclr.IsEmpty()
1831 }
1832
1833
1834 func (page ManagedClusterListResultPage) Response() ManagedClusterListResult {
1835 return page.mclr
1836 }
1837
1838
1839 func (page ManagedClusterListResultPage) Values() []ManagedCluster {
1840 if page.mclr.IsEmpty() {
1841 return nil
1842 }
1843 return *page.mclr.Value
1844 }
1845
1846
1847 func NewManagedClusterListResultPage(cur ManagedClusterListResult, getNextPage func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)) ManagedClusterListResultPage {
1848 return ManagedClusterListResultPage{
1849 fn: getNextPage,
1850 mclr: cur,
1851 }
1852 }
1853
1854
1855 type ManagedClusterLoadBalancerProfile struct {
1856
1857 ManagedOutboundIPs *ManagedClusterLoadBalancerProfileManagedOutboundIPs `json:"managedOutboundIPs,omitempty"`
1858
1859 OutboundIPPrefixes *ManagedClusterLoadBalancerProfileOutboundIPPrefixes `json:"outboundIPPrefixes,omitempty"`
1860
1861 OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"`
1862
1863 EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"`
1864
1865 AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"`
1866
1867 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
1868 }
1869
1870
1871
1872 type ManagedClusterLoadBalancerProfileManagedOutboundIPs struct {
1873
1874 Count *int32 `json:"count,omitempty"`
1875 }
1876
1877
1878
1879 type ManagedClusterLoadBalancerProfileOutboundIPPrefixes struct {
1880
1881 PublicIPPrefixes *[]ResourceReference `json:"publicIPPrefixes,omitempty"`
1882 }
1883
1884
1885
1886 type ManagedClusterLoadBalancerProfileOutboundIPs struct {
1887
1888 PublicIPs *[]ResourceReference `json:"publicIPs,omitempty"`
1889 }
1890
1891
1892 type ManagedClusterPodIdentity struct {
1893
1894 Name *string `json:"name,omitempty"`
1895
1896 Namespace *string `json:"namespace,omitempty"`
1897
1898 BindingSelector *string `json:"bindingSelector,omitempty"`
1899
1900 Identity *UserAssignedIdentity `json:"identity,omitempty"`
1901
1902 ProvisioningState ManagedClusterPodIdentityProvisioningState `json:"provisioningState,omitempty"`
1903
1904 ProvisioningInfo *ManagedClusterPodIdentityProvisioningInfo `json:"provisioningInfo,omitempty"`
1905 }
1906
1907
1908 func (mcpi ManagedClusterPodIdentity) MarshalJSON() ([]byte, error) {
1909 objectMap := make(map[string]interface{})
1910 if mcpi.Name != nil {
1911 objectMap["name"] = mcpi.Name
1912 }
1913 if mcpi.Namespace != nil {
1914 objectMap["namespace"] = mcpi.Namespace
1915 }
1916 if mcpi.BindingSelector != nil {
1917 objectMap["bindingSelector"] = mcpi.BindingSelector
1918 }
1919 if mcpi.Identity != nil {
1920 objectMap["identity"] = mcpi.Identity
1921 }
1922 return json.Marshal(objectMap)
1923 }
1924
1925
1926 type ManagedClusterPodIdentityException struct {
1927
1928 Name *string `json:"name,omitempty"`
1929
1930 Namespace *string `json:"namespace,omitempty"`
1931
1932 PodLabels map[string]*string `json:"podLabels"`
1933 }
1934
1935
1936 func (mcpie ManagedClusterPodIdentityException) MarshalJSON() ([]byte, error) {
1937 objectMap := make(map[string]interface{})
1938 if mcpie.Name != nil {
1939 objectMap["name"] = mcpie.Name
1940 }
1941 if mcpie.Namespace != nil {
1942 objectMap["namespace"] = mcpie.Namespace
1943 }
1944 if mcpie.PodLabels != nil {
1945 objectMap["podLabels"] = mcpie.PodLabels
1946 }
1947 return json.Marshal(objectMap)
1948 }
1949
1950
1951 type ManagedClusterPodIdentityProfile struct {
1952
1953 Enabled *bool `json:"enabled,omitempty"`
1954
1955 AllowNetworkPluginKubenet *bool `json:"allowNetworkPluginKubenet,omitempty"`
1956
1957 UserAssignedIdentities *[]ManagedClusterPodIdentity `json:"userAssignedIdentities,omitempty"`
1958
1959 UserAssignedIdentityExceptions *[]ManagedClusterPodIdentityException `json:"userAssignedIdentityExceptions,omitempty"`
1960 }
1961
1962
1963 type ManagedClusterPodIdentityProvisioningInfo struct {
1964
1965 Error *CloudError `json:"error,omitempty"`
1966 }
1967
1968
1969 type ManagedClusterPoolUpgradeProfile struct {
1970
1971 KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
1972
1973 Name *string `json:"name,omitempty"`
1974
1975 OsType OSType `json:"osType,omitempty"`
1976
1977 Upgrades *[]ManagedClusterPoolUpgradeProfileUpgradesItem `json:"upgrades,omitempty"`
1978 }
1979
1980
1981 type ManagedClusterPoolUpgradeProfileUpgradesItem struct {
1982
1983 KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
1984
1985 IsPreview *bool `json:"isPreview,omitempty"`
1986 }
1987
1988
1989 type ManagedClusterProperties struct {
1990
1991 ProvisioningState *string `json:"provisioningState,omitempty"`
1992
1993 PowerState *PowerState `json:"powerState,omitempty"`
1994
1995 MaxAgentPools *int32 `json:"maxAgentPools,omitempty"`
1996
1997 KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
1998
1999 DNSPrefix *string `json:"dnsPrefix,omitempty"`
2000
2001 FqdnSubdomain *string `json:"fqdnSubdomain,omitempty"`
2002
2003 Fqdn *string `json:"fqdn,omitempty"`
2004
2005 PrivateFQDN *string `json:"privateFQDN,omitempty"`
2006
2007 AzurePortalFQDN *string `json:"azurePortalFQDN,omitempty"`
2008
2009 AgentPoolProfiles *[]ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"`
2010
2011 LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"`
2012
2013 WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"`
2014
2015 ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"`
2016
2017 AddonProfiles map[string]*ManagedClusterAddonProfile `json:"addonProfiles"`
2018
2019 PodIdentityProfile *ManagedClusterPodIdentityProfile `json:"podIdentityProfile,omitempty"`
2020
2021 NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"`
2022
2023 EnableRBAC *bool `json:"enableRBAC,omitempty"`
2024
2025 EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"`
2026
2027 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"`
2028
2029 AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"`
2030
2031 AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile `json:"autoUpgradeProfile,omitempty"`
2032
2033 AutoScalerProfile *ManagedClusterPropertiesAutoScalerProfile `json:"autoScalerProfile,omitempty"`
2034
2035 APIServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"`
2036
2037 DiskEncryptionSetID *string `json:"diskEncryptionSetID,omitempty"`
2038
2039 IdentityProfile map[string]*ManagedClusterPropertiesIdentityProfileValue `json:"identityProfile"`
2040
2041 PrivateLinkResources *[]PrivateLinkResource `json:"privateLinkResources,omitempty"`
2042
2043 DisableLocalAccounts *bool `json:"disableLocalAccounts,omitempty"`
2044
2045 HTTPProxyConfig *ManagedClusterHTTPProxyConfig `json:"httpProxyConfig,omitempty"`
2046 }
2047
2048
2049 func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) {
2050 objectMap := make(map[string]interface{})
2051 if mcp.KubernetesVersion != nil {
2052 objectMap["kubernetesVersion"] = mcp.KubernetesVersion
2053 }
2054 if mcp.DNSPrefix != nil {
2055 objectMap["dnsPrefix"] = mcp.DNSPrefix
2056 }
2057 if mcp.FqdnSubdomain != nil {
2058 objectMap["fqdnSubdomain"] = mcp.FqdnSubdomain
2059 }
2060 if mcp.AgentPoolProfiles != nil {
2061 objectMap["agentPoolProfiles"] = mcp.AgentPoolProfiles
2062 }
2063 if mcp.LinuxProfile != nil {
2064 objectMap["linuxProfile"] = mcp.LinuxProfile
2065 }
2066 if mcp.WindowsProfile != nil {
2067 objectMap["windowsProfile"] = mcp.WindowsProfile
2068 }
2069 if mcp.ServicePrincipalProfile != nil {
2070 objectMap["servicePrincipalProfile"] = mcp.ServicePrincipalProfile
2071 }
2072 if mcp.AddonProfiles != nil {
2073 objectMap["addonProfiles"] = mcp.AddonProfiles
2074 }
2075 if mcp.PodIdentityProfile != nil {
2076 objectMap["podIdentityProfile"] = mcp.PodIdentityProfile
2077 }
2078 if mcp.NodeResourceGroup != nil {
2079 objectMap["nodeResourceGroup"] = mcp.NodeResourceGroup
2080 }
2081 if mcp.EnableRBAC != nil {
2082 objectMap["enableRBAC"] = mcp.EnableRBAC
2083 }
2084 if mcp.EnablePodSecurityPolicy != nil {
2085 objectMap["enablePodSecurityPolicy"] = mcp.EnablePodSecurityPolicy
2086 }
2087 if mcp.NetworkProfile != nil {
2088 objectMap["networkProfile"] = mcp.NetworkProfile
2089 }
2090 if mcp.AadProfile != nil {
2091 objectMap["aadProfile"] = mcp.AadProfile
2092 }
2093 if mcp.AutoUpgradeProfile != nil {
2094 objectMap["autoUpgradeProfile"] = mcp.AutoUpgradeProfile
2095 }
2096 if mcp.AutoScalerProfile != nil {
2097 objectMap["autoScalerProfile"] = mcp.AutoScalerProfile
2098 }
2099 if mcp.APIServerAccessProfile != nil {
2100 objectMap["apiServerAccessProfile"] = mcp.APIServerAccessProfile
2101 }
2102 if mcp.DiskEncryptionSetID != nil {
2103 objectMap["diskEncryptionSetID"] = mcp.DiskEncryptionSetID
2104 }
2105 if mcp.IdentityProfile != nil {
2106 objectMap["identityProfile"] = mcp.IdentityProfile
2107 }
2108 if mcp.PrivateLinkResources != nil {
2109 objectMap["privateLinkResources"] = mcp.PrivateLinkResources
2110 }
2111 if mcp.DisableLocalAccounts != nil {
2112 objectMap["disableLocalAccounts"] = mcp.DisableLocalAccounts
2113 }
2114 if mcp.HTTPProxyConfig != nil {
2115 objectMap["httpProxyConfig"] = mcp.HTTPProxyConfig
2116 }
2117 return json.Marshal(objectMap)
2118 }
2119
2120
2121
2122 type ManagedClusterPropertiesAutoScalerProfile struct {
2123 BalanceSimilarNodeGroups *string `json:"balance-similar-node-groups,omitempty"`
2124
2125 Expander Expander `json:"expander,omitempty"`
2126 MaxEmptyBulkDelete *string `json:"max-empty-bulk-delete,omitempty"`
2127 MaxGracefulTerminationSec *string `json:"max-graceful-termination-sec,omitempty"`
2128 MaxNodeProvisionTime *string `json:"max-node-provision-time,omitempty"`
2129 MaxTotalUnreadyPercentage *string `json:"max-total-unready-percentage,omitempty"`
2130 NewPodScaleUpDelay *string `json:"new-pod-scale-up-delay,omitempty"`
2131 OkTotalUnreadyCount *string `json:"ok-total-unready-count,omitempty"`
2132 ScanInterval *string `json:"scan-interval,omitempty"`
2133 ScaleDownDelayAfterAdd *string `json:"scale-down-delay-after-add,omitempty"`
2134 ScaleDownDelayAfterDelete *string `json:"scale-down-delay-after-delete,omitempty"`
2135 ScaleDownDelayAfterFailure *string `json:"scale-down-delay-after-failure,omitempty"`
2136 ScaleDownUnneededTime *string `json:"scale-down-unneeded-time,omitempty"`
2137 ScaleDownUnreadyTime *string `json:"scale-down-unready-time,omitempty"`
2138 ScaleDownUtilizationThreshold *string `json:"scale-down-utilization-threshold,omitempty"`
2139 SkipNodesWithLocalStorage *string `json:"skip-nodes-with-local-storage,omitempty"`
2140 SkipNodesWithSystemPods *string `json:"skip-nodes-with-system-pods,omitempty"`
2141 }
2142
2143
2144 type ManagedClusterPropertiesIdentityProfileValue struct {
2145
2146 ResourceID *string `json:"resourceId,omitempty"`
2147
2148 ClientID *string `json:"clientId,omitempty"`
2149
2150 ObjectID *string `json:"objectId,omitempty"`
2151 }
2152
2153
2154
2155 type ManagedClustersCreateOrUpdateFuture struct {
2156 azure.FutureAPI
2157
2158
2159 Result func(ManagedClustersClient) (ManagedCluster, error)
2160 }
2161
2162
2163 func (future *ManagedClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2164 var azFuture azure.Future
2165 if err := json.Unmarshal(body, &azFuture); err != nil {
2166 return err
2167 }
2168 future.FutureAPI = &azFuture
2169 future.Result = future.result
2170 return nil
2171 }
2172
2173
2174 func (future *ManagedClustersCreateOrUpdateFuture) result(client ManagedClustersClient) (mc ManagedCluster, err error) {
2175 var done bool
2176 done, err = future.DoneWithContext(context.Background(), client)
2177 if err != nil {
2178 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2179 return
2180 }
2181 if !done {
2182 mc.Response.Response = future.Response()
2183 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture")
2184 return
2185 }
2186 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2187 if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent {
2188 mc, err = client.CreateOrUpdateResponder(mc.Response.Response)
2189 if err != nil {
2190 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", mc.Response.Response, "Failure responding to request")
2191 }
2192 }
2193 return
2194 }
2195
2196
2197
2198 type ManagedClustersDeleteFuture struct {
2199 azure.FutureAPI
2200
2201
2202 Result func(ManagedClustersClient) (autorest.Response, error)
2203 }
2204
2205
2206 func (future *ManagedClustersDeleteFuture) UnmarshalJSON(body []byte) error {
2207 var azFuture azure.Future
2208 if err := json.Unmarshal(body, &azFuture); err != nil {
2209 return err
2210 }
2211 future.FutureAPI = &azFuture
2212 future.Result = future.result
2213 return nil
2214 }
2215
2216
2217 func (future *ManagedClustersDeleteFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) {
2218 var done bool
2219 done, err = future.DoneWithContext(context.Background(), client)
2220 if err != nil {
2221 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure")
2222 return
2223 }
2224 if !done {
2225 ar.Response = future.Response()
2226 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture")
2227 return
2228 }
2229 ar.Response = future.Response()
2230 return
2231 }
2232
2233
2234
2235 type ManagedClusterServicePrincipalProfile struct {
2236
2237 ClientID *string `json:"clientId,omitempty"`
2238
2239 Secret *string `json:"secret,omitempty"`
2240 }
2241
2242
2243 type ManagedClusterSKU struct {
2244
2245 Name ManagedClusterSKUName `json:"name,omitempty"`
2246
2247 Tier ManagedClusterSKUTier `json:"tier,omitempty"`
2248 }
2249
2250
2251
2252 type ManagedClustersResetAADProfileFuture struct {
2253 azure.FutureAPI
2254
2255
2256 Result func(ManagedClustersClient) (autorest.Response, error)
2257 }
2258
2259
2260 func (future *ManagedClustersResetAADProfileFuture) UnmarshalJSON(body []byte) error {
2261 var azFuture azure.Future
2262 if err := json.Unmarshal(body, &azFuture); err != nil {
2263 return err
2264 }
2265 future.FutureAPI = &azFuture
2266 future.Result = future.result
2267 return nil
2268 }
2269
2270
2271 func (future *ManagedClustersResetAADProfileFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) {
2272 var done bool
2273 done, err = future.DoneWithContext(context.Background(), client)
2274 if err != nil {
2275 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetAADProfileFuture", "Result", future.Response(), "Polling failure")
2276 return
2277 }
2278 if !done {
2279 ar.Response = future.Response()
2280 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetAADProfileFuture")
2281 return
2282 }
2283 ar.Response = future.Response()
2284 return
2285 }
2286
2287
2288
2289 type ManagedClustersResetServicePrincipalProfileFuture struct {
2290 azure.FutureAPI
2291
2292
2293 Result func(ManagedClustersClient) (autorest.Response, error)
2294 }
2295
2296
2297 func (future *ManagedClustersResetServicePrincipalProfileFuture) UnmarshalJSON(body []byte) error {
2298 var azFuture azure.Future
2299 if err := json.Unmarshal(body, &azFuture); err != nil {
2300 return err
2301 }
2302 future.FutureAPI = &azFuture
2303 future.Result = future.result
2304 return nil
2305 }
2306
2307
2308 func (future *ManagedClustersResetServicePrincipalProfileFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) {
2309 var done bool
2310 done, err = future.DoneWithContext(context.Background(), client)
2311 if err != nil {
2312 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetServicePrincipalProfileFuture", "Result", future.Response(), "Polling failure")
2313 return
2314 }
2315 if !done {
2316 ar.Response = future.Response()
2317 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetServicePrincipalProfileFuture")
2318 return
2319 }
2320 ar.Response = future.Response()
2321 return
2322 }
2323
2324
2325
2326 type ManagedClustersRotateClusterCertificatesFuture struct {
2327 azure.FutureAPI
2328
2329
2330 Result func(ManagedClustersClient) (autorest.Response, error)
2331 }
2332
2333
2334 func (future *ManagedClustersRotateClusterCertificatesFuture) UnmarshalJSON(body []byte) error {
2335 var azFuture azure.Future
2336 if err := json.Unmarshal(body, &azFuture); err != nil {
2337 return err
2338 }
2339 future.FutureAPI = &azFuture
2340 future.Result = future.result
2341 return nil
2342 }
2343
2344
2345 func (future *ManagedClustersRotateClusterCertificatesFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) {
2346 var done bool
2347 done, err = future.DoneWithContext(context.Background(), client)
2348 if err != nil {
2349 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRotateClusterCertificatesFuture", "Result", future.Response(), "Polling failure")
2350 return
2351 }
2352 if !done {
2353 ar.Response = future.Response()
2354 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRotateClusterCertificatesFuture")
2355 return
2356 }
2357 ar.Response = future.Response()
2358 return
2359 }
2360
2361
2362
2363 type ManagedClustersRunCommandFuture struct {
2364 azure.FutureAPI
2365
2366
2367 Result func(ManagedClustersClient) (RunCommandResult, error)
2368 }
2369
2370
2371 func (future *ManagedClustersRunCommandFuture) UnmarshalJSON(body []byte) error {
2372 var azFuture azure.Future
2373 if err := json.Unmarshal(body, &azFuture); err != nil {
2374 return err
2375 }
2376 future.FutureAPI = &azFuture
2377 future.Result = future.result
2378 return nil
2379 }
2380
2381
2382 func (future *ManagedClustersRunCommandFuture) result(client ManagedClustersClient) (rcr RunCommandResult, err error) {
2383 var done bool
2384 done, err = future.DoneWithContext(context.Background(), client)
2385 if err != nil {
2386 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRunCommandFuture", "Result", future.Response(), "Polling failure")
2387 return
2388 }
2389 if !done {
2390 rcr.Response.Response = future.Response()
2391 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRunCommandFuture")
2392 return
2393 }
2394 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2395 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent {
2396 rcr, err = client.RunCommandResponder(rcr.Response.Response)
2397 if err != nil {
2398 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request")
2399 }
2400 }
2401 return
2402 }
2403
2404
2405
2406 type ManagedClustersStartFuture struct {
2407 azure.FutureAPI
2408
2409
2410 Result func(ManagedClustersClient) (autorest.Response, error)
2411 }
2412
2413
2414 func (future *ManagedClustersStartFuture) UnmarshalJSON(body []byte) error {
2415 var azFuture azure.Future
2416 if err := json.Unmarshal(body, &azFuture); err != nil {
2417 return err
2418 }
2419 future.FutureAPI = &azFuture
2420 future.Result = future.result
2421 return nil
2422 }
2423
2424
2425 func (future *ManagedClustersStartFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) {
2426 var done bool
2427 done, err = future.DoneWithContext(context.Background(), client)
2428 if err != nil {
2429 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersStartFuture", "Result", future.Response(), "Polling failure")
2430 return
2431 }
2432 if !done {
2433 ar.Response = future.Response()
2434 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersStartFuture")
2435 return
2436 }
2437 ar.Response = future.Response()
2438 return
2439 }
2440
2441
2442
2443 type ManagedClustersStopFuture struct {
2444 azure.FutureAPI
2445
2446
2447 Result func(ManagedClustersClient) (autorest.Response, error)
2448 }
2449
2450
2451 func (future *ManagedClustersStopFuture) UnmarshalJSON(body []byte) error {
2452 var azFuture azure.Future
2453 if err := json.Unmarshal(body, &azFuture); err != nil {
2454 return err
2455 }
2456 future.FutureAPI = &azFuture
2457 future.Result = future.result
2458 return nil
2459 }
2460
2461
2462 func (future *ManagedClustersStopFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) {
2463 var done bool
2464 done, err = future.DoneWithContext(context.Background(), client)
2465 if err != nil {
2466 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersStopFuture", "Result", future.Response(), "Polling failure")
2467 return
2468 }
2469 if !done {
2470 ar.Response = future.Response()
2471 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersStopFuture")
2472 return
2473 }
2474 ar.Response = future.Response()
2475 return
2476 }
2477
2478
2479
2480 type ManagedClustersUpdateTagsFuture struct {
2481 azure.FutureAPI
2482
2483
2484 Result func(ManagedClustersClient) (ManagedCluster, error)
2485 }
2486
2487
2488 func (future *ManagedClustersUpdateTagsFuture) UnmarshalJSON(body []byte) error {
2489 var azFuture azure.Future
2490 if err := json.Unmarshal(body, &azFuture); err != nil {
2491 return err
2492 }
2493 future.FutureAPI = &azFuture
2494 future.Result = future.result
2495 return nil
2496 }
2497
2498
2499 func (future *ManagedClustersUpdateTagsFuture) result(client ManagedClustersClient) (mc ManagedCluster, err error) {
2500 var done bool
2501 done, err = future.DoneWithContext(context.Background(), client)
2502 if err != nil {
2503 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure")
2504 return
2505 }
2506 if !done {
2507 mc.Response.Response = future.Response()
2508 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersUpdateTagsFuture")
2509 return
2510 }
2511 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2512 if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent {
2513 mc, err = client.UpdateTagsResponder(mc.Response.Response)
2514 if err != nil {
2515 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", mc.Response.Response, "Failure responding to request")
2516 }
2517 }
2518 return
2519 }
2520
2521
2522 type ManagedClusterUpgradeProfile struct {
2523 autorest.Response `json:"-"`
2524
2525 ID *string `json:"id,omitempty"`
2526
2527 Name *string `json:"name,omitempty"`
2528
2529 Type *string `json:"type,omitempty"`
2530
2531 *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"`
2532 }
2533
2534
2535 func (mcup ManagedClusterUpgradeProfile) MarshalJSON() ([]byte, error) {
2536 objectMap := make(map[string]interface{})
2537 if mcup.ManagedClusterUpgradeProfileProperties != nil {
2538 objectMap["properties"] = mcup.ManagedClusterUpgradeProfileProperties
2539 }
2540 return json.Marshal(objectMap)
2541 }
2542
2543
2544 func (mcup *ManagedClusterUpgradeProfile) UnmarshalJSON(body []byte) error {
2545 var m map[string]*json.RawMessage
2546 err := json.Unmarshal(body, &m)
2547 if err != nil {
2548 return err
2549 }
2550 for k, v := range m {
2551 switch k {
2552 case "id":
2553 if v != nil {
2554 var ID string
2555 err = json.Unmarshal(*v, &ID)
2556 if err != nil {
2557 return err
2558 }
2559 mcup.ID = &ID
2560 }
2561 case "name":
2562 if v != nil {
2563 var name string
2564 err = json.Unmarshal(*v, &name)
2565 if err != nil {
2566 return err
2567 }
2568 mcup.Name = &name
2569 }
2570 case "type":
2571 if v != nil {
2572 var typeVar string
2573 err = json.Unmarshal(*v, &typeVar)
2574 if err != nil {
2575 return err
2576 }
2577 mcup.Type = &typeVar
2578 }
2579 case "properties":
2580 if v != nil {
2581 var managedClusterUpgradeProfileProperties ManagedClusterUpgradeProfileProperties
2582 err = json.Unmarshal(*v, &managedClusterUpgradeProfileProperties)
2583 if err != nil {
2584 return err
2585 }
2586 mcup.ManagedClusterUpgradeProfileProperties = &managedClusterUpgradeProfileProperties
2587 }
2588 }
2589 }
2590
2591 return nil
2592 }
2593
2594
2595 type ManagedClusterUpgradeProfileProperties struct {
2596
2597 ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"`
2598
2599 AgentPoolProfiles *[]ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"`
2600 }
2601
2602
2603 type ManagedClusterWindowsProfile struct {
2604
2605 AdminUsername *string `json:"adminUsername,omitempty"`
2606
2607 AdminPassword *string `json:"adminPassword,omitempty"`
2608
2609 LicenseType LicenseType `json:"licenseType,omitempty"`
2610
2611 EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"`
2612 }
2613
2614
2615 type MasterProfile struct {
2616
2617 Count *int32 `json:"count,omitempty"`
2618
2619 DNSPrefix *string `json:"dnsPrefix,omitempty"`
2620
2621 VMSize VMSizeTypes `json:"vmSize,omitempty"`
2622
2623 OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"`
2624
2625 VnetSubnetID *string `json:"vnetSubnetID,omitempty"`
2626
2627 FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"`
2628
2629 StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"`
2630
2631 Fqdn *string `json:"fqdn,omitempty"`
2632 }
2633
2634
2635 func (mp MasterProfile) MarshalJSON() ([]byte, error) {
2636 objectMap := make(map[string]interface{})
2637 if mp.Count != nil {
2638 objectMap["count"] = mp.Count
2639 }
2640 if mp.DNSPrefix != nil {
2641 objectMap["dnsPrefix"] = mp.DNSPrefix
2642 }
2643 if mp.VMSize != "" {
2644 objectMap["vmSize"] = mp.VMSize
2645 }
2646 if mp.OsDiskSizeGB != nil {
2647 objectMap["osDiskSizeGB"] = mp.OsDiskSizeGB
2648 }
2649 if mp.VnetSubnetID != nil {
2650 objectMap["vnetSubnetID"] = mp.VnetSubnetID
2651 }
2652 if mp.FirstConsecutiveStaticIP != nil {
2653 objectMap["firstConsecutiveStaticIP"] = mp.FirstConsecutiveStaticIP
2654 }
2655 if mp.StorageProfile != "" {
2656 objectMap["storageProfile"] = mp.StorageProfile
2657 }
2658 return json.Marshal(objectMap)
2659 }
2660
2661
2662 type NetworkProfile struct {
2663
2664 NetworkPlugin NetworkPlugin `json:"networkPlugin,omitempty"`
2665
2666 NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"`
2667
2668 NetworkMode NetworkMode `json:"networkMode,omitempty"`
2669
2670 PodCidr *string `json:"podCidr,omitempty"`
2671
2672 ServiceCidr *string `json:"serviceCidr,omitempty"`
2673
2674 DNSServiceIP *string `json:"dnsServiceIP,omitempty"`
2675
2676 DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"`
2677
2678 OutboundType OutboundType `json:"outboundType,omitempty"`
2679
2680 LoadBalancerSku LoadBalancerSku `json:"loadBalancerSku,omitempty"`
2681
2682 LoadBalancerProfile *ManagedClusterLoadBalancerProfile `json:"loadBalancerProfile,omitempty"`
2683 }
2684
2685
2686 type OperationListResult struct {
2687 autorest.Response `json:"-"`
2688
2689 Value *[]OperationValue `json:"value,omitempty"`
2690 }
2691
2692
2693 func (olr OperationListResult) MarshalJSON() ([]byte, error) {
2694 objectMap := make(map[string]interface{})
2695 return json.Marshal(objectMap)
2696 }
2697
2698
2699 type OperationValue struct {
2700
2701 Origin *string `json:"origin,omitempty"`
2702
2703 Name *string `json:"name,omitempty"`
2704
2705 *OperationValueDisplay `json:"display,omitempty"`
2706 }
2707
2708
2709 func (ov OperationValue) MarshalJSON() ([]byte, error) {
2710 objectMap := make(map[string]interface{})
2711 if ov.OperationValueDisplay != nil {
2712 objectMap["display"] = ov.OperationValueDisplay
2713 }
2714 return json.Marshal(objectMap)
2715 }
2716
2717
2718 func (ov *OperationValue) UnmarshalJSON(body []byte) error {
2719 var m map[string]*json.RawMessage
2720 err := json.Unmarshal(body, &m)
2721 if err != nil {
2722 return err
2723 }
2724 for k, v := range m {
2725 switch k {
2726 case "origin":
2727 if v != nil {
2728 var origin string
2729 err = json.Unmarshal(*v, &origin)
2730 if err != nil {
2731 return err
2732 }
2733 ov.Origin = &origin
2734 }
2735 case "name":
2736 if v != nil {
2737 var name string
2738 err = json.Unmarshal(*v, &name)
2739 if err != nil {
2740 return err
2741 }
2742 ov.Name = &name
2743 }
2744 case "display":
2745 if v != nil {
2746 var operationValueDisplay OperationValueDisplay
2747 err = json.Unmarshal(*v, &operationValueDisplay)
2748 if err != nil {
2749 return err
2750 }
2751 ov.OperationValueDisplay = &operationValueDisplay
2752 }
2753 }
2754 }
2755
2756 return nil
2757 }
2758
2759
2760 type OperationValueDisplay struct {
2761
2762 Operation *string `json:"operation,omitempty"`
2763
2764 Resource *string `json:"resource,omitempty"`
2765
2766 Description *string `json:"description,omitempty"`
2767
2768 Provider *string `json:"provider,omitempty"`
2769 }
2770
2771
2772 func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) {
2773 objectMap := make(map[string]interface{})
2774 return json.Marshal(objectMap)
2775 }
2776
2777
2778 type OSOptionProfile struct {
2779 autorest.Response `json:"-"`
2780
2781 ID *string `json:"id,omitempty"`
2782
2783 Name *string `json:"name,omitempty"`
2784
2785 Type *string `json:"type,omitempty"`
2786
2787 *OSOptionPropertyList `json:"properties,omitempty"`
2788 }
2789
2790
2791 func (oop OSOptionProfile) MarshalJSON() ([]byte, error) {
2792 objectMap := make(map[string]interface{})
2793 if oop.OSOptionPropertyList != nil {
2794 objectMap["properties"] = oop.OSOptionPropertyList
2795 }
2796 return json.Marshal(objectMap)
2797 }
2798
2799
2800 func (oop *OSOptionProfile) UnmarshalJSON(body []byte) error {
2801 var m map[string]*json.RawMessage
2802 err := json.Unmarshal(body, &m)
2803 if err != nil {
2804 return err
2805 }
2806 for k, v := range m {
2807 switch k {
2808 case "id":
2809 if v != nil {
2810 var ID string
2811 err = json.Unmarshal(*v, &ID)
2812 if err != nil {
2813 return err
2814 }
2815 oop.ID = &ID
2816 }
2817 case "name":
2818 if v != nil {
2819 var name string
2820 err = json.Unmarshal(*v, &name)
2821 if err != nil {
2822 return err
2823 }
2824 oop.Name = &name
2825 }
2826 case "type":
2827 if v != nil {
2828 var typeVar string
2829 err = json.Unmarshal(*v, &typeVar)
2830 if err != nil {
2831 return err
2832 }
2833 oop.Type = &typeVar
2834 }
2835 case "properties":
2836 if v != nil {
2837 var oSOptionPropertyList OSOptionPropertyList
2838 err = json.Unmarshal(*v, &oSOptionPropertyList)
2839 if err != nil {
2840 return err
2841 }
2842 oop.OSOptionPropertyList = &oSOptionPropertyList
2843 }
2844 }
2845 }
2846
2847 return nil
2848 }
2849
2850
2851 type OSOptionProperty struct {
2852
2853 OsType *string `json:"os-type,omitempty"`
2854
2855 EnableFipsImage *bool `json:"enable-fips-image,omitempty"`
2856 }
2857
2858
2859 type OSOptionPropertyList struct {
2860
2861 OsOptionPropertyList *[]OSOptionProperty `json:"osOptionPropertyList,omitempty"`
2862 }
2863
2864
2865 type PowerState struct {
2866
2867 Code Code `json:"code,omitempty"`
2868 }
2869
2870
2871 type PrivateEndpoint struct {
2872
2873 ID *string `json:"id,omitempty"`
2874 }
2875
2876
2877 type PrivateEndpointConnection struct {
2878 autorest.Response `json:"-"`
2879
2880 ID *string `json:"id,omitempty"`
2881
2882 Name *string `json:"name,omitempty"`
2883
2884 Type *string `json:"type,omitempty"`
2885
2886 *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
2887 }
2888
2889
2890 func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
2891 objectMap := make(map[string]interface{})
2892 if pec.PrivateEndpointConnectionProperties != nil {
2893 objectMap["properties"] = pec.PrivateEndpointConnectionProperties
2894 }
2895 return json.Marshal(objectMap)
2896 }
2897
2898
2899 func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
2900 var m map[string]*json.RawMessage
2901 err := json.Unmarshal(body, &m)
2902 if err != nil {
2903 return err
2904 }
2905 for k, v := range m {
2906 switch k {
2907 case "id":
2908 if v != nil {
2909 var ID string
2910 err = json.Unmarshal(*v, &ID)
2911 if err != nil {
2912 return err
2913 }
2914 pec.ID = &ID
2915 }
2916 case "name":
2917 if v != nil {
2918 var name string
2919 err = json.Unmarshal(*v, &name)
2920 if err != nil {
2921 return err
2922 }
2923 pec.Name = &name
2924 }
2925 case "type":
2926 if v != nil {
2927 var typeVar string
2928 err = json.Unmarshal(*v, &typeVar)
2929 if err != nil {
2930 return err
2931 }
2932 pec.Type = &typeVar
2933 }
2934 case "properties":
2935 if v != nil {
2936 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
2937 err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
2938 if err != nil {
2939 return err
2940 }
2941 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
2942 }
2943 }
2944 }
2945
2946 return nil
2947 }
2948
2949
2950 type PrivateEndpointConnectionListResult struct {
2951 autorest.Response `json:"-"`
2952
2953 Value *[]PrivateEndpointConnection `json:"value,omitempty"`
2954 }
2955
2956
2957 type PrivateEndpointConnectionProperties struct {
2958
2959 ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
2960
2961 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
2962
2963 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
2964 }
2965
2966
2967 func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
2968 objectMap := make(map[string]interface{})
2969 if pecp.PrivateEndpoint != nil {
2970 objectMap["privateEndpoint"] = pecp.PrivateEndpoint
2971 }
2972 if pecp.PrivateLinkServiceConnectionState != nil {
2973 objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
2974 }
2975 return json.Marshal(objectMap)
2976 }
2977
2978
2979
2980 type PrivateEndpointConnectionsDeleteFuture struct {
2981 azure.FutureAPI
2982
2983
2984 Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
2985 }
2986
2987
2988 func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
2989 var azFuture azure.Future
2990 if err := json.Unmarshal(body, &azFuture); err != nil {
2991 return err
2992 }
2993 future.FutureAPI = &azFuture
2994 future.Result = future.result
2995 return nil
2996 }
2997
2998
2999 func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
3000 var done bool
3001 done, err = future.DoneWithContext(context.Background(), client)
3002 if err != nil {
3003 err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
3004 return
3005 }
3006 if !done {
3007 ar.Response = future.Response()
3008 err = azure.NewAsyncOpIncompleteError("containerservice.PrivateEndpointConnectionsDeleteFuture")
3009 return
3010 }
3011 ar.Response = future.Response()
3012 return
3013 }
3014
3015
3016 type PrivateLinkResource struct {
3017 autorest.Response `json:"-"`
3018
3019 ID *string `json:"id,omitempty"`
3020
3021 Name *string `json:"name,omitempty"`
3022
3023 Type *string `json:"type,omitempty"`
3024
3025 GroupID *string `json:"groupId,omitempty"`
3026
3027 RequiredMembers *[]string `json:"requiredMembers,omitempty"`
3028
3029 PrivateLinkServiceID *string `json:"privateLinkServiceID,omitempty"`
3030 }
3031
3032
3033 func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
3034 objectMap := make(map[string]interface{})
3035 if plr.ID != nil {
3036 objectMap["id"] = plr.ID
3037 }
3038 if plr.Name != nil {
3039 objectMap["name"] = plr.Name
3040 }
3041 if plr.Type != nil {
3042 objectMap["type"] = plr.Type
3043 }
3044 if plr.GroupID != nil {
3045 objectMap["groupId"] = plr.GroupID
3046 }
3047 if plr.RequiredMembers != nil {
3048 objectMap["requiredMembers"] = plr.RequiredMembers
3049 }
3050 return json.Marshal(objectMap)
3051 }
3052
3053
3054 type PrivateLinkResourcesListResult struct {
3055 autorest.Response `json:"-"`
3056
3057 Value *[]PrivateLinkResource `json:"value,omitempty"`
3058 }
3059
3060
3061 type PrivateLinkServiceConnectionState struct {
3062
3063 Status ConnectionStatus `json:"status,omitempty"`
3064
3065 Description *string `json:"description,omitempty"`
3066 }
3067
3068
3069 type Resource struct {
3070
3071 ID *string `json:"id,omitempty"`
3072
3073 Name *string `json:"name,omitempty"`
3074
3075 Type *string `json:"type,omitempty"`
3076
3077 Location *string `json:"location,omitempty"`
3078
3079 Tags map[string]*string `json:"tags"`
3080 }
3081
3082
3083 func (r Resource) MarshalJSON() ([]byte, error) {
3084 objectMap := make(map[string]interface{})
3085 if r.Location != nil {
3086 objectMap["location"] = r.Location
3087 }
3088 if r.Tags != nil {
3089 objectMap["tags"] = r.Tags
3090 }
3091 return json.Marshal(objectMap)
3092 }
3093
3094
3095 type ResourceReference struct {
3096
3097 ID *string `json:"id,omitempty"`
3098 }
3099
3100
3101 type RunCommandRequest struct {
3102
3103 Command *string `json:"command,omitempty"`
3104
3105 Context *string `json:"context,omitempty"`
3106
3107 ClusterToken *string `json:"clusterToken,omitempty"`
3108 }
3109
3110
3111 type RunCommandResult struct {
3112 autorest.Response `json:"-"`
3113
3114 ID *string `json:"id,omitempty"`
3115
3116 *CommandResultProperties `json:"properties,omitempty"`
3117 }
3118
3119
3120 func (rcr RunCommandResult) MarshalJSON() ([]byte, error) {
3121 objectMap := make(map[string]interface{})
3122 if rcr.CommandResultProperties != nil {
3123 objectMap["properties"] = rcr.CommandResultProperties
3124 }
3125 return json.Marshal(objectMap)
3126 }
3127
3128
3129 func (rcr *RunCommandResult) UnmarshalJSON(body []byte) error {
3130 var m map[string]*json.RawMessage
3131 err := json.Unmarshal(body, &m)
3132 if err != nil {
3133 return err
3134 }
3135 for k, v := range m {
3136 switch k {
3137 case "id":
3138 if v != nil {
3139 var ID string
3140 err = json.Unmarshal(*v, &ID)
3141 if err != nil {
3142 return err
3143 }
3144 rcr.ID = &ID
3145 }
3146 case "properties":
3147 if v != nil {
3148 var commandResultProperties CommandResultProperties
3149 err = json.Unmarshal(*v, &commandResultProperties)
3150 if err != nil {
3151 return err
3152 }
3153 rcr.CommandResultProperties = &commandResultProperties
3154 }
3155 }
3156 }
3157
3158 return nil
3159 }
3160
3161
3162 type SSHConfiguration struct {
3163
3164 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"`
3165 }
3166
3167
3168 type SSHPublicKey struct {
3169
3170 KeyData *string `json:"keyData,omitempty"`
3171 }
3172
3173
3174 type SubResource struct {
3175
3176 ID *string `json:"id,omitempty"`
3177
3178 Name *string `json:"name,omitempty"`
3179
3180 Type *string `json:"type,omitempty"`
3181 }
3182
3183
3184 func (sr SubResource) MarshalJSON() ([]byte, error) {
3185 objectMap := make(map[string]interface{})
3186 return json.Marshal(objectMap)
3187 }
3188
3189
3190 type SysctlConfig struct {
3191
3192 NetCoreSomaxconn *int32 `json:"netCoreSomaxconn,omitempty"`
3193
3194 NetCoreNetdevMaxBacklog *int32 `json:"netCoreNetdevMaxBacklog,omitempty"`
3195
3196 NetCoreRmemDefault *int32 `json:"netCoreRmemDefault,omitempty"`
3197
3198 NetCoreRmemMax *int32 `json:"netCoreRmemMax,omitempty"`
3199
3200 NetCoreWmemDefault *int32 `json:"netCoreWmemDefault,omitempty"`
3201
3202 NetCoreWmemMax *int32 `json:"netCoreWmemMax,omitempty"`
3203
3204 NetCoreOptmemMax *int32 `json:"netCoreOptmemMax,omitempty"`
3205
3206 NetIpv4TCPMaxSynBacklog *int32 `json:"netIpv4TcpMaxSynBacklog,omitempty"`
3207
3208 NetIpv4TCPMaxTwBuckets *int32 `json:"netIpv4TcpMaxTwBuckets,omitempty"`
3209
3210 NetIpv4TCPFinTimeout *int32 `json:"netIpv4TcpFinTimeout,omitempty"`
3211
3212 NetIpv4TCPKeepaliveTime *int32 `json:"netIpv4TcpKeepaliveTime,omitempty"`
3213
3214 NetIpv4TCPKeepaliveProbes *int32 `json:"netIpv4TcpKeepaliveProbes,omitempty"`
3215
3216 NetIpv4TcpkeepaliveIntvl *int32 `json:"netIpv4TcpkeepaliveIntvl,omitempty"`
3217
3218 NetIpv4TCPTwReuse *bool `json:"netIpv4TcpTwReuse,omitempty"`
3219
3220 NetIpv4IPLocalPortRange *string `json:"netIpv4IpLocalPortRange,omitempty"`
3221
3222 NetIpv4NeighDefaultGcThresh1 *int32 `json:"netIpv4NeighDefaultGcThresh1,omitempty"`
3223
3224 NetIpv4NeighDefaultGcThresh2 *int32 `json:"netIpv4NeighDefaultGcThresh2,omitempty"`
3225
3226 NetIpv4NeighDefaultGcThresh3 *int32 `json:"netIpv4NeighDefaultGcThresh3,omitempty"`
3227
3228 NetNetfilterNfConntrackMax *int32 `json:"netNetfilterNfConntrackMax,omitempty"`
3229
3230 NetNetfilterNfConntrackBuckets *int32 `json:"netNetfilterNfConntrackBuckets,omitempty"`
3231
3232 FsInotifyMaxUserWatches *int32 `json:"fsInotifyMaxUserWatches,omitempty"`
3233
3234 FsFileMax *int32 `json:"fsFileMax,omitempty"`
3235
3236 FsAioMaxNr *int32 `json:"fsAioMaxNr,omitempty"`
3237
3238 FsNrOpen *int32 `json:"fsNrOpen,omitempty"`
3239
3240 KernelThreadsMax *int32 `json:"kernelThreadsMax,omitempty"`
3241
3242 VMMaxMapCount *int32 `json:"vmMaxMapCount,omitempty"`
3243
3244 VMSwappiness *int32 `json:"vmSwappiness,omitempty"`
3245
3246 VMVfsCachePressure *int32 `json:"vmVfsCachePressure,omitempty"`
3247 }
3248
3249
3250 type SystemData struct {
3251
3252 CreatedBy *string `json:"createdBy,omitempty"`
3253
3254 CreatedByType CreatedByType `json:"createdByType,omitempty"`
3255
3256 CreatedAt *date.Time `json:"createdAt,omitempty"`
3257
3258 LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
3259
3260 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
3261
3262 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
3263 }
3264
3265
3266 type TagsObject struct {
3267
3268 Tags map[string]*string `json:"tags"`
3269 }
3270
3271
3272 func (toVar TagsObject) MarshalJSON() ([]byte, error) {
3273 objectMap := make(map[string]interface{})
3274 if toVar.Tags != nil {
3275 objectMap["tags"] = toVar.Tags
3276 }
3277 return json.Marshal(objectMap)
3278 }
3279
3280
3281 type TimeInWeek struct {
3282
3283 Day WeekDay `json:"day,omitempty"`
3284
3285 HourSlots *[]int32 `json:"hourSlots,omitempty"`
3286 }
3287
3288
3289 type TimeSpan struct {
3290
3291 Start *date.Time `json:"start,omitempty"`
3292
3293 End *date.Time `json:"end,omitempty"`
3294 }
3295
3296
3297 type UserAssignedIdentity struct {
3298
3299 ResourceID *string `json:"resourceId,omitempty"`
3300
3301 ClientID *string `json:"clientId,omitempty"`
3302
3303 ObjectID *string `json:"objectId,omitempty"`
3304 }
3305
3306
3307 type VMDiagnostics struct {
3308
3309 Enabled *bool `json:"enabled,omitempty"`
3310
3311 StorageURI *string `json:"storageUri,omitempty"`
3312 }
3313
3314
3315 func (vd VMDiagnostics) MarshalJSON() ([]byte, error) {
3316 objectMap := make(map[string]interface{})
3317 if vd.Enabled != nil {
3318 objectMap["enabled"] = vd.Enabled
3319 }
3320 return json.Marshal(objectMap)
3321 }
3322
View as plain text