forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
4129 lines (3857 loc) · 130 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 netapp
// 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/netapp/mgmt/2020-12-01/netapp"
// Account netApp account resource
type Account struct {
autorest.Response `json:"-"`
// Location - Resource location
Location *string `json:"location,omitempty"`
// ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Tags - Resource tags
Tags map[string]*string `json:"tags"`
// AccountProperties - NetApp Account properties
*AccountProperties `json:"properties,omitempty"`
// SystemData - READ-ONLY; The system meta data relating to this resource.
SystemData *SystemData `json:"systemData,omitempty"`
}
// MarshalJSON is the custom marshaler for Account.
func (a Account) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if a.Location != nil {
objectMap["location"] = a.Location
}
if a.Tags != nil {
objectMap["tags"] = a.Tags
}
if a.AccountProperties != nil {
objectMap["properties"] = a.AccountProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Account struct.
func (a *Account) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
a.Location = &location
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
a.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
a.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
a.Type = &typeVar
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
a.Tags = tags
}
case "properties":
if v != nil {
var accountProperties AccountProperties
err = json.Unmarshal(*v, &accountProperties)
if err != nil {
return err
}
a.AccountProperties = &accountProperties
}
case "systemData":
if v != nil {
var systemData SystemData
err = json.Unmarshal(*v, &systemData)
if err != nil {
return err
}
a.SystemData = &systemData
}
}
}
return nil
}
// AccountBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type AccountBackupsDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AccountBackupsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AccountBackupsDeleteFuture) 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 AccountBackupsDeleteFuture.Result.
func (future *AccountBackupsDeleteFuture) result(client AccountBackupsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "netapp.AccountBackupsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("netapp.AccountBackupsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// AccountEncryption encryption settings
type AccountEncryption struct {
// KeySource - Encryption Key Source. Possible values are: 'Microsoft.NetApp'.
KeySource *string `json:"keySource,omitempty"`
}
// AccountList list of NetApp account resources
type AccountList struct {
autorest.Response `json:"-"`
// Value - Multiple NetApp accounts
Value *[]Account `json:"value,omitempty"`
// NextLink - URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
// AccountListIterator provides access to a complete listing of Account values.
type AccountListIterator struct {
i int
page AccountListPage
}
// 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 *AccountListIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AccountListIterator.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 *AccountListIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter AccountListIterator) 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 AccountListIterator) Response() AccountList {
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 AccountListIterator) Value() Account {
if !iter.page.NotDone() {
return Account{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the AccountListIterator type.
func NewAccountListIterator(page AccountListPage) AccountListIterator {
return AccountListIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (al AccountList) IsEmpty() bool {
return al.Value == nil || len(*al.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (al AccountList) hasNextLink() bool {
return al.NextLink != nil && len(*al.NextLink) != 0
}
// accountListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (al AccountList) accountListPreparer(ctx context.Context) (*http.Request, error) {
if !al.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(al.NextLink)))
}
// AccountListPage contains a page of Account values.
type AccountListPage struct {
fn func(context.Context, AccountList) (AccountList, error)
al AccountList
}
// 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 *AccountListPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AccountListPage.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.al)
if err != nil {
return err
}
page.al = 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 *AccountListPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page AccountListPage) NotDone() bool {
return !page.al.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page AccountListPage) Response() AccountList {
return page.al
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page AccountListPage) Values() []Account {
if page.al.IsEmpty() {
return nil
}
return *page.al.Value
}
// Creates a new instance of the AccountListPage type.
func NewAccountListPage(cur AccountList, getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage {
return AccountListPage{
fn: getNextPage,
al: cur,
}
}
// AccountPatch netApp account patch resource
type AccountPatch struct {
// Location - Resource location
Location *string `json:"location,omitempty"`
// ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Tags - Resource tags
Tags map[string]*string `json:"tags"`
// AccountProperties - NetApp Account properties
*AccountProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for AccountPatch.
func (ap AccountPatch) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ap.Location != nil {
objectMap["location"] = ap.Location
}
if ap.Tags != nil {
objectMap["tags"] = ap.Tags
}
if ap.AccountProperties != nil {
objectMap["properties"] = ap.AccountProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for AccountPatch struct.
func (ap *AccountPatch) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ap.Location = &location
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ap.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ap.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ap.Type = &typeVar
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ap.Tags = tags
}
case "properties":
if v != nil {
var accountProperties AccountProperties
err = json.Unmarshal(*v, &accountProperties)
if err != nil {
return err
}
ap.AccountProperties = &accountProperties
}
}
}
return nil
}
// AccountProperties netApp account properties
type AccountProperties struct {
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
// ActiveDirectories - Active Directories
ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"`
// Encryption - Encryption settings
Encryption *AccountEncryption `json:"encryption,omitempty"`
}
// MarshalJSON is the custom marshaler for AccountProperties.
func (ap AccountProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ap.ActiveDirectories != nil {
objectMap["activeDirectories"] = ap.ActiveDirectories
}
if ap.Encryption != nil {
objectMap["encryption"] = ap.Encryption
}
return json.Marshal(objectMap)
}
// AccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type AccountsCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AccountsClient) (Account, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AccountsCreateOrUpdateFuture) 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 AccountsCreateOrUpdateFuture.Result.
func (future *AccountsCreateOrUpdateFuture) result(client AccountsClient) (a Account, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
a.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("netapp.AccountsCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
a, err = client.CreateOrUpdateResponder(a.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request")
}
}
return
}
// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type AccountsDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AccountsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AccountsDeleteFuture) 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 AccountsDeleteFuture.Result.
func (future *AccountsDeleteFuture) result(client AccountsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "netapp.AccountsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("netapp.AccountsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// AccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type AccountsUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AccountsClient) (Account, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AccountsUpdateFuture) 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 AccountsUpdateFuture.Result.
func (future *AccountsUpdateFuture) result(client AccountsClient) (a Account, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
a.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("netapp.AccountsUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
a, err = client.UpdateResponder(a.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", a.Response.Response, "Failure responding to request")
}
}
return
}
// ActiveDirectory active Directory
type ActiveDirectory struct {
// ActiveDirectoryID - Id of the Active Directory
ActiveDirectoryID *string `json:"activeDirectoryId,omitempty"`
// Username - Username of Active Directory domain administrator
Username *string `json:"username,omitempty"`
// Password - Plain text password of Active Directory domain administrator, value is masked in the response
Password *string `json:"password,omitempty"`
// Domain - Name of the Active Directory domain
Domain *string `json:"domain,omitempty"`
// DNS - Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain
DNS *string `json:"dns,omitempty"`
// Status - READ-ONLY; Status of the Active Directory. Possible values include: 'Created', 'InUse', 'Deleted', 'Error', 'Updating'
Status ActiveDirectoryStatus `json:"status,omitempty"`
// StatusDetails - READ-ONLY; Any details in regards to the Status of the Active Directory
StatusDetails *string `json:"statusDetails,omitempty"`
// SmbServerName - NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes
SmbServerName *string `json:"smbServerName,omitempty"`
// OrganizationalUnit - The Organizational Unit (OU) within the Windows Active Directory
OrganizationalUnit *string `json:"organizationalUnit,omitempty"`
// Site - The Active Directory site the service will limit Domain Controller discovery to
Site *string `json:"site,omitempty"`
// BackupOperators - Users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier
BackupOperators *[]string `json:"backupOperators,omitempty"`
// KdcIP - kdc server IP addresses for the active directory machine. This optional parameter is used only while creating kerberos volume.
KdcIP *string `json:"kdcIP,omitempty"`
// AdName - Name of the active directory machine. This optional parameter is used only while creating kerberos volume
AdName *string `json:"adName,omitempty"`
// ServerRootCACertificate - When LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, this optional parameter is used only for dual protocol with LDAP user-mapping volumes.
ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"`
// AesEncryption - If enabled, AES encryption will be enabled for SMB communication.
AesEncryption *bool `json:"aesEncryption,omitempty"`
// LdapSigning - Specifies whether or not the LDAP traffic needs to be signed.
LdapSigning *bool `json:"ldapSigning,omitempty"`
// SecurityOperators - Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier
SecurityOperators *[]string `json:"securityOperators,omitempty"`
// LdapOverTLS - Specifies whether or not the LDAP traffic needs to be secured via TLS.
LdapOverTLS *bool `json:"ldapOverTLS,omitempty"`
// AllowLocalNfsUsersWithLdap - If enabled, NFS client local users can also (in addition to LDAP users) access the NFS volumes.
AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"`
}
// MarshalJSON is the custom marshaler for ActiveDirectory.
func (ad ActiveDirectory) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ad.ActiveDirectoryID != nil {
objectMap["activeDirectoryId"] = ad.ActiveDirectoryID
}
if ad.Username != nil {
objectMap["username"] = ad.Username
}
if ad.Password != nil {
objectMap["password"] = ad.Password
}
if ad.Domain != nil {
objectMap["domain"] = ad.Domain
}
if ad.DNS != nil {
objectMap["dns"] = ad.DNS
}
if ad.SmbServerName != nil {
objectMap["smbServerName"] = ad.SmbServerName
}
if ad.OrganizationalUnit != nil {
objectMap["organizationalUnit"] = ad.OrganizationalUnit
}
if ad.Site != nil {
objectMap["site"] = ad.Site
}
if ad.BackupOperators != nil {
objectMap["backupOperators"] = ad.BackupOperators
}
if ad.KdcIP != nil {
objectMap["kdcIP"] = ad.KdcIP
}
if ad.AdName != nil {
objectMap["adName"] = ad.AdName
}
if ad.ServerRootCACertificate != nil {
objectMap["serverRootCACertificate"] = ad.ServerRootCACertificate
}
if ad.AesEncryption != nil {
objectMap["aesEncryption"] = ad.AesEncryption
}
if ad.LdapSigning != nil {
objectMap["ldapSigning"] = ad.LdapSigning
}
if ad.SecurityOperators != nil {
objectMap["securityOperators"] = ad.SecurityOperators
}
if ad.LdapOverTLS != nil {
objectMap["ldapOverTLS"] = ad.LdapOverTLS
}
if ad.AllowLocalNfsUsersWithLdap != nil {
objectMap["allowLocalNfsUsersWithLdap"] = ad.AllowLocalNfsUsersWithLdap
}
return json.Marshal(objectMap)
}
// AuthorizeRequest authorize request
type AuthorizeRequest struct {
// RemoteVolumeResourceID - Resource id of the remote volume
RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"`
}
// Backup backup of a Volume
type Backup struct {
autorest.Response `json:"-"`
// Location - Resource location
Location *string `json:"location,omitempty"`
// ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// BackupProperties - Backup Properties
*BackupProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for Backup.
func (b Backup) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if b.Location != nil {
objectMap["location"] = b.Location
}
if b.BackupProperties != nil {
objectMap["properties"] = b.BackupProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Backup struct.
func (b *Backup) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
b.Location = &location
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
b.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
b.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
b.Type = &typeVar
}
case "properties":
if v != nil {
var backupProperties BackupProperties
err = json.Unmarshal(*v, &backupProperties)
if err != nil {
return err
}
b.BackupProperties = &backupProperties
}
}
}
return nil
}
// BackupPatch backup patch
type BackupPatch struct {
// Tags - Resource tags
Tags map[string]*string `json:"tags"`
// BackupProperties - Backup Properties
*BackupProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for BackupPatch.
func (bp BackupPatch) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if bp.Tags != nil {
objectMap["tags"] = bp.Tags
}
if bp.BackupProperties != nil {
objectMap["properties"] = bp.BackupProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for BackupPatch struct.
func (bp *BackupPatch) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
bp.Tags = tags
}
case "properties":
if v != nil {
var backupProperties BackupProperties
err = json.Unmarshal(*v, &backupProperties)
if err != nil {
return err
}
bp.BackupProperties = &backupProperties
}
}
}
return nil
}
// BackupPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type BackupPoliciesCreateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(BackupPoliciesClient) (BackupPolicy, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *BackupPoliciesCreateFuture) 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 BackupPoliciesCreateFuture.Result.
func (future *BackupPoliciesCreateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
bp.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesCreateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent {
bp, err = client.CreateResponder(bp.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", bp.Response.Response, "Failure responding to request")
}
}
return
}
// BackupPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type BackupPoliciesDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(BackupPoliciesClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *BackupPoliciesDeleteFuture) 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 BackupPoliciesDeleteFuture.Result.
func (future *BackupPoliciesDeleteFuture) result(client BackupPoliciesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// BackupPoliciesList list of Backup Policies
type BackupPoliciesList struct {
autorest.Response `json:"-"`
// Value - A list of backup policies
Value *[]BackupPolicy `json:"value,omitempty"`
}
// BackupPolicy backup policy information
type BackupPolicy struct {
autorest.Response `json:"-"`
// Location - Resource location
Location *string `json:"location,omitempty"`
// ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Tags - Resource tags
Tags map[string]*string `json:"tags"`
// BackupPolicyProperties - Backup policy Properties
*BackupPolicyProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for BackupPolicy.
func (bp BackupPolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if bp.Location != nil {
objectMap["location"] = bp.Location
}
if bp.Tags != nil {
objectMap["tags"] = bp.Tags
}
if bp.BackupPolicyProperties != nil {
objectMap["properties"] = bp.BackupPolicyProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for BackupPolicy struct.
func (bp *BackupPolicy) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
bp.Location = &location
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
bp.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
bp.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
bp.Type = &typeVar
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
bp.Tags = tags
}
case "properties":