-
Notifications
You must be signed in to change notification settings - Fork 822
/
models.go
2965 lines (2738 loc) · 113 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 storagesync
// 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/storagesync/mgmt/2020-03-01/storagesync"
// APIError error type
type APIError struct {
// Code - Error code of the given entry.
Code *string `json:"code,omitempty"`
// Message - Error message of the given entry.
Message *string `json:"message,omitempty"`
// Target - Target of the given error entry.
Target *string `json:"target,omitempty"`
// Details - Error details of the given entry.
Details *ErrorDetails `json:"details,omitempty"`
}
// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
type AzureEntityResource struct {
// Etag - READ-ONLY; Resource Etag.
Etag *string `json:"etag,omitempty"`
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for AzureEntityResource.
func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// BackupRequest backup request
type BackupRequest struct {
// AzureFileShare - Azure File Share.
AzureFileShare *string `json:"azureFileShare,omitempty"`
}
// CheckNameAvailabilityParameters parameters for a check name availability request.
type CheckNameAvailabilityParameters struct {
// Name - The name to check for availability
Name *string `json:"name,omitempty"`
// Type - The resource type. Must be set to Microsoft.StorageSync/storageSyncServices
Type *string `json:"type,omitempty"`
}
// CheckNameAvailabilityResult the CheckNameAvailability operation response.
type CheckNameAvailabilityResult struct {
autorest.Response `json:"-"`
// NameAvailable - READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used.
NameAvailable *bool `json:"nameAvailable,omitempty"`
// Reason - READ-ONLY; Gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'Invalid', 'AlreadyExists'
Reason NameAvailabilityReason `json:"reason,omitempty"`
// Message - READ-ONLY; Gets an error message explaining the Reason value in more detail.
Message *string `json:"message,omitempty"`
}
// MarshalJSON is the custom marshaler for CheckNameAvailabilityResult.
func (cnar CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CloudEndpoint cloud Endpoint object.
type CloudEndpoint struct {
autorest.Response `json:"-"`
// CloudEndpointProperties - Cloud Endpoint properties.
*CloudEndpointProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for CloudEndpoint.
func (ce CloudEndpoint) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ce.CloudEndpointProperties != nil {
objectMap["properties"] = ce.CloudEndpointProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for CloudEndpoint struct.
func (ce *CloudEndpoint) 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 cloudEndpointProperties CloudEndpointProperties
err = json.Unmarshal(*v, &cloudEndpointProperties)
if err != nil {
return err
}
ce.CloudEndpointProperties = &cloudEndpointProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ce.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ce.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ce.Type = &typeVar
}
}
}
return nil
}
// CloudEndpointArray array of CloudEndpoint
type CloudEndpointArray struct {
autorest.Response `json:"-"`
// Value - Collection of CloudEndpoint.
Value *[]CloudEndpoint `json:"value,omitempty"`
}
// CloudEndpointCreateParameters the parameters used when creating a cloud endpoint.
type CloudEndpointCreateParameters struct {
// CloudEndpointCreateParametersProperties - The parameters used to create the cloud endpoint.
*CloudEndpointCreateParametersProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for CloudEndpointCreateParameters.
func (cecp CloudEndpointCreateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cecp.CloudEndpointCreateParametersProperties != nil {
objectMap["properties"] = cecp.CloudEndpointCreateParametersProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for CloudEndpointCreateParameters struct.
func (cecp *CloudEndpointCreateParameters) 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 cloudEndpointCreateParametersProperties CloudEndpointCreateParametersProperties
err = json.Unmarshal(*v, &cloudEndpointCreateParametersProperties)
if err != nil {
return err
}
cecp.CloudEndpointCreateParametersProperties = &cloudEndpointCreateParametersProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
cecp.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
cecp.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
cecp.Type = &typeVar
}
}
}
return nil
}
// CloudEndpointCreateParametersProperties cloudEndpoint Properties object.
type CloudEndpointCreateParametersProperties struct {
// StorageAccountResourceID - Storage Account Resource Id
StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
// AzureFileShareName - Azure file share name
AzureFileShareName *string `json:"azureFileShareName,omitempty"`
// StorageAccountTenantID - Storage Account Tenant Id
StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"`
// FriendlyName - Friendly Name
FriendlyName *string `json:"friendlyName,omitempty"`
}
// CloudEndpointProperties cloudEndpoint Properties object.
type CloudEndpointProperties struct {
// StorageAccountResourceID - Storage Account Resource Id
StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
// AzureFileShareName - Azure file share name
AzureFileShareName *string `json:"azureFileShareName,omitempty"`
// StorageAccountTenantID - Storage Account Tenant Id
StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"`
// PartnershipID - Partnership Id
PartnershipID *string `json:"partnershipId,omitempty"`
// FriendlyName - Friendly Name
FriendlyName *string `json:"friendlyName,omitempty"`
// BackupEnabled - READ-ONLY; Backup Enabled
BackupEnabled *string `json:"backupEnabled,omitempty"`
// ProvisioningState - CloudEndpoint Provisioning State
ProvisioningState *string `json:"provisioningState,omitempty"`
// LastWorkflowID - CloudEndpoint lastWorkflowId
LastWorkflowID *string `json:"lastWorkflowId,omitempty"`
// LastOperationName - Resource Last Operation Name
LastOperationName *string `json:"lastOperationName,omitempty"`
}
// MarshalJSON is the custom marshaler for CloudEndpointProperties.
func (cep CloudEndpointProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cep.StorageAccountResourceID != nil {
objectMap["storageAccountResourceId"] = cep.StorageAccountResourceID
}
if cep.AzureFileShareName != nil {
objectMap["azureFileShareName"] = cep.AzureFileShareName
}
if cep.StorageAccountTenantID != nil {
objectMap["storageAccountTenantId"] = cep.StorageAccountTenantID
}
if cep.PartnershipID != nil {
objectMap["partnershipId"] = cep.PartnershipID
}
if cep.FriendlyName != nil {
objectMap["friendlyName"] = cep.FriendlyName
}
if cep.ProvisioningState != nil {
objectMap["provisioningState"] = cep.ProvisioningState
}
if cep.LastWorkflowID != nil {
objectMap["lastWorkflowId"] = cep.LastWorkflowID
}
if cep.LastOperationName != nil {
objectMap["lastOperationName"] = cep.LastOperationName
}
return json.Marshal(objectMap)
}
// CloudEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type CloudEndpointsCreateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(CloudEndpointsClient) (CloudEndpoint, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *CloudEndpointsCreateFuture) 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 CloudEndpointsCreateFuture.Result.
func (future *CloudEndpointsCreateFuture) result(client CloudEndpointsClient) (ce CloudEndpoint, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ce.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsCreateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ce.Response.Response, err = future.GetResult(sender); err == nil && ce.Response.Response.StatusCode != http.StatusNoContent {
ce, err = client.CreateResponder(ce.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", ce.Response.Response, "Failure responding to request")
}
}
return
}
// CloudEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type CloudEndpointsDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(CloudEndpointsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *CloudEndpointsDeleteFuture) 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 CloudEndpointsDeleteFuture.Result.
func (future *CloudEndpointsDeleteFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// CloudEndpointsPostBackupFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type CloudEndpointsPostBackupFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(CloudEndpointsClient) (PostBackupResponse, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *CloudEndpointsPostBackupFuture) 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 CloudEndpointsPostBackupFuture.Result.
func (future *CloudEndpointsPostBackupFuture) result(client CloudEndpointsClient) (pbr PostBackupResponse, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
pbr.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostBackupFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if pbr.Response.Response, err = future.GetResult(sender); err == nil && pbr.Response.Response.StatusCode != http.StatusNoContent {
pbr, err = client.PostBackupResponder(pbr.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", pbr.Response.Response, "Failure responding to request")
}
}
return
}
// CloudEndpointsPostRestoreFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type CloudEndpointsPostRestoreFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(CloudEndpointsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *CloudEndpointsPostRestoreFuture) 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 CloudEndpointsPostRestoreFuture.Result.
func (future *CloudEndpointsPostRestoreFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostRestoreFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostRestoreFuture")
return
}
ar.Response = future.Response()
return
}
// CloudEndpointsPreBackupFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type CloudEndpointsPreBackupFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(CloudEndpointsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *CloudEndpointsPreBackupFuture) 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 CloudEndpointsPreBackupFuture.Result.
func (future *CloudEndpointsPreBackupFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreBackupFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreBackupFuture")
return
}
ar.Response = future.Response()
return
}
// CloudEndpointsPreRestoreFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type CloudEndpointsPreRestoreFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(CloudEndpointsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *CloudEndpointsPreRestoreFuture) 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 CloudEndpointsPreRestoreFuture.Result.
func (future *CloudEndpointsPreRestoreFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreRestoreFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreRestoreFuture")
return
}
ar.Response = future.Response()
return
}
// CloudEndpointsTriggerChangeDetectionFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type CloudEndpointsTriggerChangeDetectionFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(CloudEndpointsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *CloudEndpointsTriggerChangeDetectionFuture) 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 CloudEndpointsTriggerChangeDetectionFuture.Result.
func (future *CloudEndpointsTriggerChangeDetectionFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsTriggerChangeDetectionFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsTriggerChangeDetectionFuture")
return
}
ar.Response = future.Response()
return
}
// CloudTieringCachePerformance server endpoint cloud tiering status object.
type CloudTieringCachePerformance struct {
// LastUpdatedTimestamp - READ-ONLY; Last updated timestamp
LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"`
// CacheHitBytes - READ-ONLY; Count of bytes that were served from the local server
CacheHitBytes *int64 `json:"cacheHitBytes,omitempty"`
// CacheMissBytes - READ-ONLY; Count of bytes that were served from the cloud
CacheMissBytes *int64 `json:"cacheMissBytes,omitempty"`
// CacheHitBytesPercent - READ-ONLY; Percentage of total bytes (hit + miss) that were served from the local server
CacheHitBytesPercent *int32 `json:"cacheHitBytesPercent,omitempty"`
}
// MarshalJSON is the custom marshaler for CloudTieringCachePerformance.
func (ctcp CloudTieringCachePerformance) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CloudTieringDatePolicyStatus status of the date policy
type CloudTieringDatePolicyStatus struct {
// LastUpdatedTimestamp - READ-ONLY; Last updated timestamp
LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"`
// TieredFilesMostRecentAccessTimestamp - READ-ONLY; Most recent access time of tiered files
TieredFilesMostRecentAccessTimestamp *date.Time `json:"tieredFilesMostRecentAccessTimestamp,omitempty"`
}
// MarshalJSON is the custom marshaler for CloudTieringDatePolicyStatus.
func (ctdps CloudTieringDatePolicyStatus) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CloudTieringFilesNotTiering server endpoint cloud tiering status object.
type CloudTieringFilesNotTiering struct {
// LastUpdatedTimestamp - READ-ONLY; Last updated timestamp
LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"`
// TotalFileCount - READ-ONLY; Last cloud tiering result (HResult)
TotalFileCount *int64 `json:"totalFileCount,omitempty"`
// Errors - READ-ONLY; Array of tiering errors
Errors *[]FilesNotTieringError `json:"errors,omitempty"`
}
// MarshalJSON is the custom marshaler for CloudTieringFilesNotTiering.
func (ctfnt CloudTieringFilesNotTiering) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CloudTieringSpaceSavings server endpoint cloud tiering status object.
type CloudTieringSpaceSavings struct {
// LastUpdatedTimestamp - READ-ONLY; Last updated timestamp
LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"`
// VolumeSizeBytes - READ-ONLY; Volume size
VolumeSizeBytes *int64 `json:"volumeSizeBytes,omitempty"`
// TotalSizeCloudBytes - READ-ONLY; Total size of content in the azure file share
TotalSizeCloudBytes *int64 `json:"totalSizeCloudBytes,omitempty"`
// CachedSizeBytes - READ-ONLY; Cached content size on the server
CachedSizeBytes *int64 `json:"cachedSizeBytes,omitempty"`
// SpaceSavingsPercent - READ-ONLY; Percentage of cached size over total size
SpaceSavingsPercent *int32 `json:"spaceSavingsPercent,omitempty"`
// SpaceSavingsBytes - READ-ONLY; Count of bytes saved on the server
SpaceSavingsBytes *int64 `json:"spaceSavingsBytes,omitempty"`
}
// MarshalJSON is the custom marshaler for CloudTieringSpaceSavings.
func (ctss CloudTieringSpaceSavings) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CloudTieringVolumeFreeSpacePolicyStatus status of the volume free space policy
type CloudTieringVolumeFreeSpacePolicyStatus struct {
// LastUpdatedTimestamp - READ-ONLY; Last updated timestamp
LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"`
// EffectiveVolumeFreeSpacePolicy - READ-ONLY; In the case where multiple server endpoints are present in a volume, an effective free space policy is applied.
EffectiveVolumeFreeSpacePolicy *int32 `json:"effectiveVolumeFreeSpacePolicy,omitempty"`
// CurrentVolumeFreeSpacePercent - READ-ONLY; Current volume free space percentage.
CurrentVolumeFreeSpacePercent *int32 `json:"currentVolumeFreeSpacePercent,omitempty"`
}
// MarshalJSON is the custom marshaler for CloudTieringVolumeFreeSpacePolicyStatus.
func (ctvfsps CloudTieringVolumeFreeSpacePolicyStatus) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Error error type
type Error struct {
// Error - Error details of the given entry.
Error *APIError `json:"error,omitempty"`
// Innererror - Error details of the given entry.
Innererror *APIError `json:"innererror,omitempty"`
}
// ErrorDetails error Details object.
type ErrorDetails struct {
// Code - Error code of the given entry.
Code *string `json:"code,omitempty"`
// Message - Error message of the given entry.
Message *string `json:"message,omitempty"`
// Target - Target of the given entry.
Target *string `json:"target,omitempty"`
}
// FilesNotTieringError files not tiering error object
type FilesNotTieringError struct {
// ErrorCode - READ-ONLY; Error code (HResult)
ErrorCode *int32 `json:"errorCode,omitempty"`
// FileCount - READ-ONLY; Count of files with this error
FileCount *int64 `json:"fileCount,omitempty"`
}
// MarshalJSON is the custom marshaler for FilesNotTieringError.
func (fnte FilesNotTieringError) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// OperationDisplayInfo the operation supported by storage sync.
type OperationDisplayInfo struct {
// Description - The description of the operation.
Description *string `json:"description,omitempty"`
// Operation - The action that users can perform, based on their permission level.
Operation *string `json:"operation,omitempty"`
// Provider - Service provider: Microsoft StorageSync.
Provider *string `json:"provider,omitempty"`
// Resource - Resource on which the operation is performed.
Resource *string `json:"resource,omitempty"`
}
// OperationDisplayResource operation Display Resource object.
type OperationDisplayResource struct {
// Provider - Operation Display Resource Provider.
Provider *string `json:"provider,omitempty"`
// Resource - Operation Display Resource.
Resource *string `json:"resource,omitempty"`
// Operation - Operation Display Resource Operation.
Operation *string `json:"operation,omitempty"`
// Description - Operation Display Resource Description.
Description *string `json:"description,omitempty"`
}
// OperationEntity the operation supported by storage sync.
type OperationEntity struct {
// Name - Operation name: {provider}/{resource}/{operation}.
Name *string `json:"name,omitempty"`
// Display - The operation supported by storage sync.
Display *OperationDisplayInfo `json:"display,omitempty"`
// Origin - The origin.
Origin *string `json:"origin,omitempty"`
}
// OperationEntityListResult the list of storage sync operations.
type OperationEntityListResult struct {
autorest.Response `json:"-"`
// NextLink - The link used to get the next page of operations.
NextLink *string `json:"nextLink,omitempty"`
// Value - The list of operations.
Value *[]OperationEntity `json:"value,omitempty"`
}
// OperationEntityListResultIterator provides access to a complete listing of OperationEntity values.
type OperationEntityListResultIterator struct {
i int
page OperationEntityListResultPage
}
// 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 *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.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 *OperationEntityListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter OperationEntityListResultIterator) 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 OperationEntityListResultIterator) Response() OperationEntityListResult {
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 OperationEntityListResultIterator) Value() OperationEntity {
if !iter.page.NotDone() {
return OperationEntity{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the OperationEntityListResultIterator type.
func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator {
return OperationEntityListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (oelr OperationEntityListResult) IsEmpty() bool {
return oelr.Value == nil || len(*oelr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (oelr OperationEntityListResult) hasNextLink() bool {
return oelr.NextLink != nil && len(*oelr.NextLink) != 0
}
// operationEntityListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) {
if !oelr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(oelr.NextLink)))
}
// OperationEntityListResultPage contains a page of OperationEntity values.
type OperationEntityListResultPage struct {
fn func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)
oelr OperationEntityListResult
}
// 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 *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.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.oelr)
if err != nil {
return err
}
page.oelr = 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 *OperationEntityListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page OperationEntityListResultPage) NotDone() bool {
return !page.oelr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page OperationEntityListResultPage) Response() OperationEntityListResult {
return page.oelr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page OperationEntityListResultPage) Values() []OperationEntity {
if page.oelr.IsEmpty() {
return nil
}
return *page.oelr.Value
}
// Creates a new instance of the OperationEntityListResultPage type.
func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage {
return OperationEntityListResultPage{
fn: getNextPage,
oelr: cur,
}
}
// OperationStatus operation status object
type OperationStatus struct {
autorest.Response `json:"-"`
// Name - READ-ONLY; Operation Id
Name *string `json:"name,omitempty"`
// Status - READ-ONLY; Operation status
Status *string `json:"status,omitempty"`
// StartTime - READ-ONLY; Start time of the operation
StartTime *date.Time `json:"startTime,omitempty"`
// EndTime - READ-ONLY; End time of the operation
EndTime *date.Time `json:"endTime,omitempty"`
// Error - READ-ONLY; Error details.
Error *APIError `json:"error,omitempty"`
}
// MarshalJSON is the custom marshaler for OperationStatus.
func (osVar OperationStatus) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// PostBackupResponse post Backup Response
type PostBackupResponse struct {
autorest.Response `json:"-"`
// PostBackupResponseProperties - Post Backup Response Properties
*PostBackupResponseProperties `json:"backupMetadata,omitempty"`
}
// MarshalJSON is the custom marshaler for PostBackupResponse.
func (pbr PostBackupResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if pbr.PostBackupResponseProperties != nil {
objectMap["backupMetadata"] = pbr.PostBackupResponseProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for PostBackupResponse struct.
func (pbr *PostBackupResponse) 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 "backupMetadata":
if v != nil {
var postBackupResponseProperties PostBackupResponseProperties
err = json.Unmarshal(*v, &postBackupResponseProperties)
if err != nil {
return err
}
pbr.PostBackupResponseProperties = &postBackupResponseProperties
}
}
}
return nil
}
// PostBackupResponseProperties post Backup Response Properties object.
type PostBackupResponseProperties struct {
// CloudEndpointName - READ-ONLY; cloud endpoint Name.
CloudEndpointName *string `json:"cloudEndpointName,omitempty"`
}
// MarshalJSON is the custom marshaler for PostBackupResponseProperties.
func (pbrp PostBackupResponseProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// PostRestoreRequest post Restore Request
type PostRestoreRequest struct {
// Partition - Post Restore partition.
Partition *string `json:"partition,omitempty"`
// ReplicaGroup - Post Restore replica group.
ReplicaGroup *string `json:"replicaGroup,omitempty"`
// RequestID - Post Restore request id.
RequestID *string `json:"requestId,omitempty"`
// AzureFileShareURI - Post Restore Azure file share uri.
AzureFileShareURI *string `json:"azureFileShareUri,omitempty"`
// Status - Post Restore Azure status.
Status *string `json:"status,omitempty"`
// SourceAzureFileShareURI - Post Restore Azure source azure file share uri.
SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"`
// FailedFileList - Post Restore Azure failed file list.
FailedFileList *string `json:"failedFileList,omitempty"`
// RestoreFileSpec - Post Restore restore file spec array.
RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"`
}
// PreRestoreRequest pre Restore request object.
type PreRestoreRequest struct {
// Partition - Pre Restore partition.
Partition *string `json:"partition,omitempty"`
// ReplicaGroup - Pre Restore replica group.
ReplicaGroup *string `json:"replicaGroup,omitempty"`
// RequestID - Pre Restore request id.
RequestID *string `json:"requestId,omitempty"`
// AzureFileShareURI - Pre Restore Azure file share uri.
AzureFileShareURI *string `json:"azureFileShareUri,omitempty"`
// Status - Pre Restore Azure status.
Status *string `json:"status,omitempty"`
// SourceAzureFileShareURI - Pre Restore Azure source azure file share uri.
SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"`
// BackupMetadataPropertyBag - Pre Restore backup metadata property bag.
BackupMetadataPropertyBag *string `json:"backupMetadataPropertyBag,omitempty"`
// RestoreFileSpec - Pre Restore restore file spec array.
RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"`
// PauseWaitForSyncDrainTimePeriodInSeconds - Pre Restore pause wait for sync drain time period in seconds.
PauseWaitForSyncDrainTimePeriodInSeconds *int32 `json:"pauseWaitForSyncDrainTimePeriodInSeconds,omitempty"`
}
// PrivateEndpoint the Private Endpoint resource.
type PrivateEndpoint struct {
// ID - READ-ONLY; The ARM identifier for Private Endpoint
ID *string `json:"id,omitempty"`