forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
3412 lines (3101 loc) · 128 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package appplatform
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/appplatform/mgmt/2020-11-01-preview/appplatform"
// ApplicationInsightsAgentVersions application Insights agent versions properties payload
type ApplicationInsightsAgentVersions struct {
// Java - READ-ONLY; Indicates the version of application insight java agent
Java *string `json:"java,omitempty"`
}
// MarshalJSON is the custom marshaler for ApplicationInsightsAgentVersions.
func (aiav ApplicationInsightsAgentVersions) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// AppResource app resource payload
type AppResource struct {
autorest.Response `json:"-"`
// Properties - Properties of the App resource
Properties *AppResourceProperties `json:"properties,omitempty"`
// Identity - The Managed Identity type of the app resource
Identity *ManagedIdentityProperties `json:"identity,omitempty"`
// Location - The GEO location of the application, always the same with its parent resource
Location *string `json:"location,omitempty"`
// ID - READ-ONLY; Fully qualified resource Id for the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for AppResource.
func (ar AppResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ar.Properties != nil {
objectMap["properties"] = ar.Properties
}
if ar.Identity != nil {
objectMap["identity"] = ar.Identity
}
if ar.Location != nil {
objectMap["location"] = ar.Location
}
return json.Marshal(objectMap)
}
// AppResourceCollection object that includes an array of App resources and a possible link for next set
type AppResourceCollection struct {
autorest.Response `json:"-"`
// Value - Collection of App resources
Value *[]AppResource `json:"value,omitempty"`
// NextLink - URL client should use to fetch the next page (per server side paging).
// It's null for now, added for future use.
NextLink *string `json:"nextLink,omitempty"`
}
// AppResourceCollectionIterator provides access to a complete listing of AppResource values.
type AppResourceCollectionIterator struct {
i int
page AppResourceCollectionPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *AppResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AppResourceCollectionIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *AppResourceCollectionIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter AppResourceCollectionIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter AppResourceCollectionIterator) Response() AppResourceCollection {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter AppResourceCollectionIterator) Value() AppResource {
if !iter.page.NotDone() {
return AppResource{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the AppResourceCollectionIterator type.
func NewAppResourceCollectionIterator(page AppResourceCollectionPage) AppResourceCollectionIterator {
return AppResourceCollectionIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (arc AppResourceCollection) IsEmpty() bool {
return arc.Value == nil || len(*arc.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (arc AppResourceCollection) hasNextLink() bool {
return arc.NextLink != nil && len(*arc.NextLink) != 0
}
// appResourceCollectionPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (arc AppResourceCollection) appResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
if !arc.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(arc.NextLink)))
}
// AppResourceCollectionPage contains a page of AppResource values.
type AppResourceCollectionPage struct {
fn func(context.Context, AppResourceCollection) (AppResourceCollection, error)
arc AppResourceCollection
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *AppResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AppResourceCollectionPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.arc)
if err != nil {
return err
}
page.arc = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *AppResourceCollectionPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page AppResourceCollectionPage) NotDone() bool {
return !page.arc.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page AppResourceCollectionPage) Response() AppResourceCollection {
return page.arc
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page AppResourceCollectionPage) Values() []AppResource {
if page.arc.IsEmpty() {
return nil
}
return *page.arc.Value
}
// Creates a new instance of the AppResourceCollectionPage type.
func NewAppResourceCollectionPage(cur AppResourceCollection, getNextPage func(context.Context, AppResourceCollection) (AppResourceCollection, error)) AppResourceCollectionPage {
return AppResourceCollectionPage{
fn: getNextPage,
arc: cur,
}
}
// AppResourceProperties app resource properties payload
type AppResourceProperties struct {
// Public - Indicates whether the App exposes public endpoint
Public *bool `json:"public,omitempty"`
// URL - READ-ONLY; URL of the App
URL *string `json:"url,omitempty"`
// ProvisioningState - READ-ONLY; Provisioning state of the App. Possible values include: 'Succeeded', 'Failed', 'Creating', 'Updating'
ProvisioningState AppResourceProvisioningState `json:"provisioningState,omitempty"`
// ActiveDeploymentName - Name of the active deployment of the App
ActiveDeploymentName *string `json:"activeDeploymentName,omitempty"`
// Fqdn - Fully qualified dns Name.
Fqdn *string `json:"fqdn,omitempty"`
// HTTPSOnly - Indicate if only https is allowed.
HTTPSOnly *bool `json:"httpsOnly,omitempty"`
// EnableEndToEndTLS - Indicate if end to end TLS is enabled.
EnableEndToEndTLS *bool `json:"enableEndToEndTLS,omitempty"`
// CreatedTime - READ-ONLY; Date time when the resource is created
CreatedTime *date.Time `json:"createdTime,omitempty"`
// TemporaryDisk - Temporary disk settings
TemporaryDisk *TemporaryDisk `json:"temporaryDisk,omitempty"`
// PersistentDisk - Persistent disk settings
PersistentDisk *PersistentDisk `json:"persistentDisk,omitempty"`
}
// MarshalJSON is the custom marshaler for AppResourceProperties.
func (arp AppResourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if arp.Public != nil {
objectMap["public"] = arp.Public
}
if arp.ActiveDeploymentName != nil {
objectMap["activeDeploymentName"] = arp.ActiveDeploymentName
}
if arp.Fqdn != nil {
objectMap["fqdn"] = arp.Fqdn
}
if arp.HTTPSOnly != nil {
objectMap["httpsOnly"] = arp.HTTPSOnly
}
if arp.EnableEndToEndTLS != nil {
objectMap["enableEndToEndTLS"] = arp.EnableEndToEndTLS
}
if arp.TemporaryDisk != nil {
objectMap["temporaryDisk"] = arp.TemporaryDisk
}
if arp.PersistentDisk != nil {
objectMap["persistentDisk"] = arp.PersistentDisk
}
return json.Marshal(objectMap)
}
// AppsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type AppsCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AppsClient) (AppResource, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AppsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for AppsCreateOrUpdateFuture.Result.
func (future *AppsCreateOrUpdateFuture) result(client AppsClient) (ar AppResource, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.AppsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("appplatform.AppsCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ar.Response.Response, err = future.GetResult(sender); err == nil && ar.Response.Response.StatusCode != http.StatusNoContent {
ar, err = client.CreateOrUpdateResponder(ar.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.AppsCreateOrUpdateFuture", "Result", ar.Response.Response, "Failure responding to request")
}
}
return
}
// AppsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type AppsDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AppsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AppsDeleteFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for AppsDeleteFuture.Result.
func (future *AppsDeleteFuture) result(client AppsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.AppsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("appplatform.AppsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// AppsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type AppsUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AppsClient) (AppResource, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AppsUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for AppsUpdateFuture.Result.
func (future *AppsUpdateFuture) result(client AppsClient) (ar AppResource, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.AppsUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("appplatform.AppsUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ar.Response.Response, err = future.GetResult(sender); err == nil && ar.Response.Response.StatusCode != http.StatusNoContent {
ar, err = client.UpdateResponder(ar.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.AppsUpdateFuture", "Result", ar.Response.Response, "Failure responding to request")
}
}
return
}
// AvailableOperations available operations of the service
type AvailableOperations struct {
autorest.Response `json:"-"`
// Value - Collection of available operation details
Value *[]OperationDetail `json:"value,omitempty"`
// NextLink - URL client should use to fetch the next page (per server side paging).
// It's null for now, added for future use.
NextLink *string `json:"nextLink,omitempty"`
}
// AvailableOperationsIterator provides access to a complete listing of OperationDetail values.
type AvailableOperationsIterator struct {
i int
page AvailableOperationsPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *AvailableOperationsIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailableOperationsIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *AvailableOperationsIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter AvailableOperationsIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter AvailableOperationsIterator) Response() AvailableOperations {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter AvailableOperationsIterator) Value() OperationDetail {
if !iter.page.NotDone() {
return OperationDetail{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the AvailableOperationsIterator type.
func NewAvailableOperationsIterator(page AvailableOperationsPage) AvailableOperationsIterator {
return AvailableOperationsIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (ao AvailableOperations) IsEmpty() bool {
return ao.Value == nil || len(*ao.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (ao AvailableOperations) hasNextLink() bool {
return ao.NextLink != nil && len(*ao.NextLink) != 0
}
// availableOperationsPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (ao AvailableOperations) availableOperationsPreparer(ctx context.Context) (*http.Request, error) {
if !ao.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(ao.NextLink)))
}
// AvailableOperationsPage contains a page of OperationDetail values.
type AvailableOperationsPage struct {
fn func(context.Context, AvailableOperations) (AvailableOperations, error)
ao AvailableOperations
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *AvailableOperationsPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailableOperationsPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.ao)
if err != nil {
return err
}
page.ao = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *AvailableOperationsPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page AvailableOperationsPage) NotDone() bool {
return !page.ao.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page AvailableOperationsPage) Response() AvailableOperations {
return page.ao
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page AvailableOperationsPage) Values() []OperationDetail {
if page.ao.IsEmpty() {
return nil
}
return *page.ao.Value
}
// Creates a new instance of the AvailableOperationsPage type.
func NewAvailableOperationsPage(cur AvailableOperations, getNextPage func(context.Context, AvailableOperations) (AvailableOperations, error)) AvailableOperationsPage {
return AvailableOperationsPage{
fn: getNextPage,
ao: cur,
}
}
// AvailableRuntimeVersions ...
type AvailableRuntimeVersions struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; A list of all supported runtime versions.
Value *[]SupportedRuntimeVersion `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for AvailableRuntimeVersions.
func (arv AvailableRuntimeVersions) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// BindingResource binding resource payload
type BindingResource struct {
autorest.Response `json:"-"`
// Properties - Properties of the Binding resource
Properties *BindingResourceProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Fully qualified resource Id for the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for BindingResource.
func (br BindingResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if br.Properties != nil {
objectMap["properties"] = br.Properties
}
return json.Marshal(objectMap)
}
// BindingResourceCollection object that includes an array of Binding resources and a possible link for
// next set
type BindingResourceCollection struct {
autorest.Response `json:"-"`
// Value - Collection of Binding resources
Value *[]BindingResource `json:"value,omitempty"`
// NextLink - URL client should use to fetch the next page (per server side paging).
// It's null for now, added for future use.
NextLink *string `json:"nextLink,omitempty"`
}
// BindingResourceCollectionIterator provides access to a complete listing of BindingResource values.
type BindingResourceCollectionIterator struct {
i int
page BindingResourceCollectionPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *BindingResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/BindingResourceCollectionIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *BindingResourceCollectionIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter BindingResourceCollectionIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter BindingResourceCollectionIterator) Response() BindingResourceCollection {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter BindingResourceCollectionIterator) Value() BindingResource {
if !iter.page.NotDone() {
return BindingResource{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the BindingResourceCollectionIterator type.
func NewBindingResourceCollectionIterator(page BindingResourceCollectionPage) BindingResourceCollectionIterator {
return BindingResourceCollectionIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (brc BindingResourceCollection) IsEmpty() bool {
return brc.Value == nil || len(*brc.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (brc BindingResourceCollection) hasNextLink() bool {
return brc.NextLink != nil && len(*brc.NextLink) != 0
}
// bindingResourceCollectionPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (brc BindingResourceCollection) bindingResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
if !brc.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(brc.NextLink)))
}
// BindingResourceCollectionPage contains a page of BindingResource values.
type BindingResourceCollectionPage struct {
fn func(context.Context, BindingResourceCollection) (BindingResourceCollection, error)
brc BindingResourceCollection
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *BindingResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/BindingResourceCollectionPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.brc)
if err != nil {
return err
}
page.brc = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *BindingResourceCollectionPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page BindingResourceCollectionPage) NotDone() bool {
return !page.brc.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page BindingResourceCollectionPage) Response() BindingResourceCollection {
return page.brc
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page BindingResourceCollectionPage) Values() []BindingResource {
if page.brc.IsEmpty() {
return nil
}
return *page.brc.Value
}
// Creates a new instance of the BindingResourceCollectionPage type.
func NewBindingResourceCollectionPage(cur BindingResourceCollection, getNextPage func(context.Context, BindingResourceCollection) (BindingResourceCollection, error)) BindingResourceCollectionPage {
return BindingResourceCollectionPage{
fn: getNextPage,
brc: cur,
}
}
// BindingResourceProperties binding resource properties payload
type BindingResourceProperties struct {
// ResourceName - READ-ONLY; The name of the bound resource
ResourceName *string `json:"resourceName,omitempty"`
// ResourceType - READ-ONLY; The standard Azure resource type of the bound resource
ResourceType *string `json:"resourceType,omitempty"`
// ResourceID - The Azure resource id of the bound resource
ResourceID *string `json:"resourceId,omitempty"`
// Key - The key of the bound resource
Key *string `json:"key,omitempty"`
// BindingParameters - Binding parameters of the Binding resource
BindingParameters map[string]interface{} `json:"bindingParameters"`
// GeneratedProperties - READ-ONLY; The generated Spring Boot property file for this binding. The secret will be deducted.
GeneratedProperties *string `json:"generatedProperties,omitempty"`
// CreatedAt - READ-ONLY; Creation time of the Binding resource
CreatedAt *string `json:"createdAt,omitempty"`
// UpdatedAt - READ-ONLY; Update time of the Binding resource
UpdatedAt *string `json:"updatedAt,omitempty"`
}
// MarshalJSON is the custom marshaler for BindingResourceProperties.
func (brp BindingResourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if brp.ResourceID != nil {
objectMap["resourceId"] = brp.ResourceID
}
if brp.Key != nil {
objectMap["key"] = brp.Key
}
if brp.BindingParameters != nil {
objectMap["bindingParameters"] = brp.BindingParameters
}
return json.Marshal(objectMap)
}
// BindingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type BindingsCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(BindingsClient) (BindingResource, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *BindingsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for BindingsCreateOrUpdateFuture.Result.
func (future *BindingsCreateOrUpdateFuture) result(client BindingsClient) (br BindingResource, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.BindingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
br.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("appplatform.BindingsCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if br.Response.Response, err = future.GetResult(sender); err == nil && br.Response.Response.StatusCode != http.StatusNoContent {
br, err = client.CreateOrUpdateResponder(br.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.BindingsCreateOrUpdateFuture", "Result", br.Response.Response, "Failure responding to request")
}
}
return
}
// BindingsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type BindingsDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(BindingsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *BindingsDeleteFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for BindingsDeleteFuture.Result.
func (future *BindingsDeleteFuture) result(client BindingsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.BindingsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("appplatform.BindingsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// BindingsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type BindingsUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(BindingsClient) (BindingResource, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *BindingsUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for BindingsUpdateFuture.Result.
func (future *BindingsUpdateFuture) result(client BindingsClient) (br BindingResource, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.BindingsUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
br.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("appplatform.BindingsUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if br.Response.Response, err = future.GetResult(sender); err == nil && br.Response.Response.StatusCode != http.StatusNoContent {
br, err = client.UpdateResponder(br.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "appplatform.BindingsUpdateFuture", "Result", br.Response.Response, "Failure responding to request")
}
}
return
}
// CertificateProperties certificate resource payload.
type CertificateProperties struct {
// Thumbprint - READ-ONLY; The thumbprint of certificate.
Thumbprint *string `json:"thumbprint,omitempty"`
// VaultURI - The vault uri of user key vault.
VaultURI *string `json:"vaultUri,omitempty"`
// KeyVaultCertName - The certificate name of key vault.
KeyVaultCertName *string `json:"keyVaultCertName,omitempty"`
// CertVersion - The certificate version of key vault.
CertVersion *string `json:"certVersion,omitempty"`
// Issuer - READ-ONLY; The issuer of certificate.
Issuer *string `json:"issuer,omitempty"`
// IssuedDate - READ-ONLY; The issue date of certificate.
IssuedDate *string `json:"issuedDate,omitempty"`
// ExpirationDate - READ-ONLY; The expiration date of certificate.
ExpirationDate *string `json:"expirationDate,omitempty"`
// ActivateDate - READ-ONLY; The activate date of certificate.
ActivateDate *string `json:"activateDate,omitempty"`
// SubjectName - READ-ONLY; The subject name of certificate.
SubjectName *string `json:"subjectName,omitempty"`
// DNSNames - READ-ONLY; The domain list of certificate.
DNSNames *[]string `json:"dnsNames,omitempty"`
}
// MarshalJSON is the custom marshaler for CertificateProperties.
func (cp CertificateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cp.VaultURI != nil {
objectMap["vaultUri"] = cp.VaultURI
}
if cp.KeyVaultCertName != nil {
objectMap["keyVaultCertName"] = cp.KeyVaultCertName
}
if cp.CertVersion != nil {
objectMap["certVersion"] = cp.CertVersion
}
return json.Marshal(objectMap)
}
// CertificateResource certificate resource payload.
type CertificateResource struct {
autorest.Response `json:"-"`
// Properties - Properties of the certificate resource payload.
Properties *CertificateProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Fully qualified resource Id for the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for CertificateResource.
func (cr CertificateResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cr.Properties != nil {
objectMap["properties"] = cr.Properties
}
return json.Marshal(objectMap)
}
// CertificateResourceCollection collection compose of certificate resources list and a possible link for
// next page.
type CertificateResourceCollection struct {
autorest.Response `json:"-"`
// Value - The certificate resources list.
Value *[]CertificateResource `json:"value,omitempty"`
// NextLink - The link to next page of certificate list.
NextLink *string `json:"nextLink,omitempty"`
}
// CertificateResourceCollectionIterator provides access to a complete listing of CertificateResource
// values.
type CertificateResourceCollectionIterator struct {
i int
page CertificateResourceCollectionPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *CertificateResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/CertificateResourceCollectionIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}