-
Notifications
You must be signed in to change notification settings - Fork 822
/
models.go
1548 lines (1411 loc) · 55.2 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 recoveryservices
// 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/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/recoveryservices/mgmt/2016-06-01/recoveryservices"
// CertificateRequest details of the certificate to be uploaded to the vault.
type CertificateRequest struct {
Properties *RawCertificateData `json:"properties,omitempty"`
}
// CheckNameAvailabilityParameters resource Name availability input parameters - Resource type and resource
// name
type CheckNameAvailabilityParameters struct {
// Type - Describes the Resource type: Microsoft.RecoveryServices/Vaults
Type *string `json:"type,omitempty"`
// Name - Resource name for which availability needs to be checked
Name *string `json:"name,omitempty"`
}
// CheckNameAvailabilityResult response for check name availability API. Resource provider will set
// availability as true | false.
type CheckNameAvailabilityResult struct {
autorest.Response `json:"-"`
NameAvailable *bool `json:"nameAvailable,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
}
// ClientDiscoveryDisplay localized display information of an operation.
type ClientDiscoveryDisplay struct {
// Provider - Name of the provider for display purposes
Provider *string `json:"provider,omitempty"`
// Resource - ResourceType for which this Operation can be performed.
Resource *string `json:"resource,omitempty"`
// Operation - Operations Name itself.
Operation *string `json:"operation,omitempty"`
// Description - Description of the operation having details of what operation is about.
Description *string `json:"description,omitempty"`
}
// ClientDiscoveryForLogSpecification class to represent shoebox log specification in json client
// discovery.
type ClientDiscoveryForLogSpecification struct {
// Name - Name of the log.
Name *string `json:"name,omitempty"`
// DisplayName - Localized display name
DisplayName *string `json:"displayName,omitempty"`
// BlobDuration - Blobs created in customer storage account per hour
BlobDuration *string `json:"blobDuration,omitempty"`
}
// ClientDiscoveryForProperties class to represent shoebox properties in json client discovery.
type ClientDiscoveryForProperties struct {
// ServiceSpecification - Operation properties.
ServiceSpecification *ClientDiscoveryForServiceSpecification `json:"serviceSpecification,omitempty"`
}
// ClientDiscoveryForServiceSpecification class to represent shoebox service specification in json client
// discovery.
type ClientDiscoveryForServiceSpecification struct {
// LogSpecifications - List of log specifications of this operation.
LogSpecifications *[]ClientDiscoveryForLogSpecification `json:"logSpecifications,omitempty"`
}
// ClientDiscoveryResponse operations List response which contains list of available APIs.
type ClientDiscoveryResponse struct {
autorest.Response `json:"-"`
// Value - List of available operations.
Value *[]ClientDiscoveryValueForSingleAPI `json:"value,omitempty"`
// NextLink - Link to the next chunk of the response
NextLink *string `json:"nextLink,omitempty"`
}
// ClientDiscoveryResponseIterator provides access to a complete listing of
// ClientDiscoveryValueForSingleAPI values.
type ClientDiscoveryResponseIterator struct {
i int
page ClientDiscoveryResponsePage
}
// 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 *ClientDiscoveryResponseIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponseIterator.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 *ClientDiscoveryResponseIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ClientDiscoveryResponseIterator) 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 ClientDiscoveryResponseIterator) Response() ClientDiscoveryResponse {
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 ClientDiscoveryResponseIterator) Value() ClientDiscoveryValueForSingleAPI {
if !iter.page.NotDone() {
return ClientDiscoveryValueForSingleAPI{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the ClientDiscoveryResponseIterator type.
func NewClientDiscoveryResponseIterator(page ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator {
return ClientDiscoveryResponseIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (cdr ClientDiscoveryResponse) IsEmpty() bool {
return cdr.Value == nil || len(*cdr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (cdr ClientDiscoveryResponse) hasNextLink() bool {
return cdr.NextLink != nil && len(*cdr.NextLink) != 0
}
// clientDiscoveryResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (cdr ClientDiscoveryResponse) clientDiscoveryResponsePreparer(ctx context.Context) (*http.Request, error) {
if !cdr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(cdr.NextLink)))
}
// ClientDiscoveryResponsePage contains a page of ClientDiscoveryValueForSingleAPI values.
type ClientDiscoveryResponsePage struct {
fn func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)
cdr ClientDiscoveryResponse
}
// 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 *ClientDiscoveryResponsePage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponsePage.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.cdr)
if err != nil {
return err
}
page.cdr = 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 *ClientDiscoveryResponsePage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ClientDiscoveryResponsePage) NotDone() bool {
return !page.cdr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page ClientDiscoveryResponsePage) Response() ClientDiscoveryResponse {
return page.cdr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page ClientDiscoveryResponsePage) Values() []ClientDiscoveryValueForSingleAPI {
if page.cdr.IsEmpty() {
return nil
}
return *page.cdr.Value
}
// Creates a new instance of the ClientDiscoveryResponsePage type.
func NewClientDiscoveryResponsePage(cur ClientDiscoveryResponse, getNextPage func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage {
return ClientDiscoveryResponsePage{
fn: getNextPage,
cdr: cur,
}
}
// ClientDiscoveryValueForSingleAPI available operation details.
type ClientDiscoveryValueForSingleAPI struct {
// Name - Name of the Operation.
Name *string `json:"name,omitempty"`
// Display - Contains the localized display information for this particular operation
Display *ClientDiscoveryDisplay `json:"display,omitempty"`
// Origin - The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX
Origin *string `json:"origin,omitempty"`
// Properties - ShoeBox properties for the given operation.
Properties *ClientDiscoveryForProperties `json:"properties,omitempty"`
}
// IdentityData identity for the resource.
type IdentityData struct {
// PrincipalID - READ-ONLY; The principal ID of resource identity.
PrincipalID *string `json:"principalId,omitempty"`
// TenantID - READ-ONLY; The tenant ID of resource.
TenantID *string `json:"tenantId,omitempty"`
// Type - The identity type. Possible values include: 'SystemAssigned', 'None'
Type ResourceIdentityType `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for IdentityData.
func (ID IdentityData) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ID.Type != "" {
objectMap["type"] = ID.Type
}
return json.Marshal(objectMap)
}
// JobsSummary summary of the replication job data for this vault.
type JobsSummary struct {
// FailedJobs - Count of failed jobs.
FailedJobs *int32 `json:"failedJobs,omitempty"`
// SuspendedJobs - Count of suspended jobs.
SuspendedJobs *int32 `json:"suspendedJobs,omitempty"`
// InProgressJobs - Count of in-progress jobs.
InProgressJobs *int32 `json:"inProgressJobs,omitempty"`
}
// MonitoringSummary summary of the replication monitoring data for this vault.
type MonitoringSummary struct {
// UnHealthyVMCount - Count of unhealthy VMs.
UnHealthyVMCount *int32 `json:"unHealthyVmCount,omitempty"`
// UnHealthyProviderCount - Count of unhealthy replication providers.
UnHealthyProviderCount *int32 `json:"unHealthyProviderCount,omitempty"`
// EventsCount - Count of all critical warnings.
EventsCount *int32 `json:"eventsCount,omitempty"`
// DeprecatedProviderCount - Count of all deprecated recovery service providers.
DeprecatedProviderCount *int32 `json:"deprecatedProviderCount,omitempty"`
// SupportedProviderCount - Count of all the supported recovery service providers.
SupportedProviderCount *int32 `json:"supportedProviderCount,omitempty"`
// UnsupportedProviderCount - Count of all the unsupported recovery service providers.
UnsupportedProviderCount *int32 `json:"unsupportedProviderCount,omitempty"`
}
// NameInfo the name of usage.
type NameInfo struct {
// Value - Value of usage.
Value *string `json:"value,omitempty"`
// LocalizedValue - Localized value of usage.
LocalizedValue *string `json:"localizedValue,omitempty"`
}
// PatchTrackedResource tracked resource with location.
type PatchTrackedResource struct {
// Location - Resource location.
Location *string `json:"location,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// ID - READ-ONLY; Resource Id represents the complete path to the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name associated with the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
Type *string `json:"type,omitempty"`
// ETag - Optional ETag.
ETag *string `json:"eTag,omitempty"`
}
// MarshalJSON is the custom marshaler for PatchTrackedResource.
func (ptr PatchTrackedResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ptr.Location != nil {
objectMap["location"] = ptr.Location
}
if ptr.Tags != nil {
objectMap["tags"] = ptr.Tags
}
if ptr.ETag != nil {
objectMap["eTag"] = ptr.ETag
}
return json.Marshal(objectMap)
}
// PatchVault patch Resource information, as returned by the resource provider.
type PatchVault struct {
Properties *VaultProperties `json:"properties,omitempty"`
Sku *Sku `json:"sku,omitempty"`
Identity *IdentityData `json:"identity,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// ID - READ-ONLY; Resource Id represents the complete path to the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name associated with the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
Type *string `json:"type,omitempty"`
// ETag - Optional ETag.
ETag *string `json:"eTag,omitempty"`
}
// MarshalJSON is the custom marshaler for PatchVault.
func (pv PatchVault) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if pv.Properties != nil {
objectMap["properties"] = pv.Properties
}
if pv.Sku != nil {
objectMap["sku"] = pv.Sku
}
if pv.Identity != nil {
objectMap["identity"] = pv.Identity
}
if pv.Location != nil {
objectMap["location"] = pv.Location
}
if pv.Tags != nil {
objectMap["tags"] = pv.Tags
}
if pv.ETag != nil {
objectMap["eTag"] = pv.ETag
}
return json.Marshal(objectMap)
}
// PrivateEndpoint the Private Endpoint network resource that is linked to the Private Endpoint connection.
type PrivateEndpoint struct {
// ID - READ-ONLY; Gets or sets id.
ID *string `json:"id,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateEndpoint.
func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// PrivateEndpointConnection private Endpoint Connection Response Properties.
type PrivateEndpointConnection struct {
// ProvisioningState - READ-ONLY; Gets or sets provisioning state of the private endpoint connection. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStatePending'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if pec.PrivateEndpoint != nil {
objectMap["privateEndpoint"] = pec.PrivateEndpoint
}
if pec.PrivateLinkServiceConnectionState != nil {
objectMap["privateLinkServiceConnectionState"] = pec.PrivateLinkServiceConnectionState
}
return json.Marshal(objectMap)
}
// PrivateEndpointConnectionVaultProperties information to be stored in Vault properties as an element of
// privateEndpointConnections List.
type PrivateEndpointConnectionVaultProperties struct {
// ID - READ-ONLY; Format of id subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}.
ID *string `json:"id,omitempty"`
Properties *PrivateEndpointConnection `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateEndpointConnectionVaultProperties.
func (pecvp PrivateEndpointConnectionVaultProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if pecvp.Properties != nil {
objectMap["properties"] = pecvp.Properties
}
return json.Marshal(objectMap)
}
// PrivateLinkResource information of the private link resource.
type PrivateLinkResource struct {
autorest.Response `json:"-"`
// PrivateLinkResourceProperties - Resource properties
*PrivateLinkResourceProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Fully qualified identifier of the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; e.g. Microsoft.RecoveryServices/vaults/privateLinkResources
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateLinkResource.
func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if plr.PrivateLinkResourceProperties != nil {
objectMap["properties"] = plr.PrivateLinkResourceProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
func (plr *PrivateLinkResource) 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 "properties":
if v != nil {
var privateLinkResourceProperties PrivateLinkResourceProperties
err = json.Unmarshal(*v, &privateLinkResourceProperties)
if err != nil {
return err
}
plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
plr.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
plr.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
plr.Type = &typeVar
}
}
}
return nil
}
// PrivateLinkResourceProperties properties of the private link resource.
type PrivateLinkResourceProperties struct {
// GroupID - READ-ONLY; e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery)
GroupID *string `json:"groupId,omitempty"`
// RequiredMembers - READ-ONLY; [backup-ecs1, backup-prot1, backup-prot1b, backup-prot1c, backup-id1]
RequiredMembers *[]string `json:"requiredMembers,omitempty"`
// RequiredZoneNames - READ-ONLY; The private link resource Private link DNS zone name.
RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// PrivateLinkResources class which represent the stamps associated with the vault.
type PrivateLinkResources struct {
autorest.Response `json:"-"`
// Value - A collection of private link resources
Value *[]PrivateLinkResource `json:"value,omitempty"`
// NextLink - Link to the next chunk of the response
NextLink *string `json:"nextLink,omitempty"`
}
// PrivateLinkResourcesIterator provides access to a complete listing of PrivateLinkResource values.
type PrivateLinkResourcesIterator struct {
i int
page PrivateLinkResourcesPage
}
// 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 *PrivateLinkResourcesIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesIterator.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 *PrivateLinkResourcesIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter PrivateLinkResourcesIterator) 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 PrivateLinkResourcesIterator) Response() PrivateLinkResources {
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 PrivateLinkResourcesIterator) Value() PrivateLinkResource {
if !iter.page.NotDone() {
return PrivateLinkResource{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the PrivateLinkResourcesIterator type.
func NewPrivateLinkResourcesIterator(page PrivateLinkResourcesPage) PrivateLinkResourcesIterator {
return PrivateLinkResourcesIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (plr PrivateLinkResources) IsEmpty() bool {
return plr.Value == nil || len(*plr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (plr PrivateLinkResources) hasNextLink() bool {
return plr.NextLink != nil && len(*plr.NextLink) != 0
}
// privateLinkResourcesPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (plr PrivateLinkResources) privateLinkResourcesPreparer(ctx context.Context) (*http.Request, error) {
if !plr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(plr.NextLink)))
}
// PrivateLinkResourcesPage contains a page of PrivateLinkResource values.
type PrivateLinkResourcesPage struct {
fn func(context.Context, PrivateLinkResources) (PrivateLinkResources, error)
plr PrivateLinkResources
}
// 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 *PrivateLinkResourcesPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesPage.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.plr)
if err != nil {
return err
}
page.plr = 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 *PrivateLinkResourcesPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page PrivateLinkResourcesPage) NotDone() bool {
return !page.plr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page PrivateLinkResourcesPage) Response() PrivateLinkResources {
return page.plr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page PrivateLinkResourcesPage) Values() []PrivateLinkResource {
if page.plr.IsEmpty() {
return nil
}
return *page.plr.Value
}
// Creates a new instance of the PrivateLinkResourcesPage type.
func NewPrivateLinkResourcesPage(cur PrivateLinkResources, getNextPage func(context.Context, PrivateLinkResources) (PrivateLinkResources, error)) PrivateLinkResourcesPage {
return PrivateLinkResourcesPage{
fn: getNextPage,
plr: cur,
}
}
// PrivateLinkServiceConnectionState gets or sets private link service connection state.
type PrivateLinkServiceConnectionState struct {
// Status - READ-ONLY; Gets or sets the status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'
Status PrivateEndpointConnectionStatus `json:"status,omitempty"`
// Description - READ-ONLY; Gets or sets description.
Description *string `json:"description,omitempty"`
// ActionsRequired - READ-ONLY; Gets or sets actions required.
ActionsRequired *string `json:"actionsRequired,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionState.
func (plscs PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// RawCertificateData raw certificate data.
type RawCertificateData struct {
// AuthType - Specifies the authentication type. Possible values include: 'Invalid', 'ACS', 'AAD', 'AccessControlService', 'AzureActiveDirectory'
AuthType AuthType `json:"authType,omitempty"`
// Certificate - The base64 encoded certificate raw data string
Certificate *[]byte `json:"certificate,omitempty"`
}
// ReplicationUsage replication usages of a vault.
type ReplicationUsage struct {
// MonitoringSummary - Summary of the replication monitoring data for this vault.
MonitoringSummary *MonitoringSummary `json:"monitoringSummary,omitempty"`
// JobsSummary - Summary of the replication jobs data for this vault.
JobsSummary *JobsSummary `json:"jobsSummary,omitempty"`
// ProtectedItemCount - Number of replication protected items for this vault.
ProtectedItemCount *int32 `json:"protectedItemCount,omitempty"`
// RecoveryPlanCount - Number of replication recovery plans for this vault.
RecoveryPlanCount *int32 `json:"recoveryPlanCount,omitempty"`
// RegisteredServersCount - Number of servers registered to this vault.
RegisteredServersCount *int32 `json:"registeredServersCount,omitempty"`
// RecoveryServicesProviderAuthType - The authentication type of recovery service providers in the vault.
RecoveryServicesProviderAuthType *int32 `json:"recoveryServicesProviderAuthType,omitempty"`
}
// ReplicationUsageList replication usages for vault.
type ReplicationUsageList struct {
autorest.Response `json:"-"`
// Value - The list of replication usages for the given vault.
Value *[]ReplicationUsage `json:"value,omitempty"`
}
// Resource ARM Resource.
type Resource struct {
// ID - READ-ONLY; Resource Id represents the complete path to the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name associated with the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
Type *string `json:"type,omitempty"`
// ETag - Optional ETag.
ETag *string `json:"eTag,omitempty"`
}
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if r.ETag != nil {
objectMap["eTag"] = r.ETag
}
return json.Marshal(objectMap)
}
// ResourceCertificateAndAadDetails certificate details representing the Vault credentials for AAD.
type ResourceCertificateAndAadDetails struct {
// AadAuthority - AAD tenant authority.
AadAuthority *string `json:"aadAuthority,omitempty"`
// AadTenantID - AAD tenant Id.
AadTenantID *string `json:"aadTenantId,omitempty"`
// ServicePrincipalClientID - AAD service principal clientId.
ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"`
// ServicePrincipalObjectID - AAD service principal ObjectId.
ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"`
// AzureManagementEndpointAudience - Azure Management Endpoint Audience.
AzureManagementEndpointAudience *string `json:"azureManagementEndpointAudience,omitempty"`
// Certificate - The base64 encoded certificate raw data string.
Certificate *[]byte `json:"certificate,omitempty"`
// FriendlyName - Certificate friendly name.
FriendlyName *string `json:"friendlyName,omitempty"`
// Issuer - Certificate issuer.
Issuer *string `json:"issuer,omitempty"`
// ResourceID - Resource ID of the vault.
ResourceID *int64 `json:"resourceId,omitempty"`
// Subject - Certificate Subject Name.
Subject *string `json:"subject,omitempty"`
// Thumbprint - Certificate thumbprint.
Thumbprint *string `json:"thumbprint,omitempty"`
// ValidFrom - Certificate Validity start Date time.
ValidFrom *date.Time `json:"validFrom,omitempty"`
// ValidTo - Certificate Validity End Date time.
ValidTo *date.Time `json:"validTo,omitempty"`
// AuthType - Possible values include: 'AuthTypeResourceCertificateDetails', 'AuthTypeAzureActiveDirectory', 'AuthTypeAccessControlService'
AuthType AuthTypeBasicResourceCertificateDetails `json:"authType,omitempty"`
}
// MarshalJSON is the custom marshaler for ResourceCertificateAndAadDetails.
func (rcaad ResourceCertificateAndAadDetails) MarshalJSON() ([]byte, error) {
rcaad.AuthType = AuthTypeAzureActiveDirectory
objectMap := make(map[string]interface{})
if rcaad.AadAuthority != nil {
objectMap["aadAuthority"] = rcaad.AadAuthority
}
if rcaad.AadTenantID != nil {
objectMap["aadTenantId"] = rcaad.AadTenantID
}
if rcaad.ServicePrincipalClientID != nil {
objectMap["servicePrincipalClientId"] = rcaad.ServicePrincipalClientID
}
if rcaad.ServicePrincipalObjectID != nil {
objectMap["servicePrincipalObjectId"] = rcaad.ServicePrincipalObjectID
}
if rcaad.AzureManagementEndpointAudience != nil {
objectMap["azureManagementEndpointAudience"] = rcaad.AzureManagementEndpointAudience
}
if rcaad.Certificate != nil {
objectMap["certificate"] = rcaad.Certificate
}
if rcaad.FriendlyName != nil {
objectMap["friendlyName"] = rcaad.FriendlyName
}
if rcaad.Issuer != nil {
objectMap["issuer"] = rcaad.Issuer
}
if rcaad.ResourceID != nil {
objectMap["resourceId"] = rcaad.ResourceID
}
if rcaad.Subject != nil {
objectMap["subject"] = rcaad.Subject
}
if rcaad.Thumbprint != nil {
objectMap["thumbprint"] = rcaad.Thumbprint
}
if rcaad.ValidFrom != nil {
objectMap["validFrom"] = rcaad.ValidFrom
}
if rcaad.ValidTo != nil {
objectMap["validTo"] = rcaad.ValidTo
}
if rcaad.AuthType != "" {
objectMap["authType"] = rcaad.AuthType
}
return json.Marshal(objectMap)
}
// AsResourceCertificateAndAadDetails is the BasicResourceCertificateDetails implementation for ResourceCertificateAndAadDetails.
func (rcaad ResourceCertificateAndAadDetails) AsResourceCertificateAndAadDetails() (*ResourceCertificateAndAadDetails, bool) {
return &rcaad, true
}
// AsResourceCertificateAndAcsDetails is the BasicResourceCertificateDetails implementation for ResourceCertificateAndAadDetails.
func (rcaad ResourceCertificateAndAadDetails) AsResourceCertificateAndAcsDetails() (*ResourceCertificateAndAcsDetails, bool) {
return nil, false
}
// AsResourceCertificateDetails is the BasicResourceCertificateDetails implementation for ResourceCertificateAndAadDetails.
func (rcaad ResourceCertificateAndAadDetails) AsResourceCertificateDetails() (*ResourceCertificateDetails, bool) {
return nil, false
}
// AsBasicResourceCertificateDetails is the BasicResourceCertificateDetails implementation for ResourceCertificateAndAadDetails.
func (rcaad ResourceCertificateAndAadDetails) AsBasicResourceCertificateDetails() (BasicResourceCertificateDetails, bool) {
return &rcaad, true
}
// ResourceCertificateAndAcsDetails certificate details representing the Vault credentials for ACS.
type ResourceCertificateAndAcsDetails struct {
// GlobalAcsNamespace - ACS namespace name - tenant for our service.
GlobalAcsNamespace *string `json:"globalAcsNamespace,omitempty"`
// GlobalAcsHostName - Acs mgmt host name to connect to.
GlobalAcsHostName *string `json:"globalAcsHostName,omitempty"`
// GlobalAcsRPRealm - Global ACS namespace RP realm.
GlobalAcsRPRealm *string `json:"globalAcsRPRealm,omitempty"`
// Certificate - The base64 encoded certificate raw data string.
Certificate *[]byte `json:"certificate,omitempty"`
// FriendlyName - Certificate friendly name.
FriendlyName *string `json:"friendlyName,omitempty"`
// Issuer - Certificate issuer.
Issuer *string `json:"issuer,omitempty"`
// ResourceID - Resource ID of the vault.
ResourceID *int64 `json:"resourceId,omitempty"`
// Subject - Certificate Subject Name.
Subject *string `json:"subject,omitempty"`
// Thumbprint - Certificate thumbprint.
Thumbprint *string `json:"thumbprint,omitempty"`
// ValidFrom - Certificate Validity start Date time.
ValidFrom *date.Time `json:"validFrom,omitempty"`
// ValidTo - Certificate Validity End Date time.
ValidTo *date.Time `json:"validTo,omitempty"`
// AuthType - Possible values include: 'AuthTypeResourceCertificateDetails', 'AuthTypeAzureActiveDirectory', 'AuthTypeAccessControlService'
AuthType AuthTypeBasicResourceCertificateDetails `json:"authType,omitempty"`
}
// MarshalJSON is the custom marshaler for ResourceCertificateAndAcsDetails.
func (rcaad ResourceCertificateAndAcsDetails) MarshalJSON() ([]byte, error) {
rcaad.AuthType = AuthTypeAccessControlService
objectMap := make(map[string]interface{})
if rcaad.GlobalAcsNamespace != nil {
objectMap["globalAcsNamespace"] = rcaad.GlobalAcsNamespace
}
if rcaad.GlobalAcsHostName != nil {
objectMap["globalAcsHostName"] = rcaad.GlobalAcsHostName
}
if rcaad.GlobalAcsRPRealm != nil {
objectMap["globalAcsRPRealm"] = rcaad.GlobalAcsRPRealm
}
if rcaad.Certificate != nil {
objectMap["certificate"] = rcaad.Certificate
}
if rcaad.FriendlyName != nil {
objectMap["friendlyName"] = rcaad.FriendlyName
}
if rcaad.Issuer != nil {
objectMap["issuer"] = rcaad.Issuer
}
if rcaad.ResourceID != nil {
objectMap["resourceId"] = rcaad.ResourceID
}
if rcaad.Subject != nil {
objectMap["subject"] = rcaad.Subject
}
if rcaad.Thumbprint != nil {
objectMap["thumbprint"] = rcaad.Thumbprint
}
if rcaad.ValidFrom != nil {
objectMap["validFrom"] = rcaad.ValidFrom
}
if rcaad.ValidTo != nil {
objectMap["validTo"] = rcaad.ValidTo
}
if rcaad.AuthType != "" {
objectMap["authType"] = rcaad.AuthType
}
return json.Marshal(objectMap)
}
// AsResourceCertificateAndAadDetails is the BasicResourceCertificateDetails implementation for ResourceCertificateAndAcsDetails.
func (rcaad ResourceCertificateAndAcsDetails) AsResourceCertificateAndAadDetails() (*ResourceCertificateAndAadDetails, bool) {
return nil, false
}
// AsResourceCertificateAndAcsDetails is the BasicResourceCertificateDetails implementation for ResourceCertificateAndAcsDetails.
func (rcaad ResourceCertificateAndAcsDetails) AsResourceCertificateAndAcsDetails() (*ResourceCertificateAndAcsDetails, bool) {
return &rcaad, true
}
// AsResourceCertificateDetails is the BasicResourceCertificateDetails implementation for ResourceCertificateAndAcsDetails.
func (rcaad ResourceCertificateAndAcsDetails) AsResourceCertificateDetails() (*ResourceCertificateDetails, bool) {
return nil, false
}
// AsBasicResourceCertificateDetails is the BasicResourceCertificateDetails implementation for ResourceCertificateAndAcsDetails.
func (rcaad ResourceCertificateAndAcsDetails) AsBasicResourceCertificateDetails() (BasicResourceCertificateDetails, bool) {
return &rcaad, true
}
// BasicResourceCertificateDetails certificate details representing the Vault credentials.
type BasicResourceCertificateDetails interface {
AsResourceCertificateAndAadDetails() (*ResourceCertificateAndAadDetails, bool)
AsResourceCertificateAndAcsDetails() (*ResourceCertificateAndAcsDetails, bool)
AsResourceCertificateDetails() (*ResourceCertificateDetails, bool)
}
// ResourceCertificateDetails certificate details representing the Vault credentials.
type ResourceCertificateDetails struct {
// Certificate - The base64 encoded certificate raw data string.
Certificate *[]byte `json:"certificate,omitempty"`
// FriendlyName - Certificate friendly name.
FriendlyName *string `json:"friendlyName,omitempty"`
// Issuer - Certificate issuer.
Issuer *string `json:"issuer,omitempty"`
// ResourceID - Resource ID of the vault.
ResourceID *int64 `json:"resourceId,omitempty"`
// Subject - Certificate Subject Name.
Subject *string `json:"subject,omitempty"`
// Thumbprint - Certificate thumbprint.
Thumbprint *string `json:"thumbprint,omitempty"`
// ValidFrom - Certificate Validity start Date time.
ValidFrom *date.Time `json:"validFrom,omitempty"`
// ValidTo - Certificate Validity End Date time.
ValidTo *date.Time `json:"validTo,omitempty"`
// AuthType - Possible values include: 'AuthTypeResourceCertificateDetails', 'AuthTypeAzureActiveDirectory', 'AuthTypeAccessControlService'
AuthType AuthTypeBasicResourceCertificateDetails `json:"authType,omitempty"`
}
func unmarshalBasicResourceCertificateDetails(body []byte) (BasicResourceCertificateDetails, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["authType"] {
case string(AuthTypeAzureActiveDirectory):
var rcaad ResourceCertificateAndAadDetails
err := json.Unmarshal(body, &rcaad)
return rcaad, err
case string(AuthTypeAccessControlService):
var rcaad ResourceCertificateAndAcsDetails
err := json.Unmarshal(body, &rcaad)
return rcaad, err
default:
var rcd ResourceCertificateDetails
err := json.Unmarshal(body, &rcd)
return rcd, err
}
}
func unmarshalBasicResourceCertificateDetailsArray(body []byte) ([]BasicResourceCertificateDetails, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
rcdArray := make([]BasicResourceCertificateDetails, len(rawMessages))
for index, rawMessage := range rawMessages {
rcd, err := unmarshalBasicResourceCertificateDetails(*rawMessage)
if err != nil {
return nil, err