1 package storsimple
2
3
4
5
6
7
8
9 import (
10 "context"
11 "encoding/json"
12 "github.com/Azure/go-autorest/autorest"
13 "github.com/Azure/go-autorest/autorest/azure"
14 "github.com/Azure/go-autorest/autorest/date"
15 "github.com/Azure/go-autorest/autorest/to"
16 "github.com/Azure/go-autorest/tracing"
17 "net/http"
18 )
19
20
21 const fqdn = "github.com/Azure/azure-sdk-for-go/services/storsimple8000series/mgmt/2017-06-01/storsimple"
22
23
24 type AccessControlRecord struct {
25 autorest.Response `json:"-"`
26
27 *AccessControlRecordProperties `json:"properties,omitempty"`
28
29 ID *string `json:"id,omitempty"`
30
31 Name *string `json:"name,omitempty"`
32
33 Type *string `json:"type,omitempty"`
34
35 Kind Kind `json:"kind,omitempty"`
36 }
37
38
39 func (acr AccessControlRecord) MarshalJSON() ([]byte, error) {
40 objectMap := make(map[string]interface{})
41 if acr.AccessControlRecordProperties != nil {
42 objectMap["properties"] = acr.AccessControlRecordProperties
43 }
44 if acr.Kind != "" {
45 objectMap["kind"] = acr.Kind
46 }
47 return json.Marshal(objectMap)
48 }
49
50
51 func (acr *AccessControlRecord) UnmarshalJSON(body []byte) error {
52 var m map[string]*json.RawMessage
53 err := json.Unmarshal(body, &m)
54 if err != nil {
55 return err
56 }
57 for k, v := range m {
58 switch k {
59 case "properties":
60 if v != nil {
61 var accessControlRecordProperties AccessControlRecordProperties
62 err = json.Unmarshal(*v, &accessControlRecordProperties)
63 if err != nil {
64 return err
65 }
66 acr.AccessControlRecordProperties = &accessControlRecordProperties
67 }
68 case "id":
69 if v != nil {
70 var ID string
71 err = json.Unmarshal(*v, &ID)
72 if err != nil {
73 return err
74 }
75 acr.ID = &ID
76 }
77 case "name":
78 if v != nil {
79 var name string
80 err = json.Unmarshal(*v, &name)
81 if err != nil {
82 return err
83 }
84 acr.Name = &name
85 }
86 case "type":
87 if v != nil {
88 var typeVar string
89 err = json.Unmarshal(*v, &typeVar)
90 if err != nil {
91 return err
92 }
93 acr.Type = &typeVar
94 }
95 case "kind":
96 if v != nil {
97 var kind Kind
98 err = json.Unmarshal(*v, &kind)
99 if err != nil {
100 return err
101 }
102 acr.Kind = kind
103 }
104 }
105 }
106
107 return nil
108 }
109
110
111 type AccessControlRecordList struct {
112 autorest.Response `json:"-"`
113
114 Value *[]AccessControlRecord `json:"value,omitempty"`
115 }
116
117
118 type AccessControlRecordProperties struct {
119
120 InitiatorName *string `json:"initiatorName,omitempty"`
121
122 VolumeCount *int32 `json:"volumeCount,omitempty"`
123 }
124
125
126 func (acrp AccessControlRecordProperties) MarshalJSON() ([]byte, error) {
127 objectMap := make(map[string]interface{})
128 if acrp.InitiatorName != nil {
129 objectMap["initiatorName"] = acrp.InitiatorName
130 }
131 return json.Marshal(objectMap)
132 }
133
134
135
136 type AccessControlRecordsCreateOrUpdateFuture struct {
137 azure.FutureAPI
138
139
140 Result func(AccessControlRecordsClient) (AccessControlRecord, error)
141 }
142
143
144 func (future *AccessControlRecordsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
145 var azFuture azure.Future
146 if err := json.Unmarshal(body, &azFuture); err != nil {
147 return err
148 }
149 future.FutureAPI = &azFuture
150 future.Result = future.result
151 return nil
152 }
153
154
155 func (future *AccessControlRecordsCreateOrUpdateFuture) result(client AccessControlRecordsClient) (acr AccessControlRecord, err error) {
156 var done bool
157 done, err = future.DoneWithContext(context.Background(), client)
158 if err != nil {
159 err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
160 return
161 }
162 if !done {
163 acr.Response.Response = future.Response()
164 err = azure.NewAsyncOpIncompleteError("storsimple.AccessControlRecordsCreateOrUpdateFuture")
165 return
166 }
167 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
168 if acr.Response.Response, err = future.GetResult(sender); err == nil && acr.Response.Response.StatusCode != http.StatusNoContent {
169 acr, err = client.CreateOrUpdateResponder(acr.Response.Response)
170 if err != nil {
171 err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsCreateOrUpdateFuture", "Result", acr.Response.Response, "Failure responding to request")
172 }
173 }
174 return
175 }
176
177
178
179 type AccessControlRecordsDeleteFuture struct {
180 azure.FutureAPI
181
182
183 Result func(AccessControlRecordsClient) (autorest.Response, error)
184 }
185
186
187 func (future *AccessControlRecordsDeleteFuture) UnmarshalJSON(body []byte) error {
188 var azFuture azure.Future
189 if err := json.Unmarshal(body, &azFuture); err != nil {
190 return err
191 }
192 future.FutureAPI = &azFuture
193 future.Result = future.result
194 return nil
195 }
196
197
198 func (future *AccessControlRecordsDeleteFuture) result(client AccessControlRecordsClient) (ar autorest.Response, err error) {
199 var done bool
200 done, err = future.DoneWithContext(context.Background(), client)
201 if err != nil {
202 err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsDeleteFuture", "Result", future.Response(), "Polling failure")
203 return
204 }
205 if !done {
206 ar.Response = future.Response()
207 err = azure.NewAsyncOpIncompleteError("storsimple.AccessControlRecordsDeleteFuture")
208 return
209 }
210 ar.Response = future.Response()
211 return
212 }
213
214
215 type AcsConfiguration struct {
216
217 Namespace *string `json:"namespace,omitempty"`
218
219 Realm *string `json:"realm,omitempty"`
220
221 ServiceURL *string `json:"serviceUrl,omitempty"`
222 }
223
224
225 type Alert struct {
226
227 *AlertProperties `json:"properties,omitempty"`
228
229 ID *string `json:"id,omitempty"`
230
231 Name *string `json:"name,omitempty"`
232
233 Type *string `json:"type,omitempty"`
234
235 Kind Kind `json:"kind,omitempty"`
236 }
237
238
239 func (a Alert) MarshalJSON() ([]byte, error) {
240 objectMap := make(map[string]interface{})
241 if a.AlertProperties != nil {
242 objectMap["properties"] = a.AlertProperties
243 }
244 if a.Kind != "" {
245 objectMap["kind"] = a.Kind
246 }
247 return json.Marshal(objectMap)
248 }
249
250
251 func (a *Alert) UnmarshalJSON(body []byte) error {
252 var m map[string]*json.RawMessage
253 err := json.Unmarshal(body, &m)
254 if err != nil {
255 return err
256 }
257 for k, v := range m {
258 switch k {
259 case "properties":
260 if v != nil {
261 var alertProperties AlertProperties
262 err = json.Unmarshal(*v, &alertProperties)
263 if err != nil {
264 return err
265 }
266 a.AlertProperties = &alertProperties
267 }
268 case "id":
269 if v != nil {
270 var ID string
271 err = json.Unmarshal(*v, &ID)
272 if err != nil {
273 return err
274 }
275 a.ID = &ID
276 }
277 case "name":
278 if v != nil {
279 var name string
280 err = json.Unmarshal(*v, &name)
281 if err != nil {
282 return err
283 }
284 a.Name = &name
285 }
286 case "type":
287 if v != nil {
288 var typeVar string
289 err = json.Unmarshal(*v, &typeVar)
290 if err != nil {
291 return err
292 }
293 a.Type = &typeVar
294 }
295 case "kind":
296 if v != nil {
297 var kind Kind
298 err = json.Unmarshal(*v, &kind)
299 if err != nil {
300 return err
301 }
302 a.Kind = kind
303 }
304 }
305 }
306
307 return nil
308 }
309
310
311 type AlertErrorDetails struct {
312
313 ErrorCode *string `json:"errorCode,omitempty"`
314
315 ErrorMessage *string `json:"errorMessage,omitempty"`
316
317 Occurences *int32 `json:"occurences,omitempty"`
318 }
319
320
321 type AlertFilter struct {
322
323 Status AlertStatus `json:"status,omitempty"`
324
325 Severity AlertSeverity `json:"severity,omitempty"`
326
327 SourceType AlertSourceType `json:"sourceType,omitempty"`
328
329 SourceName *string `json:"sourceName,omitempty"`
330
331 AppearedOnTime *date.Time `json:"appearedOnTime,omitempty"`
332 }
333
334
335 type AlertList struct {
336 autorest.Response `json:"-"`
337
338 Value *[]Alert `json:"value,omitempty"`
339
340 NextLink *string `json:"nextLink,omitempty"`
341 }
342
343
344 type AlertListIterator struct {
345 i int
346 page AlertListPage
347 }
348
349
350
351 func (iter *AlertListIterator) NextWithContext(ctx context.Context) (err error) {
352 if tracing.IsEnabled() {
353 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListIterator.NextWithContext")
354 defer func() {
355 sc := -1
356 if iter.Response().Response.Response != nil {
357 sc = iter.Response().Response.Response.StatusCode
358 }
359 tracing.EndSpan(ctx, sc, err)
360 }()
361 }
362 iter.i++
363 if iter.i < len(iter.page.Values()) {
364 return nil
365 }
366 err = iter.page.NextWithContext(ctx)
367 if err != nil {
368 iter.i--
369 return err
370 }
371 iter.i = 0
372 return nil
373 }
374
375
376
377
378 func (iter *AlertListIterator) Next() error {
379 return iter.NextWithContext(context.Background())
380 }
381
382
383 func (iter AlertListIterator) NotDone() bool {
384 return iter.page.NotDone() && iter.i < len(iter.page.Values())
385 }
386
387
388 func (iter AlertListIterator) Response() AlertList {
389 return iter.page.Response()
390 }
391
392
393
394 func (iter AlertListIterator) Value() Alert {
395 if !iter.page.NotDone() {
396 return Alert{}
397 }
398 return iter.page.Values()[iter.i]
399 }
400
401
402 func NewAlertListIterator(page AlertListPage) AlertListIterator {
403 return AlertListIterator{page: page}
404 }
405
406
407 func (al AlertList) IsEmpty() bool {
408 return al.Value == nil || len(*al.Value) == 0
409 }
410
411
412 func (al AlertList) hasNextLink() bool {
413 return al.NextLink != nil && len(*al.NextLink) != 0
414 }
415
416
417
418 func (al AlertList) alertListPreparer(ctx context.Context) (*http.Request, error) {
419 if !al.hasNextLink() {
420 return nil, nil
421 }
422 return autorest.Prepare((&http.Request{}).WithContext(ctx),
423 autorest.AsJSON(),
424 autorest.AsGet(),
425 autorest.WithBaseURL(to.String(al.NextLink)))
426 }
427
428
429 type AlertListPage struct {
430 fn func(context.Context, AlertList) (AlertList, error)
431 al AlertList
432 }
433
434
435
436 func (page *AlertListPage) NextWithContext(ctx context.Context) (err error) {
437 if tracing.IsEnabled() {
438 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListPage.NextWithContext")
439 defer func() {
440 sc := -1
441 if page.Response().Response.Response != nil {
442 sc = page.Response().Response.Response.StatusCode
443 }
444 tracing.EndSpan(ctx, sc, err)
445 }()
446 }
447 for {
448 next, err := page.fn(ctx, page.al)
449 if err != nil {
450 return err
451 }
452 page.al = next
453 if !next.hasNextLink() || !next.IsEmpty() {
454 break
455 }
456 }
457 return nil
458 }
459
460
461
462
463 func (page *AlertListPage) Next() error {
464 return page.NextWithContext(context.Background())
465 }
466
467
468 func (page AlertListPage) NotDone() bool {
469 return !page.al.IsEmpty()
470 }
471
472
473 func (page AlertListPage) Response() AlertList {
474 return page.al
475 }
476
477
478 func (page AlertListPage) Values() []Alert {
479 if page.al.IsEmpty() {
480 return nil
481 }
482 return *page.al.Value
483 }
484
485
486 func NewAlertListPage(cur AlertList, getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage {
487 return AlertListPage{
488 fn: getNextPage,
489 al: cur,
490 }
491 }
492
493
494 type AlertNotificationProperties struct {
495
496 EmailNotification AlertEmailNotificationStatus `json:"emailNotification,omitempty"`
497
498 AlertNotificationCulture *string `json:"alertNotificationCulture,omitempty"`
499
500 NotificationToServiceOwners AlertEmailNotificationStatus `json:"notificationToServiceOwners,omitempty"`
501
502 AdditionalRecipientEmailList *[]string `json:"additionalRecipientEmailList,omitempty"`
503 }
504
505
506 type AlertProperties struct {
507
508 Title *string `json:"title,omitempty"`
509
510 Scope AlertScope `json:"scope,omitempty"`
511
512 AlertType *string `json:"alertType,omitempty"`
513
514 AppearedAtTime *date.Time `json:"appearedAtTime,omitempty"`
515
516 AppearedAtSourceTime *date.Time `json:"appearedAtSourceTime,omitempty"`
517
518 ClearedAtTime *date.Time `json:"clearedAtTime,omitempty"`
519
520 ClearedAtSourceTime *date.Time `json:"clearedAtSourceTime,omitempty"`
521
522 Source *AlertSource `json:"source,omitempty"`
523
524 Recommendation *string `json:"recommendation,omitempty"`
525
526 ResolutionReason *string `json:"resolutionReason,omitempty"`
527
528 Severity AlertSeverity `json:"severity,omitempty"`
529
530 Status AlertStatus `json:"status,omitempty"`
531
532 ErrorDetails *AlertErrorDetails `json:"errorDetails,omitempty"`
533
534 DetailedInformation map[string]*string `json:"detailedInformation"`
535 }
536
537
538 func (ap AlertProperties) MarshalJSON() ([]byte, error) {
539 objectMap := make(map[string]interface{})
540 if ap.Title != nil {
541 objectMap["title"] = ap.Title
542 }
543 if ap.Scope != "" {
544 objectMap["scope"] = ap.Scope
545 }
546 if ap.AlertType != nil {
547 objectMap["alertType"] = ap.AlertType
548 }
549 if ap.AppearedAtTime != nil {
550 objectMap["appearedAtTime"] = ap.AppearedAtTime
551 }
552 if ap.AppearedAtSourceTime != nil {
553 objectMap["appearedAtSourceTime"] = ap.AppearedAtSourceTime
554 }
555 if ap.ClearedAtTime != nil {
556 objectMap["clearedAtTime"] = ap.ClearedAtTime
557 }
558 if ap.ClearedAtSourceTime != nil {
559 objectMap["clearedAtSourceTime"] = ap.ClearedAtSourceTime
560 }
561 if ap.Source != nil {
562 objectMap["source"] = ap.Source
563 }
564 if ap.Recommendation != nil {
565 objectMap["recommendation"] = ap.Recommendation
566 }
567 if ap.ResolutionReason != nil {
568 objectMap["resolutionReason"] = ap.ResolutionReason
569 }
570 if ap.Severity != "" {
571 objectMap["severity"] = ap.Severity
572 }
573 if ap.Status != "" {
574 objectMap["status"] = ap.Status
575 }
576 if ap.ErrorDetails != nil {
577 objectMap["errorDetails"] = ap.ErrorDetails
578 }
579 if ap.DetailedInformation != nil {
580 objectMap["detailedInformation"] = ap.DetailedInformation
581 }
582 return json.Marshal(objectMap)
583 }
584
585
586 type AlertSettings struct {
587 autorest.Response `json:"-"`
588
589 *AlertNotificationProperties `json:"properties,omitempty"`
590
591 ID *string `json:"id,omitempty"`
592
593 Name *string `json:"name,omitempty"`
594
595 Type *string `json:"type,omitempty"`
596
597 Kind Kind `json:"kind,omitempty"`
598 }
599
600
601 func (as AlertSettings) MarshalJSON() ([]byte, error) {
602 objectMap := make(map[string]interface{})
603 if as.AlertNotificationProperties != nil {
604 objectMap["properties"] = as.AlertNotificationProperties
605 }
606 if as.Kind != "" {
607 objectMap["kind"] = as.Kind
608 }
609 return json.Marshal(objectMap)
610 }
611
612
613 func (as *AlertSettings) UnmarshalJSON(body []byte) error {
614 var m map[string]*json.RawMessage
615 err := json.Unmarshal(body, &m)
616 if err != nil {
617 return err
618 }
619 for k, v := range m {
620 switch k {
621 case "properties":
622 if v != nil {
623 var alertNotificationProperties AlertNotificationProperties
624 err = json.Unmarshal(*v, &alertNotificationProperties)
625 if err != nil {
626 return err
627 }
628 as.AlertNotificationProperties = &alertNotificationProperties
629 }
630 case "id":
631 if v != nil {
632 var ID string
633 err = json.Unmarshal(*v, &ID)
634 if err != nil {
635 return err
636 }
637 as.ID = &ID
638 }
639 case "name":
640 if v != nil {
641 var name string
642 err = json.Unmarshal(*v, &name)
643 if err != nil {
644 return err
645 }
646 as.Name = &name
647 }
648 case "type":
649 if v != nil {
650 var typeVar string
651 err = json.Unmarshal(*v, &typeVar)
652 if err != nil {
653 return err
654 }
655 as.Type = &typeVar
656 }
657 case "kind":
658 if v != nil {
659 var kind Kind
660 err = json.Unmarshal(*v, &kind)
661 if err != nil {
662 return err
663 }
664 as.Kind = kind
665 }
666 }
667 }
668
669 return nil
670 }
671
672
673 type AlertSource struct {
674
675 Name *string `json:"name,omitempty"`
676
677 TimeZone *string `json:"timeZone,omitempty"`
678
679 AlertSourceType AlertSourceType `json:"alertSourceType,omitempty"`
680 }
681
682
683 type AsymmetricEncryptedSecret struct {
684
685 Value *string `json:"value,omitempty"`
686
687 EncryptionCertThumbprint *string `json:"encryptionCertThumbprint,omitempty"`
688
689 EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"`
690 }
691
692
693 type AvailableProviderOperation struct {
694
695 Name *string `json:"name,omitempty"`
696
697 Display *AvailableProviderOperationDisplay `json:"display,omitempty"`
698
699 Origin *string `json:"origin,omitempty"`
700
701 Properties interface{} `json:"properties,omitempty"`
702 }
703
704
705
706
707 type AvailableProviderOperationDisplay struct {
708
709 Provider *string `json:"provider,omitempty"`
710
711 Resource *string `json:"resource,omitempty"`
712
713 Operation *string `json:"operation,omitempty"`
714
715 Description *string `json:"description,omitempty"`
716 }
717
718
719 type AvailableProviderOperationList struct {
720 autorest.Response `json:"-"`
721
722 Value *[]AvailableProviderOperation `json:"value,omitempty"`
723
724 NextLink *string `json:"nextLink,omitempty"`
725 }
726
727
728
729 type AvailableProviderOperationListIterator struct {
730 i int
731 page AvailableProviderOperationListPage
732 }
733
734
735
736 func (iter *AvailableProviderOperationListIterator) NextWithContext(ctx context.Context) (err error) {
737 if tracing.IsEnabled() {
738 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationListIterator.NextWithContext")
739 defer func() {
740 sc := -1
741 if iter.Response().Response.Response != nil {
742 sc = iter.Response().Response.Response.StatusCode
743 }
744 tracing.EndSpan(ctx, sc, err)
745 }()
746 }
747 iter.i++
748 if iter.i < len(iter.page.Values()) {
749 return nil
750 }
751 err = iter.page.NextWithContext(ctx)
752 if err != nil {
753 iter.i--
754 return err
755 }
756 iter.i = 0
757 return nil
758 }
759
760
761
762
763 func (iter *AvailableProviderOperationListIterator) Next() error {
764 return iter.NextWithContext(context.Background())
765 }
766
767
768 func (iter AvailableProviderOperationListIterator) NotDone() bool {
769 return iter.page.NotDone() && iter.i < len(iter.page.Values())
770 }
771
772
773 func (iter AvailableProviderOperationListIterator) Response() AvailableProviderOperationList {
774 return iter.page.Response()
775 }
776
777
778
779 func (iter AvailableProviderOperationListIterator) Value() AvailableProviderOperation {
780 if !iter.page.NotDone() {
781 return AvailableProviderOperation{}
782 }
783 return iter.page.Values()[iter.i]
784 }
785
786
787 func NewAvailableProviderOperationListIterator(page AvailableProviderOperationListPage) AvailableProviderOperationListIterator {
788 return AvailableProviderOperationListIterator{page: page}
789 }
790
791
792 func (apol AvailableProviderOperationList) IsEmpty() bool {
793 return apol.Value == nil || len(*apol.Value) == 0
794 }
795
796
797 func (apol AvailableProviderOperationList) hasNextLink() bool {
798 return apol.NextLink != nil && len(*apol.NextLink) != 0
799 }
800
801
802
803 func (apol AvailableProviderOperationList) availableProviderOperationListPreparer(ctx context.Context) (*http.Request, error) {
804 if !apol.hasNextLink() {
805 return nil, nil
806 }
807 return autorest.Prepare((&http.Request{}).WithContext(ctx),
808 autorest.AsJSON(),
809 autorest.AsGet(),
810 autorest.WithBaseURL(to.String(apol.NextLink)))
811 }
812
813
814 type AvailableProviderOperationListPage struct {
815 fn func(context.Context, AvailableProviderOperationList) (AvailableProviderOperationList, error)
816 apol AvailableProviderOperationList
817 }
818
819
820
821 func (page *AvailableProviderOperationListPage) NextWithContext(ctx context.Context) (err error) {
822 if tracing.IsEnabled() {
823 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationListPage.NextWithContext")
824 defer func() {
825 sc := -1
826 if page.Response().Response.Response != nil {
827 sc = page.Response().Response.Response.StatusCode
828 }
829 tracing.EndSpan(ctx, sc, err)
830 }()
831 }
832 for {
833 next, err := page.fn(ctx, page.apol)
834 if err != nil {
835 return err
836 }
837 page.apol = next
838 if !next.hasNextLink() || !next.IsEmpty() {
839 break
840 }
841 }
842 return nil
843 }
844
845
846
847
848 func (page *AvailableProviderOperationListPage) Next() error {
849 return page.NextWithContext(context.Background())
850 }
851
852
853 func (page AvailableProviderOperationListPage) NotDone() bool {
854 return !page.apol.IsEmpty()
855 }
856
857
858 func (page AvailableProviderOperationListPage) Response() AvailableProviderOperationList {
859 return page.apol
860 }
861
862
863 func (page AvailableProviderOperationListPage) Values() []AvailableProviderOperation {
864 if page.apol.IsEmpty() {
865 return nil
866 }
867 return *page.apol.Value
868 }
869
870
871 func NewAvailableProviderOperationListPage(cur AvailableProviderOperationList, getNextPage func(context.Context, AvailableProviderOperationList) (AvailableProviderOperationList, error)) AvailableProviderOperationListPage {
872 return AvailableProviderOperationListPage{
873 fn: getNextPage,
874 apol: cur,
875 }
876 }
877
878
879 type Backup struct {
880
881 *BackupProperties `json:"properties,omitempty"`
882
883 ID *string `json:"id,omitempty"`
884
885 Name *string `json:"name,omitempty"`
886
887 Type *string `json:"type,omitempty"`
888
889 Kind Kind `json:"kind,omitempty"`
890 }
891
892
893 func (b Backup) MarshalJSON() ([]byte, error) {
894 objectMap := make(map[string]interface{})
895 if b.BackupProperties != nil {
896 objectMap["properties"] = b.BackupProperties
897 }
898 if b.Kind != "" {
899 objectMap["kind"] = b.Kind
900 }
901 return json.Marshal(objectMap)
902 }
903
904
905 func (b *Backup) UnmarshalJSON(body []byte) error {
906 var m map[string]*json.RawMessage
907 err := json.Unmarshal(body, &m)
908 if err != nil {
909 return err
910 }
911 for k, v := range m {
912 switch k {
913 case "properties":
914 if v != nil {
915 var backupProperties BackupProperties
916 err = json.Unmarshal(*v, &backupProperties)
917 if err != nil {
918 return err
919 }
920 b.BackupProperties = &backupProperties
921 }
922 case "id":
923 if v != nil {
924 var ID string
925 err = json.Unmarshal(*v, &ID)
926 if err != nil {
927 return err
928 }
929 b.ID = &ID
930 }
931 case "name":
932 if v != nil {
933 var name string
934 err = json.Unmarshal(*v, &name)
935 if err != nil {
936 return err
937 }
938 b.Name = &name
939 }
940 case "type":
941 if v != nil {
942 var typeVar string
943 err = json.Unmarshal(*v, &typeVar)
944 if err != nil {
945 return err
946 }
947 b.Type = &typeVar
948 }
949 case "kind":
950 if v != nil {
951 var kind Kind
952 err = json.Unmarshal(*v, &kind)
953 if err != nil {
954 return err
955 }
956 b.Kind = kind
957 }
958 }
959 }
960
961 return nil
962 }
963
964
965 type BackupElement struct {
966
967 ElementID *string `json:"elementId,omitempty"`
968
969 ElementName *string `json:"elementName,omitempty"`
970
971 ElementType *string `json:"elementType,omitempty"`
972
973 SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
974
975 VolumeName *string `json:"volumeName,omitempty"`
976
977 VolumeContainerID *string `json:"volumeContainerId,omitempty"`
978
979 VolumeType VolumeType `json:"volumeType,omitempty"`
980 }
981
982
983 type BackupFilter struct {
984
985 BackupPolicyID *string `json:"backupPolicyId,omitempty"`
986
987 VolumeID *string `json:"volumeId,omitempty"`
988
989 CreatedTime *date.Time `json:"createdTime,omitempty"`
990 }
991
992
993 type BackupList struct {
994 autorest.Response `json:"-"`
995
996 Value *[]Backup `json:"value,omitempty"`
997
998 NextLink *string `json:"nextLink,omitempty"`
999 }
1000
1001
1002 type BackupListIterator struct {
1003 i int
1004 page BackupListPage
1005 }
1006
1007
1008
1009 func (iter *BackupListIterator) NextWithContext(ctx context.Context) (err error) {
1010 if tracing.IsEnabled() {
1011 ctx = tracing.StartSpan(ctx, fqdn+"/BackupListIterator.NextWithContext")
1012 defer func() {
1013 sc := -1
1014 if iter.Response().Response.Response != nil {
1015 sc = iter.Response().Response.Response.StatusCode
1016 }
1017 tracing.EndSpan(ctx, sc, err)
1018 }()
1019 }
1020 iter.i++
1021 if iter.i < len(iter.page.Values()) {
1022 return nil
1023 }
1024 err = iter.page.NextWithContext(ctx)
1025 if err != nil {
1026 iter.i--
1027 return err
1028 }
1029 iter.i = 0
1030 return nil
1031 }
1032
1033
1034
1035
1036 func (iter *BackupListIterator) Next() error {
1037 return iter.NextWithContext(context.Background())
1038 }
1039
1040
1041 func (iter BackupListIterator) NotDone() bool {
1042 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1043 }
1044
1045
1046 func (iter BackupListIterator) Response() BackupList {
1047 return iter.page.Response()
1048 }
1049
1050
1051
1052 func (iter BackupListIterator) Value() Backup {
1053 if !iter.page.NotDone() {
1054 return Backup{}
1055 }
1056 return iter.page.Values()[iter.i]
1057 }
1058
1059
1060 func NewBackupListIterator(page BackupListPage) BackupListIterator {
1061 return BackupListIterator{page: page}
1062 }
1063
1064
1065 func (bl BackupList) IsEmpty() bool {
1066 return bl.Value == nil || len(*bl.Value) == 0
1067 }
1068
1069
1070 func (bl BackupList) hasNextLink() bool {
1071 return bl.NextLink != nil && len(*bl.NextLink) != 0
1072 }
1073
1074
1075
1076 func (bl BackupList) backupListPreparer(ctx context.Context) (*http.Request, error) {
1077 if !bl.hasNextLink() {
1078 return nil, nil
1079 }
1080 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1081 autorest.AsJSON(),
1082 autorest.AsGet(),
1083 autorest.WithBaseURL(to.String(bl.NextLink)))
1084 }
1085
1086
1087 type BackupListPage struct {
1088 fn func(context.Context, BackupList) (BackupList, error)
1089 bl BackupList
1090 }
1091
1092
1093
1094 func (page *BackupListPage) NextWithContext(ctx context.Context) (err error) {
1095 if tracing.IsEnabled() {
1096 ctx = tracing.StartSpan(ctx, fqdn+"/BackupListPage.NextWithContext")
1097 defer func() {
1098 sc := -1
1099 if page.Response().Response.Response != nil {
1100 sc = page.Response().Response.Response.StatusCode
1101 }
1102 tracing.EndSpan(ctx, sc, err)
1103 }()
1104 }
1105 for {
1106 next, err := page.fn(ctx, page.bl)
1107 if err != nil {
1108 return err
1109 }
1110 page.bl = next
1111 if !next.hasNextLink() || !next.IsEmpty() {
1112 break
1113 }
1114 }
1115 return nil
1116 }
1117
1118
1119
1120
1121 func (page *BackupListPage) Next() error {
1122 return page.NextWithContext(context.Background())
1123 }
1124
1125
1126 func (page BackupListPage) NotDone() bool {
1127 return !page.bl.IsEmpty()
1128 }
1129
1130
1131 func (page BackupListPage) Response() BackupList {
1132 return page.bl
1133 }
1134
1135
1136 func (page BackupListPage) Values() []Backup {
1137 if page.bl.IsEmpty() {
1138 return nil
1139 }
1140 return *page.bl.Value
1141 }
1142
1143
1144 func NewBackupListPage(cur BackupList, getNextPage func(context.Context, BackupList) (BackupList, error)) BackupListPage {
1145 return BackupListPage{
1146 fn: getNextPage,
1147 bl: cur,
1148 }
1149 }
1150
1151
1152
1153 type BackupPoliciesBackupNowFuture struct {
1154 azure.FutureAPI
1155
1156
1157 Result func(BackupPoliciesClient) (autorest.Response, error)
1158 }
1159
1160
1161 func (future *BackupPoliciesBackupNowFuture) UnmarshalJSON(body []byte) error {
1162 var azFuture azure.Future
1163 if err := json.Unmarshal(body, &azFuture); err != nil {
1164 return err
1165 }
1166 future.FutureAPI = &azFuture
1167 future.Result = future.result
1168 return nil
1169 }
1170
1171
1172 func (future *BackupPoliciesBackupNowFuture) result(client BackupPoliciesClient) (ar autorest.Response, err error) {
1173 var done bool
1174 done, err = future.DoneWithContext(context.Background(), client)
1175 if err != nil {
1176 err = autorest.NewErrorWithError(err, "storsimple.BackupPoliciesBackupNowFuture", "Result", future.Response(), "Polling failure")
1177 return
1178 }
1179 if !done {
1180 ar.Response = future.Response()
1181 err = azure.NewAsyncOpIncompleteError("storsimple.BackupPoliciesBackupNowFuture")
1182 return
1183 }
1184 ar.Response = future.Response()
1185 return
1186 }
1187
1188
1189
1190 type BackupPoliciesCreateOrUpdateFuture struct {
1191 azure.FutureAPI
1192
1193
1194 Result func(BackupPoliciesClient) (BackupPolicy, error)
1195 }
1196
1197
1198 func (future *BackupPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1199 var azFuture azure.Future
1200 if err := json.Unmarshal(body, &azFuture); err != nil {
1201 return err
1202 }
1203 future.FutureAPI = &azFuture
1204 future.Result = future.result
1205 return nil
1206 }
1207
1208
1209 func (future *BackupPoliciesCreateOrUpdateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) {
1210 var done bool
1211 done, err = future.DoneWithContext(context.Background(), client)
1212 if err != nil {
1213 err = autorest.NewErrorWithError(err, "storsimple.BackupPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1214 return
1215 }
1216 if !done {
1217 bp.Response.Response = future.Response()
1218 err = azure.NewAsyncOpIncompleteError("storsimple.BackupPoliciesCreateOrUpdateFuture")
1219 return
1220 }
1221 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1222 if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent {
1223 bp, err = client.CreateOrUpdateResponder(bp.Response.Response)
1224 if err != nil {
1225 err = autorest.NewErrorWithError(err, "storsimple.BackupPoliciesCreateOrUpdateFuture", "Result", bp.Response.Response, "Failure responding to request")
1226 }
1227 }
1228 return
1229 }
1230
1231
1232
1233 type BackupPoliciesDeleteFuture struct {
1234 azure.FutureAPI
1235
1236
1237 Result func(BackupPoliciesClient) (autorest.Response, error)
1238 }
1239
1240
1241 func (future *BackupPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
1242 var azFuture azure.Future
1243 if err := json.Unmarshal(body, &azFuture); err != nil {
1244 return err
1245 }
1246 future.FutureAPI = &azFuture
1247 future.Result = future.result
1248 return nil
1249 }
1250
1251
1252 func (future *BackupPoliciesDeleteFuture) result(client BackupPoliciesClient) (ar autorest.Response, err error) {
1253 var done bool
1254 done, err = future.DoneWithContext(context.Background(), client)
1255 if err != nil {
1256 err = autorest.NewErrorWithError(err, "storsimple.BackupPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
1257 return
1258 }
1259 if !done {
1260 ar.Response = future.Response()
1261 err = azure.NewAsyncOpIncompleteError("storsimple.BackupPoliciesDeleteFuture")
1262 return
1263 }
1264 ar.Response = future.Response()
1265 return
1266 }
1267
1268
1269 type BackupPolicy struct {
1270 autorest.Response `json:"-"`
1271
1272 *BackupPolicyProperties `json:"properties,omitempty"`
1273
1274 ID *string `json:"id,omitempty"`
1275
1276 Name *string `json:"name,omitempty"`
1277
1278 Type *string `json:"type,omitempty"`
1279
1280 Kind Kind `json:"kind,omitempty"`
1281 }
1282
1283
1284 func (bp BackupPolicy) MarshalJSON() ([]byte, error) {
1285 objectMap := make(map[string]interface{})
1286 if bp.BackupPolicyProperties != nil {
1287 objectMap["properties"] = bp.BackupPolicyProperties
1288 }
1289 if bp.Kind != "" {
1290 objectMap["kind"] = bp.Kind
1291 }
1292 return json.Marshal(objectMap)
1293 }
1294
1295
1296 func (bp *BackupPolicy) UnmarshalJSON(body []byte) error {
1297 var m map[string]*json.RawMessage
1298 err := json.Unmarshal(body, &m)
1299 if err != nil {
1300 return err
1301 }
1302 for k, v := range m {
1303 switch k {
1304 case "properties":
1305 if v != nil {
1306 var backupPolicyProperties BackupPolicyProperties
1307 err = json.Unmarshal(*v, &backupPolicyProperties)
1308 if err != nil {
1309 return err
1310 }
1311 bp.BackupPolicyProperties = &backupPolicyProperties
1312 }
1313 case "id":
1314 if v != nil {
1315 var ID string
1316 err = json.Unmarshal(*v, &ID)
1317 if err != nil {
1318 return err
1319 }
1320 bp.ID = &ID
1321 }
1322 case "name":
1323 if v != nil {
1324 var name string
1325 err = json.Unmarshal(*v, &name)
1326 if err != nil {
1327 return err
1328 }
1329 bp.Name = &name
1330 }
1331 case "type":
1332 if v != nil {
1333 var typeVar string
1334 err = json.Unmarshal(*v, &typeVar)
1335 if err != nil {
1336 return err
1337 }
1338 bp.Type = &typeVar
1339 }
1340 case "kind":
1341 if v != nil {
1342 var kind Kind
1343 err = json.Unmarshal(*v, &kind)
1344 if err != nil {
1345 return err
1346 }
1347 bp.Kind = kind
1348 }
1349 }
1350 }
1351
1352 return nil
1353 }
1354
1355
1356 type BackupPolicyList struct {
1357 autorest.Response `json:"-"`
1358
1359 Value *[]BackupPolicy `json:"value,omitempty"`
1360 }
1361
1362
1363 type BackupPolicyProperties struct {
1364
1365 VolumeIds *[]string `json:"volumeIds,omitempty"`
1366
1367 NextBackupTime *date.Time `json:"nextBackupTime,omitempty"`
1368
1369 LastBackupTime *date.Time `json:"lastBackupTime,omitempty"`
1370
1371 SchedulesCount *int64 `json:"schedulesCount,omitempty"`
1372
1373 ScheduledBackupStatus ScheduledBackupStatus `json:"scheduledBackupStatus,omitempty"`
1374
1375 BackupPolicyCreationType BackupPolicyCreationType `json:"backupPolicyCreationType,omitempty"`
1376
1377 SsmHostName *string `json:"ssmHostName,omitempty"`
1378 }
1379
1380
1381 func (bpp BackupPolicyProperties) MarshalJSON() ([]byte, error) {
1382 objectMap := make(map[string]interface{})
1383 if bpp.VolumeIds != nil {
1384 objectMap["volumeIds"] = bpp.VolumeIds
1385 }
1386 return json.Marshal(objectMap)
1387 }
1388
1389
1390 type BackupProperties struct {
1391
1392 CreatedOn *date.Time `json:"createdOn,omitempty"`
1393
1394 SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
1395
1396 BackupType BackupType `json:"backupType,omitempty"`
1397
1398 BackupJobCreationType BackupJobCreationType `json:"backupJobCreationType,omitempty"`
1399
1400 BackupPolicyID *string `json:"backupPolicyId,omitempty"`
1401
1402 SsmHostName *string `json:"ssmHostName,omitempty"`
1403
1404 Elements *[]BackupElement `json:"elements,omitempty"`
1405 }
1406
1407
1408 type BackupSchedule struct {
1409 autorest.Response `json:"-"`
1410
1411 *BackupScheduleProperties `json:"properties,omitempty"`
1412
1413 ID *string `json:"id,omitempty"`
1414
1415 Name *string `json:"name,omitempty"`
1416
1417 Type *string `json:"type,omitempty"`
1418
1419 Kind Kind `json:"kind,omitempty"`
1420 }
1421
1422
1423 func (bs BackupSchedule) MarshalJSON() ([]byte, error) {
1424 objectMap := make(map[string]interface{})
1425 if bs.BackupScheduleProperties != nil {
1426 objectMap["properties"] = bs.BackupScheduleProperties
1427 }
1428 if bs.Kind != "" {
1429 objectMap["kind"] = bs.Kind
1430 }
1431 return json.Marshal(objectMap)
1432 }
1433
1434
1435 func (bs *BackupSchedule) UnmarshalJSON(body []byte) error {
1436 var m map[string]*json.RawMessage
1437 err := json.Unmarshal(body, &m)
1438 if err != nil {
1439 return err
1440 }
1441 for k, v := range m {
1442 switch k {
1443 case "properties":
1444 if v != nil {
1445 var backupScheduleProperties BackupScheduleProperties
1446 err = json.Unmarshal(*v, &backupScheduleProperties)
1447 if err != nil {
1448 return err
1449 }
1450 bs.BackupScheduleProperties = &backupScheduleProperties
1451 }
1452 case "id":
1453 if v != nil {
1454 var ID string
1455 err = json.Unmarshal(*v, &ID)
1456 if err != nil {
1457 return err
1458 }
1459 bs.ID = &ID
1460 }
1461 case "name":
1462 if v != nil {
1463 var name string
1464 err = json.Unmarshal(*v, &name)
1465 if err != nil {
1466 return err
1467 }
1468 bs.Name = &name
1469 }
1470 case "type":
1471 if v != nil {
1472 var typeVar string
1473 err = json.Unmarshal(*v, &typeVar)
1474 if err != nil {
1475 return err
1476 }
1477 bs.Type = &typeVar
1478 }
1479 case "kind":
1480 if v != nil {
1481 var kind Kind
1482 err = json.Unmarshal(*v, &kind)
1483 if err != nil {
1484 return err
1485 }
1486 bs.Kind = kind
1487 }
1488 }
1489 }
1490
1491 return nil
1492 }
1493
1494
1495 type BackupScheduleList struct {
1496 autorest.Response `json:"-"`
1497
1498 Value *[]BackupSchedule `json:"value,omitempty"`
1499 }
1500
1501
1502 type BackupScheduleProperties struct {
1503
1504 ScheduleRecurrence *ScheduleRecurrence `json:"scheduleRecurrence,omitempty"`
1505
1506 BackupType BackupType `json:"backupType,omitempty"`
1507
1508 RetentionCount *int64 `json:"retentionCount,omitempty"`
1509
1510 StartTime *date.Time `json:"startTime,omitempty"`
1511
1512 ScheduleStatus ScheduleStatus `json:"scheduleStatus,omitempty"`
1513
1514 LastSuccessfulRun *date.Time `json:"lastSuccessfulRun,omitempty"`
1515 }
1516
1517
1518 func (bsp BackupScheduleProperties) MarshalJSON() ([]byte, error) {
1519 objectMap := make(map[string]interface{})
1520 if bsp.ScheduleRecurrence != nil {
1521 objectMap["scheduleRecurrence"] = bsp.ScheduleRecurrence
1522 }
1523 if bsp.BackupType != "" {
1524 objectMap["backupType"] = bsp.BackupType
1525 }
1526 if bsp.RetentionCount != nil {
1527 objectMap["retentionCount"] = bsp.RetentionCount
1528 }
1529 if bsp.StartTime != nil {
1530 objectMap["startTime"] = bsp.StartTime
1531 }
1532 if bsp.ScheduleStatus != "" {
1533 objectMap["scheduleStatus"] = bsp.ScheduleStatus
1534 }
1535 return json.Marshal(objectMap)
1536 }
1537
1538
1539
1540 type BackupSchedulesCreateOrUpdateFuture struct {
1541 azure.FutureAPI
1542
1543
1544 Result func(BackupSchedulesClient) (BackupSchedule, error)
1545 }
1546
1547
1548 func (future *BackupSchedulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1549 var azFuture azure.Future
1550 if err := json.Unmarshal(body, &azFuture); err != nil {
1551 return err
1552 }
1553 future.FutureAPI = &azFuture
1554 future.Result = future.result
1555 return nil
1556 }
1557
1558
1559 func (future *BackupSchedulesCreateOrUpdateFuture) result(client BackupSchedulesClient) (bs BackupSchedule, err error) {
1560 var done bool
1561 done, err = future.DoneWithContext(context.Background(), client)
1562 if err != nil {
1563 err = autorest.NewErrorWithError(err, "storsimple.BackupSchedulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1564 return
1565 }
1566 if !done {
1567 bs.Response.Response = future.Response()
1568 err = azure.NewAsyncOpIncompleteError("storsimple.BackupSchedulesCreateOrUpdateFuture")
1569 return
1570 }
1571 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1572 if bs.Response.Response, err = future.GetResult(sender); err == nil && bs.Response.Response.StatusCode != http.StatusNoContent {
1573 bs, err = client.CreateOrUpdateResponder(bs.Response.Response)
1574 if err != nil {
1575 err = autorest.NewErrorWithError(err, "storsimple.BackupSchedulesCreateOrUpdateFuture", "Result", bs.Response.Response, "Failure responding to request")
1576 }
1577 }
1578 return
1579 }
1580
1581
1582
1583 type BackupSchedulesDeleteFuture struct {
1584 azure.FutureAPI
1585
1586
1587 Result func(BackupSchedulesClient) (autorest.Response, error)
1588 }
1589
1590
1591 func (future *BackupSchedulesDeleteFuture) UnmarshalJSON(body []byte) error {
1592 var azFuture azure.Future
1593 if err := json.Unmarshal(body, &azFuture); err != nil {
1594 return err
1595 }
1596 future.FutureAPI = &azFuture
1597 future.Result = future.result
1598 return nil
1599 }
1600
1601
1602 func (future *BackupSchedulesDeleteFuture) result(client BackupSchedulesClient) (ar autorest.Response, err error) {
1603 var done bool
1604 done, err = future.DoneWithContext(context.Background(), client)
1605 if err != nil {
1606 err = autorest.NewErrorWithError(err, "storsimple.BackupSchedulesDeleteFuture", "Result", future.Response(), "Polling failure")
1607 return
1608 }
1609 if !done {
1610 ar.Response = future.Response()
1611 err = azure.NewAsyncOpIncompleteError("storsimple.BackupSchedulesDeleteFuture")
1612 return
1613 }
1614 ar.Response = future.Response()
1615 return
1616 }
1617
1618
1619 type BackupsCloneFuture struct {
1620 azure.FutureAPI
1621
1622
1623 Result func(BackupsClient) (autorest.Response, error)
1624 }
1625
1626
1627 func (future *BackupsCloneFuture) UnmarshalJSON(body []byte) error {
1628 var azFuture azure.Future
1629 if err := json.Unmarshal(body, &azFuture); err != nil {
1630 return err
1631 }
1632 future.FutureAPI = &azFuture
1633 future.Result = future.result
1634 return nil
1635 }
1636
1637
1638 func (future *BackupsCloneFuture) result(client BackupsClient) (ar autorest.Response, err error) {
1639 var done bool
1640 done, err = future.DoneWithContext(context.Background(), client)
1641 if err != nil {
1642 err = autorest.NewErrorWithError(err, "storsimple.BackupsCloneFuture", "Result", future.Response(), "Polling failure")
1643 return
1644 }
1645 if !done {
1646 ar.Response = future.Response()
1647 err = azure.NewAsyncOpIncompleteError("storsimple.BackupsCloneFuture")
1648 return
1649 }
1650 ar.Response = future.Response()
1651 return
1652 }
1653
1654
1655
1656 type BackupsDeleteFuture struct {
1657 azure.FutureAPI
1658
1659
1660 Result func(BackupsClient) (autorest.Response, error)
1661 }
1662
1663
1664 func (future *BackupsDeleteFuture) UnmarshalJSON(body []byte) error {
1665 var azFuture azure.Future
1666 if err := json.Unmarshal(body, &azFuture); err != nil {
1667 return err
1668 }
1669 future.FutureAPI = &azFuture
1670 future.Result = future.result
1671 return nil
1672 }
1673
1674
1675 func (future *BackupsDeleteFuture) result(client BackupsClient) (ar autorest.Response, err error) {
1676 var done bool
1677 done, err = future.DoneWithContext(context.Background(), client)
1678 if err != nil {
1679 err = autorest.NewErrorWithError(err, "storsimple.BackupsDeleteFuture", "Result", future.Response(), "Polling failure")
1680 return
1681 }
1682 if !done {
1683 ar.Response = future.Response()
1684 err = azure.NewAsyncOpIncompleteError("storsimple.BackupsDeleteFuture")
1685 return
1686 }
1687 ar.Response = future.Response()
1688 return
1689 }
1690
1691
1692
1693 type BackupsRestoreFuture struct {
1694 azure.FutureAPI
1695
1696
1697 Result func(BackupsClient) (autorest.Response, error)
1698 }
1699
1700
1701 func (future *BackupsRestoreFuture) UnmarshalJSON(body []byte) error {
1702 var azFuture azure.Future
1703 if err := json.Unmarshal(body, &azFuture); err != nil {
1704 return err
1705 }
1706 future.FutureAPI = &azFuture
1707 future.Result = future.result
1708 return nil
1709 }
1710
1711
1712 func (future *BackupsRestoreFuture) result(client BackupsClient) (ar autorest.Response, err error) {
1713 var done bool
1714 done, err = future.DoneWithContext(context.Background(), client)
1715 if err != nil {
1716 err = autorest.NewErrorWithError(err, "storsimple.BackupsRestoreFuture", "Result", future.Response(), "Polling failure")
1717 return
1718 }
1719 if !done {
1720 ar.Response = future.Response()
1721 err = azure.NewAsyncOpIncompleteError("storsimple.BackupsRestoreFuture")
1722 return
1723 }
1724 ar.Response = future.Response()
1725 return
1726 }
1727
1728
1729 type BandwidthRateSettingProperties struct {
1730
1731 Schedules *[]BandwidthSchedule `json:"schedules,omitempty"`
1732
1733 VolumeCount *int32 `json:"volumeCount,omitempty"`
1734 }
1735
1736
1737 func (brsp BandwidthRateSettingProperties) MarshalJSON() ([]byte, error) {
1738 objectMap := make(map[string]interface{})
1739 if brsp.Schedules != nil {
1740 objectMap["schedules"] = brsp.Schedules
1741 }
1742 return json.Marshal(objectMap)
1743 }
1744
1745
1746 type BandwidthSchedule struct {
1747
1748 Start *Time `json:"start,omitempty"`
1749
1750 Stop *Time `json:"stop,omitempty"`
1751
1752 RateInMbps *int32 `json:"rateInMbps,omitempty"`
1753
1754 Days *[]DayOfWeek `json:"days,omitempty"`
1755 }
1756
1757
1758 type BandwidthSetting struct {
1759 autorest.Response `json:"-"`
1760
1761 *BandwidthRateSettingProperties `json:"properties,omitempty"`
1762
1763 ID *string `json:"id,omitempty"`
1764
1765 Name *string `json:"name,omitempty"`
1766
1767 Type *string `json:"type,omitempty"`
1768
1769 Kind Kind `json:"kind,omitempty"`
1770 }
1771
1772
1773 func (bs BandwidthSetting) MarshalJSON() ([]byte, error) {
1774 objectMap := make(map[string]interface{})
1775 if bs.BandwidthRateSettingProperties != nil {
1776 objectMap["properties"] = bs.BandwidthRateSettingProperties
1777 }
1778 if bs.Kind != "" {
1779 objectMap["kind"] = bs.Kind
1780 }
1781 return json.Marshal(objectMap)
1782 }
1783
1784
1785 func (bs *BandwidthSetting) UnmarshalJSON(body []byte) error {
1786 var m map[string]*json.RawMessage
1787 err := json.Unmarshal(body, &m)
1788 if err != nil {
1789 return err
1790 }
1791 for k, v := range m {
1792 switch k {
1793 case "properties":
1794 if v != nil {
1795 var bandwidthRateSettingProperties BandwidthRateSettingProperties
1796 err = json.Unmarshal(*v, &bandwidthRateSettingProperties)
1797 if err != nil {
1798 return err
1799 }
1800 bs.BandwidthRateSettingProperties = &bandwidthRateSettingProperties
1801 }
1802 case "id":
1803 if v != nil {
1804 var ID string
1805 err = json.Unmarshal(*v, &ID)
1806 if err != nil {
1807 return err
1808 }
1809 bs.ID = &ID
1810 }
1811 case "name":
1812 if v != nil {
1813 var name string
1814 err = json.Unmarshal(*v, &name)
1815 if err != nil {
1816 return err
1817 }
1818 bs.Name = &name
1819 }
1820 case "type":
1821 if v != nil {
1822 var typeVar string
1823 err = json.Unmarshal(*v, &typeVar)
1824 if err != nil {
1825 return err
1826 }
1827 bs.Type = &typeVar
1828 }
1829 case "kind":
1830 if v != nil {
1831 var kind Kind
1832 err = json.Unmarshal(*v, &kind)
1833 if err != nil {
1834 return err
1835 }
1836 bs.Kind = kind
1837 }
1838 }
1839 }
1840
1841 return nil
1842 }
1843
1844
1845 type BandwidthSettingList struct {
1846 autorest.Response `json:"-"`
1847
1848 Value *[]BandwidthSetting `json:"value,omitempty"`
1849 }
1850
1851
1852
1853 type BandwidthSettingsCreateOrUpdateFuture struct {
1854 azure.FutureAPI
1855
1856
1857 Result func(BandwidthSettingsClient) (BandwidthSetting, error)
1858 }
1859
1860
1861 func (future *BandwidthSettingsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1862 var azFuture azure.Future
1863 if err := json.Unmarshal(body, &azFuture); err != nil {
1864 return err
1865 }
1866 future.FutureAPI = &azFuture
1867 future.Result = future.result
1868 return nil
1869 }
1870
1871
1872 func (future *BandwidthSettingsCreateOrUpdateFuture) result(client BandwidthSettingsClient) (bs BandwidthSetting, err error) {
1873 var done bool
1874 done, err = future.DoneWithContext(context.Background(), client)
1875 if err != nil {
1876 err = autorest.NewErrorWithError(err, "storsimple.BandwidthSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1877 return
1878 }
1879 if !done {
1880 bs.Response.Response = future.Response()
1881 err = azure.NewAsyncOpIncompleteError("storsimple.BandwidthSettingsCreateOrUpdateFuture")
1882 return
1883 }
1884 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1885 if bs.Response.Response, err = future.GetResult(sender); err == nil && bs.Response.Response.StatusCode != http.StatusNoContent {
1886 bs, err = client.CreateOrUpdateResponder(bs.Response.Response)
1887 if err != nil {
1888 err = autorest.NewErrorWithError(err, "storsimple.BandwidthSettingsCreateOrUpdateFuture", "Result", bs.Response.Response, "Failure responding to request")
1889 }
1890 }
1891 return
1892 }
1893
1894
1895
1896 type BandwidthSettingsDeleteFuture struct {
1897 azure.FutureAPI
1898
1899
1900 Result func(BandwidthSettingsClient) (autorest.Response, error)
1901 }
1902
1903
1904 func (future *BandwidthSettingsDeleteFuture) UnmarshalJSON(body []byte) error {
1905 var azFuture azure.Future
1906 if err := json.Unmarshal(body, &azFuture); err != nil {
1907 return err
1908 }
1909 future.FutureAPI = &azFuture
1910 future.Result = future.result
1911 return nil
1912 }
1913
1914
1915 func (future *BandwidthSettingsDeleteFuture) result(client BandwidthSettingsClient) (ar autorest.Response, err error) {
1916 var done bool
1917 done, err = future.DoneWithContext(context.Background(), client)
1918 if err != nil {
1919 err = autorest.NewErrorWithError(err, "storsimple.BandwidthSettingsDeleteFuture", "Result", future.Response(), "Polling failure")
1920 return
1921 }
1922 if !done {
1923 ar.Response = future.Response()
1924 err = azure.NewAsyncOpIncompleteError("storsimple.BandwidthSettingsDeleteFuture")
1925 return
1926 }
1927 ar.Response = future.Response()
1928 return
1929 }
1930
1931
1932 type BaseModel struct {
1933
1934 ID *string `json:"id,omitempty"`
1935
1936 Name *string `json:"name,omitempty"`
1937
1938 Type *string `json:"type,omitempty"`
1939
1940 Kind Kind `json:"kind,omitempty"`
1941 }
1942
1943
1944 func (bm BaseModel) MarshalJSON() ([]byte, error) {
1945 objectMap := make(map[string]interface{})
1946 if bm.Kind != "" {
1947 objectMap["kind"] = bm.Kind
1948 }
1949 return json.Marshal(objectMap)
1950 }
1951
1952
1953 type ChapSettings struct {
1954
1955 InitiatorUser *string `json:"initiatorUser,omitempty"`
1956
1957 InitiatorSecret *AsymmetricEncryptedSecret `json:"initiatorSecret,omitempty"`
1958
1959 TargetUser *string `json:"targetUser,omitempty"`
1960
1961 TargetSecret *AsymmetricEncryptedSecret `json:"targetSecret,omitempty"`
1962 }
1963
1964
1965 type ClearAlertRequest struct {
1966
1967 ResolutionMessage *string `json:"resolutionMessage,omitempty"`
1968
1969 Alerts *[]string `json:"alerts,omitempty"`
1970 }
1971
1972
1973 type CloneRequest struct {
1974
1975 TargetDeviceID *string `json:"targetDeviceId,omitempty"`
1976
1977 TargetVolumeName *string `json:"targetVolumeName,omitempty"`
1978
1979 TargetAccessControlRecordIds *[]string `json:"targetAccessControlRecordIds,omitempty"`
1980
1981 BackupElement *BackupElement `json:"backupElement,omitempty"`
1982 }
1983
1984
1985 type CloudAppliance struct {
1986
1987 Name *string `json:"name,omitempty"`
1988
1989 VnetName *string `json:"vnetName,omitempty"`
1990
1991 VnetRegion *string `json:"vnetRegion,omitempty"`
1992
1993 IsVnetDNSConfigured *bool `json:"isVnetDnsConfigured,omitempty"`
1994
1995 IsVnetExpressConfigured *bool `json:"isVnetExpressConfigured,omitempty"`
1996
1997 SubnetName *string `json:"subnetName,omitempty"`
1998
1999 StorageAccountName *string `json:"storageAccountName,omitempty"`
2000
2001 StorageAccountType *string `json:"storageAccountType,omitempty"`
2002
2003 VMType *string `json:"vmType,omitempty"`
2004
2005 VMImageName *string `json:"vmImageName,omitempty"`
2006
2007 ModelNumber *string `json:"modelNumber,omitempty"`
2008 }
2009
2010
2011 type CloudApplianceConfiguration struct {
2012
2013 *CloudApplianceConfigurationProperties `json:"properties,omitempty"`
2014
2015 ID *string `json:"id,omitempty"`
2016
2017 Name *string `json:"name,omitempty"`
2018
2019 Type *string `json:"type,omitempty"`
2020
2021 Kind Kind `json:"kind,omitempty"`
2022 }
2023
2024
2025 func (cac CloudApplianceConfiguration) MarshalJSON() ([]byte, error) {
2026 objectMap := make(map[string]interface{})
2027 if cac.CloudApplianceConfigurationProperties != nil {
2028 objectMap["properties"] = cac.CloudApplianceConfigurationProperties
2029 }
2030 if cac.Kind != "" {
2031 objectMap["kind"] = cac.Kind
2032 }
2033 return json.Marshal(objectMap)
2034 }
2035
2036
2037 func (cac *CloudApplianceConfiguration) UnmarshalJSON(body []byte) error {
2038 var m map[string]*json.RawMessage
2039 err := json.Unmarshal(body, &m)
2040 if err != nil {
2041 return err
2042 }
2043 for k, v := range m {
2044 switch k {
2045 case "properties":
2046 if v != nil {
2047 var cloudApplianceConfigurationProperties CloudApplianceConfigurationProperties
2048 err = json.Unmarshal(*v, &cloudApplianceConfigurationProperties)
2049 if err != nil {
2050 return err
2051 }
2052 cac.CloudApplianceConfigurationProperties = &cloudApplianceConfigurationProperties
2053 }
2054 case "id":
2055 if v != nil {
2056 var ID string
2057 err = json.Unmarshal(*v, &ID)
2058 if err != nil {
2059 return err
2060 }
2061 cac.ID = &ID
2062 }
2063 case "name":
2064 if v != nil {
2065 var name string
2066 err = json.Unmarshal(*v, &name)
2067 if err != nil {
2068 return err
2069 }
2070 cac.Name = &name
2071 }
2072 case "type":
2073 if v != nil {
2074 var typeVar string
2075 err = json.Unmarshal(*v, &typeVar)
2076 if err != nil {
2077 return err
2078 }
2079 cac.Type = &typeVar
2080 }
2081 case "kind":
2082 if v != nil {
2083 var kind Kind
2084 err = json.Unmarshal(*v, &kind)
2085 if err != nil {
2086 return err
2087 }
2088 cac.Kind = kind
2089 }
2090 }
2091 }
2092
2093 return nil
2094 }
2095
2096
2097 type CloudApplianceConfigurationList struct {
2098 autorest.Response `json:"-"`
2099
2100 Value *[]CloudApplianceConfiguration `json:"value,omitempty"`
2101 }
2102
2103
2104 type CloudApplianceConfigurationProperties struct {
2105
2106 ModelNumber *string `json:"modelNumber,omitempty"`
2107
2108 CloudPlatform *string `json:"cloudPlatform,omitempty"`
2109
2110 AcsConfiguration *AcsConfiguration `json:"acsConfiguration,omitempty"`
2111
2112 SupportedStorageAccountTypes *[]string `json:"supportedStorageAccountTypes,omitempty"`
2113
2114 SupportedRegions *[]string `json:"supportedRegions,omitempty"`
2115
2116 SupportedVMTypes *[]string `json:"supportedVmTypes,omitempty"`
2117
2118 SupportedVMImages *[]VMImage `json:"supportedVmImages,omitempty"`
2119 }
2120
2121
2122 type CloudApplianceSettings struct {
2123
2124 ServiceDataEncryptionKey *AsymmetricEncryptedSecret `json:"serviceDataEncryptionKey,omitempty"`
2125
2126 ChannelIntegrityKey *AsymmetricEncryptedSecret `json:"channelIntegrityKey,omitempty"`
2127 }
2128
2129
2130
2131 type CloudAppliancesProvisionFuture struct {
2132 azure.FutureAPI
2133
2134
2135 Result func(CloudAppliancesClient) (autorest.Response, error)
2136 }
2137
2138
2139 func (future *CloudAppliancesProvisionFuture) UnmarshalJSON(body []byte) error {
2140 var azFuture azure.Future
2141 if err := json.Unmarshal(body, &azFuture); err != nil {
2142 return err
2143 }
2144 future.FutureAPI = &azFuture
2145 future.Result = future.result
2146 return nil
2147 }
2148
2149
2150 func (future *CloudAppliancesProvisionFuture) result(client CloudAppliancesClient) (ar autorest.Response, err error) {
2151 var done bool
2152 done, err = future.DoneWithContext(context.Background(), client)
2153 if err != nil {
2154 err = autorest.NewErrorWithError(err, "storsimple.CloudAppliancesProvisionFuture", "Result", future.Response(), "Polling failure")
2155 return
2156 }
2157 if !done {
2158 ar.Response = future.Response()
2159 err = azure.NewAsyncOpIncompleteError("storsimple.CloudAppliancesProvisionFuture")
2160 return
2161 }
2162 ar.Response = future.Response()
2163 return
2164 }
2165
2166
2167 type ConfigureDeviceRequest struct {
2168
2169 *ConfigureDeviceRequestProperties `json:"properties,omitempty"`
2170
2171 ID *string `json:"id,omitempty"`
2172
2173 Name *string `json:"name,omitempty"`
2174
2175 Type *string `json:"type,omitempty"`
2176
2177 Kind Kind `json:"kind,omitempty"`
2178 }
2179
2180
2181 func (cdr ConfigureDeviceRequest) MarshalJSON() ([]byte, error) {
2182 objectMap := make(map[string]interface{})
2183 if cdr.ConfigureDeviceRequestProperties != nil {
2184 objectMap["properties"] = cdr.ConfigureDeviceRequestProperties
2185 }
2186 if cdr.Kind != "" {
2187 objectMap["kind"] = cdr.Kind
2188 }
2189 return json.Marshal(objectMap)
2190 }
2191
2192
2193 func (cdr *ConfigureDeviceRequest) UnmarshalJSON(body []byte) error {
2194 var m map[string]*json.RawMessage
2195 err := json.Unmarshal(body, &m)
2196 if err != nil {
2197 return err
2198 }
2199 for k, v := range m {
2200 switch k {
2201 case "properties":
2202 if v != nil {
2203 var configureDeviceRequestProperties ConfigureDeviceRequestProperties
2204 err = json.Unmarshal(*v, &configureDeviceRequestProperties)
2205 if err != nil {
2206 return err
2207 }
2208 cdr.ConfigureDeviceRequestProperties = &configureDeviceRequestProperties
2209 }
2210 case "id":
2211 if v != nil {
2212 var ID string
2213 err = json.Unmarshal(*v, &ID)
2214 if err != nil {
2215 return err
2216 }
2217 cdr.ID = &ID
2218 }
2219 case "name":
2220 if v != nil {
2221 var name string
2222 err = json.Unmarshal(*v, &name)
2223 if err != nil {
2224 return err
2225 }
2226 cdr.Name = &name
2227 }
2228 case "type":
2229 if v != nil {
2230 var typeVar string
2231 err = json.Unmarshal(*v, &typeVar)
2232 if err != nil {
2233 return err
2234 }
2235 cdr.Type = &typeVar
2236 }
2237 case "kind":
2238 if v != nil {
2239 var kind Kind
2240 err = json.Unmarshal(*v, &kind)
2241 if err != nil {
2242 return err
2243 }
2244 cdr.Kind = kind
2245 }
2246 }
2247 }
2248
2249 return nil
2250 }
2251
2252
2253 type ConfigureDeviceRequestProperties struct {
2254
2255 FriendlyName *string `json:"friendlyName,omitempty"`
2256
2257 CurrentDeviceName *string `json:"currentDeviceName,omitempty"`
2258
2259 TimeZone *string `json:"timeZone,omitempty"`
2260
2261 DNSSettings *SecondaryDNSSettings `json:"dnsSettings,omitempty"`
2262
2263 NetworkInterfaceData0Settings *NetworkInterfaceData0Settings `json:"networkInterfaceData0Settings,omitempty"`
2264 }
2265
2266
2267 type ControllerPowerStateChangeRequest struct {
2268
2269 *ControllerPowerStateChangeRequestProperties `json:"properties,omitempty"`
2270
2271 ID *string `json:"id,omitempty"`
2272
2273 Name *string `json:"name,omitempty"`
2274
2275 Type *string `json:"type,omitempty"`
2276
2277 Kind Kind `json:"kind,omitempty"`
2278 }
2279
2280
2281 func (cpscr ControllerPowerStateChangeRequest) MarshalJSON() ([]byte, error) {
2282 objectMap := make(map[string]interface{})
2283 if cpscr.ControllerPowerStateChangeRequestProperties != nil {
2284 objectMap["properties"] = cpscr.ControllerPowerStateChangeRequestProperties
2285 }
2286 if cpscr.Kind != "" {
2287 objectMap["kind"] = cpscr.Kind
2288 }
2289 return json.Marshal(objectMap)
2290 }
2291
2292
2293 func (cpscr *ControllerPowerStateChangeRequest) UnmarshalJSON(body []byte) error {
2294 var m map[string]*json.RawMessage
2295 err := json.Unmarshal(body, &m)
2296 if err != nil {
2297 return err
2298 }
2299 for k, v := range m {
2300 switch k {
2301 case "properties":
2302 if v != nil {
2303 var controllerPowerStateChangeRequestProperties ControllerPowerStateChangeRequestProperties
2304 err = json.Unmarshal(*v, &controllerPowerStateChangeRequestProperties)
2305 if err != nil {
2306 return err
2307 }
2308 cpscr.ControllerPowerStateChangeRequestProperties = &controllerPowerStateChangeRequestProperties
2309 }
2310 case "id":
2311 if v != nil {
2312 var ID string
2313 err = json.Unmarshal(*v, &ID)
2314 if err != nil {
2315 return err
2316 }
2317 cpscr.ID = &ID
2318 }
2319 case "name":
2320 if v != nil {
2321 var name string
2322 err = json.Unmarshal(*v, &name)
2323 if err != nil {
2324 return err
2325 }
2326 cpscr.Name = &name
2327 }
2328 case "type":
2329 if v != nil {
2330 var typeVar string
2331 err = json.Unmarshal(*v, &typeVar)
2332 if err != nil {
2333 return err
2334 }
2335 cpscr.Type = &typeVar
2336 }
2337 case "kind":
2338 if v != nil {
2339 var kind Kind
2340 err = json.Unmarshal(*v, &kind)
2341 if err != nil {
2342 return err
2343 }
2344 cpscr.Kind = kind
2345 }
2346 }
2347 }
2348
2349 return nil
2350 }
2351
2352
2353 type ControllerPowerStateChangeRequestProperties struct {
2354
2355 Action ControllerPowerStateAction `json:"action,omitempty"`
2356
2357 ActiveController ControllerID `json:"activeController,omitempty"`
2358
2359 Controller0State ControllerStatus `json:"controller0State,omitempty"`
2360
2361 Controller1State ControllerStatus `json:"controller1State,omitempty"`
2362 }
2363
2364
2365
2366 type DataStatistics struct {
2367
2368 TotalData *int64 `json:"totalData,omitempty"`
2369
2370 ProcessedData *int64 `json:"processedData,omitempty"`
2371
2372 CloudData *int64 `json:"cloudData,omitempty"`
2373
2374 Throughput *int64 `json:"throughput,omitempty"`
2375 }
2376
2377
2378 type Device struct {
2379 autorest.Response `json:"-"`
2380
2381 *DeviceProperties `json:"properties,omitempty"`
2382
2383 ID *string `json:"id,omitempty"`
2384
2385 Name *string `json:"name,omitempty"`
2386
2387 Type *string `json:"type,omitempty"`
2388
2389 Kind Kind `json:"kind,omitempty"`
2390 }
2391
2392
2393 func (d Device) MarshalJSON() ([]byte, error) {
2394 objectMap := make(map[string]interface{})
2395 if d.DeviceProperties != nil {
2396 objectMap["properties"] = d.DeviceProperties
2397 }
2398 if d.Kind != "" {
2399 objectMap["kind"] = d.Kind
2400 }
2401 return json.Marshal(objectMap)
2402 }
2403
2404
2405 func (d *Device) UnmarshalJSON(body []byte) error {
2406 var m map[string]*json.RawMessage
2407 err := json.Unmarshal(body, &m)
2408 if err != nil {
2409 return err
2410 }
2411 for k, v := range m {
2412 switch k {
2413 case "properties":
2414 if v != nil {
2415 var deviceProperties DeviceProperties
2416 err = json.Unmarshal(*v, &deviceProperties)
2417 if err != nil {
2418 return err
2419 }
2420 d.DeviceProperties = &deviceProperties
2421 }
2422 case "id":
2423 if v != nil {
2424 var ID string
2425 err = json.Unmarshal(*v, &ID)
2426 if err != nil {
2427 return err
2428 }
2429 d.ID = &ID
2430 }
2431 case "name":
2432 if v != nil {
2433 var name string
2434 err = json.Unmarshal(*v, &name)
2435 if err != nil {
2436 return err
2437 }
2438 d.Name = &name
2439 }
2440 case "type":
2441 if v != nil {
2442 var typeVar string
2443 err = json.Unmarshal(*v, &typeVar)
2444 if err != nil {
2445 return err
2446 }
2447 d.Type = &typeVar
2448 }
2449 case "kind":
2450 if v != nil {
2451 var kind Kind
2452 err = json.Unmarshal(*v, &kind)
2453 if err != nil {
2454 return err
2455 }
2456 d.Kind = kind
2457 }
2458 }
2459 }
2460
2461 return nil
2462 }
2463
2464
2465 type DeviceDetails struct {
2466
2467 EndpointCount *int32 `json:"endpointCount,omitempty"`
2468
2469 VolumeContainerCount *int32 `json:"volumeContainerCount,omitempty"`
2470 }
2471
2472
2473 type DeviceList struct {
2474 autorest.Response `json:"-"`
2475
2476 Value *[]Device `json:"value,omitempty"`
2477 }
2478
2479
2480 type DevicePatch struct {
2481
2482 *DevicePatchProperties `json:"properties,omitempty"`
2483 }
2484
2485
2486 func (dp DevicePatch) MarshalJSON() ([]byte, error) {
2487 objectMap := make(map[string]interface{})
2488 if dp.DevicePatchProperties != nil {
2489 objectMap["properties"] = dp.DevicePatchProperties
2490 }
2491 return json.Marshal(objectMap)
2492 }
2493
2494
2495 func (dp *DevicePatch) UnmarshalJSON(body []byte) error {
2496 var m map[string]*json.RawMessage
2497 err := json.Unmarshal(body, &m)
2498 if err != nil {
2499 return err
2500 }
2501 for k, v := range m {
2502 switch k {
2503 case "properties":
2504 if v != nil {
2505 var devicePatchProperties DevicePatchProperties
2506 err = json.Unmarshal(*v, &devicePatchProperties)
2507 if err != nil {
2508 return err
2509 }
2510 dp.DevicePatchProperties = &devicePatchProperties
2511 }
2512 }
2513 }
2514
2515 return nil
2516 }
2517
2518
2519 type DevicePatchProperties struct {
2520
2521 DeviceDescription *string `json:"deviceDescription,omitempty"`
2522 }
2523
2524
2525 type DeviceProperties struct {
2526
2527 FriendlyName *string `json:"friendlyName,omitempty"`
2528
2529 ActivationTime *date.Time `json:"activationTime,omitempty"`
2530
2531 Culture *string `json:"culture,omitempty"`
2532
2533 DeviceDescription *string `json:"deviceDescription,omitempty"`
2534
2535 DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"`
2536
2537 FriendlySoftwareName *string `json:"friendlySoftwareName,omitempty"`
2538
2539 DeviceConfigurationStatus DeviceConfigurationStatus `json:"deviceConfigurationStatus,omitempty"`
2540
2541 TargetIqn *string `json:"targetIqn,omitempty"`
2542
2543 ModelDescription *string `json:"modelDescription,omitempty"`
2544
2545 Status DeviceStatus `json:"status,omitempty"`
2546
2547 SerialNumber *string `json:"serialNumber,omitempty"`
2548
2549 DeviceType DeviceType `json:"deviceType,omitempty"`
2550
2551 ActiveController ControllerID `json:"activeController,omitempty"`
2552
2553 FriendlySoftwareVersion *string `json:"friendlySoftwareVersion,omitempty"`
2554
2555 AvailableLocalStorageInBytes *int64 `json:"availableLocalStorageInBytes,omitempty"`
2556
2557 AvailableTieredStorageInBytes *int64 `json:"availableTieredStorageInBytes,omitempty"`
2558
2559 ProvisionedTieredStorageInBytes *int64 `json:"provisionedTieredStorageInBytes,omitempty"`
2560
2561 ProvisionedLocalStorageInBytes *int64 `json:"provisionedLocalStorageInBytes,omitempty"`
2562
2563 ProvisionedVolumeSizeInBytes *int64 `json:"provisionedVolumeSizeInBytes,omitempty"`
2564
2565 UsingStorageInBytes *int64 `json:"usingStorageInBytes,omitempty"`
2566
2567 TotalTieredStorageInBytes *int64 `json:"totalTieredStorageInBytes,omitempty"`
2568
2569 AgentGroupVersion *int32 `json:"agentGroupVersion,omitempty"`
2570
2571 NetworkInterfaceCardCount *int32 `json:"networkInterfaceCardCount,omitempty"`
2572
2573 DeviceLocation *string `json:"deviceLocation,omitempty"`
2574
2575 VirtualMachineAPIType VirtualMachineAPIType `json:"virtualMachineApiType,omitempty"`
2576
2577 Details *DeviceDetails `json:"details,omitempty"`
2578
2579 RolloverDetails *DeviceRolloverDetails `json:"rolloverDetails,omitempty"`
2580 }
2581
2582
2583 func (dp DeviceProperties) MarshalJSON() ([]byte, error) {
2584 objectMap := make(map[string]interface{})
2585 if dp.FriendlyName != nil {
2586 objectMap["friendlyName"] = dp.FriendlyName
2587 }
2588 if dp.ActivationTime != nil {
2589 objectMap["activationTime"] = dp.ActivationTime
2590 }
2591 if dp.Culture != nil {
2592 objectMap["culture"] = dp.Culture
2593 }
2594 if dp.DeviceDescription != nil {
2595 objectMap["deviceDescription"] = dp.DeviceDescription
2596 }
2597 if dp.DeviceSoftwareVersion != nil {
2598 objectMap["deviceSoftwareVersion"] = dp.DeviceSoftwareVersion
2599 }
2600 if dp.FriendlySoftwareName != nil {
2601 objectMap["friendlySoftwareName"] = dp.FriendlySoftwareName
2602 }
2603 if dp.DeviceConfigurationStatus != "" {
2604 objectMap["deviceConfigurationStatus"] = dp.DeviceConfigurationStatus
2605 }
2606 if dp.TargetIqn != nil {
2607 objectMap["targetIqn"] = dp.TargetIqn
2608 }
2609 if dp.ModelDescription != nil {
2610 objectMap["modelDescription"] = dp.ModelDescription
2611 }
2612 if dp.Status != "" {
2613 objectMap["status"] = dp.Status
2614 }
2615 if dp.SerialNumber != nil {
2616 objectMap["serialNumber"] = dp.SerialNumber
2617 }
2618 if dp.DeviceType != "" {
2619 objectMap["deviceType"] = dp.DeviceType
2620 }
2621 if dp.ActiveController != "" {
2622 objectMap["activeController"] = dp.ActiveController
2623 }
2624 if dp.FriendlySoftwareVersion != nil {
2625 objectMap["friendlySoftwareVersion"] = dp.FriendlySoftwareVersion
2626 }
2627 if dp.AvailableLocalStorageInBytes != nil {
2628 objectMap["availableLocalStorageInBytes"] = dp.AvailableLocalStorageInBytes
2629 }
2630 if dp.AvailableTieredStorageInBytes != nil {
2631 objectMap["availableTieredStorageInBytes"] = dp.AvailableTieredStorageInBytes
2632 }
2633 if dp.ProvisionedTieredStorageInBytes != nil {
2634 objectMap["provisionedTieredStorageInBytes"] = dp.ProvisionedTieredStorageInBytes
2635 }
2636 if dp.ProvisionedLocalStorageInBytes != nil {
2637 objectMap["provisionedLocalStorageInBytes"] = dp.ProvisionedLocalStorageInBytes
2638 }
2639 if dp.ProvisionedVolumeSizeInBytes != nil {
2640 objectMap["provisionedVolumeSizeInBytes"] = dp.ProvisionedVolumeSizeInBytes
2641 }
2642 if dp.UsingStorageInBytes != nil {
2643 objectMap["usingStorageInBytes"] = dp.UsingStorageInBytes
2644 }
2645 if dp.TotalTieredStorageInBytes != nil {
2646 objectMap["totalTieredStorageInBytes"] = dp.TotalTieredStorageInBytes
2647 }
2648 if dp.AgentGroupVersion != nil {
2649 objectMap["agentGroupVersion"] = dp.AgentGroupVersion
2650 }
2651 if dp.NetworkInterfaceCardCount != nil {
2652 objectMap["networkInterfaceCardCount"] = dp.NetworkInterfaceCardCount
2653 }
2654 if dp.DeviceLocation != nil {
2655 objectMap["deviceLocation"] = dp.DeviceLocation
2656 }
2657 if dp.Details != nil {
2658 objectMap["details"] = dp.Details
2659 }
2660 if dp.RolloverDetails != nil {
2661 objectMap["rolloverDetails"] = dp.RolloverDetails
2662 }
2663 return json.Marshal(objectMap)
2664 }
2665
2666
2667 type DeviceRolloverDetails struct {
2668
2669 AuthorizationEligibility AuthorizationEligibility `json:"authorizationEligibility,omitempty"`
2670
2671 AuthorizationStatus AuthorizationStatus `json:"authorizationStatus,omitempty"`
2672
2673 InEligibilityReason InEligibilityCategory `json:"inEligibilityReason,omitempty"`
2674 }
2675
2676
2677
2678 type DevicesConfigureFuture struct {
2679 azure.FutureAPI
2680
2681
2682 Result func(DevicesClient) (autorest.Response, error)
2683 }
2684
2685
2686 func (future *DevicesConfigureFuture) UnmarshalJSON(body []byte) error {
2687 var azFuture azure.Future
2688 if err := json.Unmarshal(body, &azFuture); err != nil {
2689 return err
2690 }
2691 future.FutureAPI = &azFuture
2692 future.Result = future.result
2693 return nil
2694 }
2695
2696
2697 func (future *DevicesConfigureFuture) result(client DevicesClient) (ar autorest.Response, err error) {
2698 var done bool
2699 done, err = future.DoneWithContext(context.Background(), client)
2700 if err != nil {
2701 err = autorest.NewErrorWithError(err, "storsimple.DevicesConfigureFuture", "Result", future.Response(), "Polling failure")
2702 return
2703 }
2704 if !done {
2705 ar.Response = future.Response()
2706 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesConfigureFuture")
2707 return
2708 }
2709 ar.Response = future.Response()
2710 return
2711 }
2712
2713
2714
2715 type DevicesDeactivateFuture struct {
2716 azure.FutureAPI
2717
2718
2719 Result func(DevicesClient) (autorest.Response, error)
2720 }
2721
2722
2723 func (future *DevicesDeactivateFuture) UnmarshalJSON(body []byte) error {
2724 var azFuture azure.Future
2725 if err := json.Unmarshal(body, &azFuture); err != nil {
2726 return err
2727 }
2728 future.FutureAPI = &azFuture
2729 future.Result = future.result
2730 return nil
2731 }
2732
2733
2734 func (future *DevicesDeactivateFuture) result(client DevicesClient) (ar autorest.Response, err error) {
2735 var done bool
2736 done, err = future.DoneWithContext(context.Background(), client)
2737 if err != nil {
2738 err = autorest.NewErrorWithError(err, "storsimple.DevicesDeactivateFuture", "Result", future.Response(), "Polling failure")
2739 return
2740 }
2741 if !done {
2742 ar.Response = future.Response()
2743 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDeactivateFuture")
2744 return
2745 }
2746 ar.Response = future.Response()
2747 return
2748 }
2749
2750
2751
2752 type DevicesDeleteFuture struct {
2753 azure.FutureAPI
2754
2755
2756 Result func(DevicesClient) (autorest.Response, error)
2757 }
2758
2759
2760 func (future *DevicesDeleteFuture) UnmarshalJSON(body []byte) error {
2761 var azFuture azure.Future
2762 if err := json.Unmarshal(body, &azFuture); err != nil {
2763 return err
2764 }
2765 future.FutureAPI = &azFuture
2766 future.Result = future.result
2767 return nil
2768 }
2769
2770
2771 func (future *DevicesDeleteFuture) result(client DevicesClient) (ar autorest.Response, err error) {
2772 var done bool
2773 done, err = future.DoneWithContext(context.Background(), client)
2774 if err != nil {
2775 err = autorest.NewErrorWithError(err, "storsimple.DevicesDeleteFuture", "Result", future.Response(), "Polling failure")
2776 return
2777 }
2778 if !done {
2779 ar.Response = future.Response()
2780 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDeleteFuture")
2781 return
2782 }
2783 ar.Response = future.Response()
2784 return
2785 }
2786
2787
2788
2789 type DeviceSettingsCreateOrUpdateAlertSettingsFuture struct {
2790 azure.FutureAPI
2791
2792
2793 Result func(DeviceSettingsClient) (AlertSettings, error)
2794 }
2795
2796
2797 func (future *DeviceSettingsCreateOrUpdateAlertSettingsFuture) UnmarshalJSON(body []byte) error {
2798 var azFuture azure.Future
2799 if err := json.Unmarshal(body, &azFuture); err != nil {
2800 return err
2801 }
2802 future.FutureAPI = &azFuture
2803 future.Result = future.result
2804 return nil
2805 }
2806
2807
2808 func (future *DeviceSettingsCreateOrUpdateAlertSettingsFuture) result(client DeviceSettingsClient) (as AlertSettings, err error) {
2809 var done bool
2810 done, err = future.DoneWithContext(context.Background(), client)
2811 if err != nil {
2812 err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsCreateOrUpdateAlertSettingsFuture", "Result", future.Response(), "Polling failure")
2813 return
2814 }
2815 if !done {
2816 as.Response.Response = future.Response()
2817 err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsCreateOrUpdateAlertSettingsFuture")
2818 return
2819 }
2820 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2821 if as.Response.Response, err = future.GetResult(sender); err == nil && as.Response.Response.StatusCode != http.StatusNoContent {
2822 as, err = client.CreateOrUpdateAlertSettingsResponder(as.Response.Response)
2823 if err != nil {
2824 err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsCreateOrUpdateAlertSettingsFuture", "Result", as.Response.Response, "Failure responding to request")
2825 }
2826 }
2827 return
2828 }
2829
2830
2831
2832 type DeviceSettingsCreateOrUpdateTimeSettingsFuture struct {
2833 azure.FutureAPI
2834
2835
2836 Result func(DeviceSettingsClient) (TimeSettings, error)
2837 }
2838
2839
2840 func (future *DeviceSettingsCreateOrUpdateTimeSettingsFuture) UnmarshalJSON(body []byte) error {
2841 var azFuture azure.Future
2842 if err := json.Unmarshal(body, &azFuture); err != nil {
2843 return err
2844 }
2845 future.FutureAPI = &azFuture
2846 future.Result = future.result
2847 return nil
2848 }
2849
2850
2851 func (future *DeviceSettingsCreateOrUpdateTimeSettingsFuture) result(client DeviceSettingsClient) (ts TimeSettings, err error) {
2852 var done bool
2853 done, err = future.DoneWithContext(context.Background(), client)
2854 if err != nil {
2855 err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsCreateOrUpdateTimeSettingsFuture", "Result", future.Response(), "Polling failure")
2856 return
2857 }
2858 if !done {
2859 ts.Response.Response = future.Response()
2860 err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsCreateOrUpdateTimeSettingsFuture")
2861 return
2862 }
2863 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2864 if ts.Response.Response, err = future.GetResult(sender); err == nil && ts.Response.Response.StatusCode != http.StatusNoContent {
2865 ts, err = client.CreateOrUpdateTimeSettingsResponder(ts.Response.Response)
2866 if err != nil {
2867 err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsCreateOrUpdateTimeSettingsFuture", "Result", ts.Response.Response, "Failure responding to request")
2868 }
2869 }
2870 return
2871 }
2872
2873
2874
2875 type DeviceSettingsSyncRemotemanagementCertificateFuture struct {
2876 azure.FutureAPI
2877
2878
2879 Result func(DeviceSettingsClient) (autorest.Response, error)
2880 }
2881
2882
2883 func (future *DeviceSettingsSyncRemotemanagementCertificateFuture) UnmarshalJSON(body []byte) error {
2884 var azFuture azure.Future
2885 if err := json.Unmarshal(body, &azFuture); err != nil {
2886 return err
2887 }
2888 future.FutureAPI = &azFuture
2889 future.Result = future.result
2890 return nil
2891 }
2892
2893
2894 func (future *DeviceSettingsSyncRemotemanagementCertificateFuture) result(client DeviceSettingsClient) (ar autorest.Response, err error) {
2895 var done bool
2896 done, err = future.DoneWithContext(context.Background(), client)
2897 if err != nil {
2898 err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsSyncRemotemanagementCertificateFuture", "Result", future.Response(), "Polling failure")
2899 return
2900 }
2901 if !done {
2902 ar.Response = future.Response()
2903 err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsSyncRemotemanagementCertificateFuture")
2904 return
2905 }
2906 ar.Response = future.Response()
2907 return
2908 }
2909
2910
2911
2912 type DeviceSettingsUpdateNetworkSettingsFuture struct {
2913 azure.FutureAPI
2914
2915
2916 Result func(DeviceSettingsClient) (NetworkSettings, error)
2917 }
2918
2919
2920 func (future *DeviceSettingsUpdateNetworkSettingsFuture) UnmarshalJSON(body []byte) error {
2921 var azFuture azure.Future
2922 if err := json.Unmarshal(body, &azFuture); err != nil {
2923 return err
2924 }
2925 future.FutureAPI = &azFuture
2926 future.Result = future.result
2927 return nil
2928 }
2929
2930
2931 func (future *DeviceSettingsUpdateNetworkSettingsFuture) result(client DeviceSettingsClient) (ns NetworkSettings, err error) {
2932 var done bool
2933 done, err = future.DoneWithContext(context.Background(), client)
2934 if err != nil {
2935 err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsUpdateNetworkSettingsFuture", "Result", future.Response(), "Polling failure")
2936 return
2937 }
2938 if !done {
2939 ns.Response.Response = future.Response()
2940 err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsUpdateNetworkSettingsFuture")
2941 return
2942 }
2943 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2944 if ns.Response.Response, err = future.GetResult(sender); err == nil && ns.Response.Response.StatusCode != http.StatusNoContent {
2945 ns, err = client.UpdateNetworkSettingsResponder(ns.Response.Response)
2946 if err != nil {
2947 err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsUpdateNetworkSettingsFuture", "Result", ns.Response.Response, "Failure responding to request")
2948 }
2949 }
2950 return
2951 }
2952
2953
2954
2955 type DeviceSettingsUpdateSecuritySettingsFuture struct {
2956 azure.FutureAPI
2957
2958
2959 Result func(DeviceSettingsClient) (SecuritySettings, error)
2960 }
2961
2962
2963 func (future *DeviceSettingsUpdateSecuritySettingsFuture) UnmarshalJSON(body []byte) error {
2964 var azFuture azure.Future
2965 if err := json.Unmarshal(body, &azFuture); err != nil {
2966 return err
2967 }
2968 future.FutureAPI = &azFuture
2969 future.Result = future.result
2970 return nil
2971 }
2972
2973
2974 func (future *DeviceSettingsUpdateSecuritySettingsFuture) result(client DeviceSettingsClient) (ss SecuritySettings, err error) {
2975 var done bool
2976 done, err = future.DoneWithContext(context.Background(), client)
2977 if err != nil {
2978 err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsUpdateSecuritySettingsFuture", "Result", future.Response(), "Polling failure")
2979 return
2980 }
2981 if !done {
2982 ss.Response.Response = future.Response()
2983 err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsUpdateSecuritySettingsFuture")
2984 return
2985 }
2986 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2987 if ss.Response.Response, err = future.GetResult(sender); err == nil && ss.Response.Response.StatusCode != http.StatusNoContent {
2988 ss, err = client.UpdateSecuritySettingsResponder(ss.Response.Response)
2989 if err != nil {
2990 err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsUpdateSecuritySettingsFuture", "Result", ss.Response.Response, "Failure responding to request")
2991 }
2992 }
2993 return
2994 }
2995
2996
2997
2998 type DevicesFailoverFuture struct {
2999 azure.FutureAPI
3000
3001
3002 Result func(DevicesClient) (autorest.Response, error)
3003 }
3004
3005
3006 func (future *DevicesFailoverFuture) UnmarshalJSON(body []byte) error {
3007 var azFuture azure.Future
3008 if err := json.Unmarshal(body, &azFuture); err != nil {
3009 return err
3010 }
3011 future.FutureAPI = &azFuture
3012 future.Result = future.result
3013 return nil
3014 }
3015
3016
3017 func (future *DevicesFailoverFuture) result(client DevicesClient) (ar autorest.Response, err error) {
3018 var done bool
3019 done, err = future.DoneWithContext(context.Background(), client)
3020 if err != nil {
3021 err = autorest.NewErrorWithError(err, "storsimple.DevicesFailoverFuture", "Result", future.Response(), "Polling failure")
3022 return
3023 }
3024 if !done {
3025 ar.Response = future.Response()
3026 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesFailoverFuture")
3027 return
3028 }
3029 ar.Response = future.Response()
3030 return
3031 }
3032
3033
3034
3035 type DevicesInstallUpdatesFuture struct {
3036 azure.FutureAPI
3037
3038
3039 Result func(DevicesClient) (autorest.Response, error)
3040 }
3041
3042
3043 func (future *DevicesInstallUpdatesFuture) UnmarshalJSON(body []byte) error {
3044 var azFuture azure.Future
3045 if err := json.Unmarshal(body, &azFuture); err != nil {
3046 return err
3047 }
3048 future.FutureAPI = &azFuture
3049 future.Result = future.result
3050 return nil
3051 }
3052
3053
3054 func (future *DevicesInstallUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) {
3055 var done bool
3056 done, err = future.DoneWithContext(context.Background(), client)
3057 if err != nil {
3058 err = autorest.NewErrorWithError(err, "storsimple.DevicesInstallUpdatesFuture", "Result", future.Response(), "Polling failure")
3059 return
3060 }
3061 if !done {
3062 ar.Response = future.Response()
3063 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesInstallUpdatesFuture")
3064 return
3065 }
3066 ar.Response = future.Response()
3067 return
3068 }
3069
3070
3071
3072 type DevicesScanForUpdatesFuture struct {
3073 azure.FutureAPI
3074
3075
3076 Result func(DevicesClient) (autorest.Response, error)
3077 }
3078
3079
3080 func (future *DevicesScanForUpdatesFuture) UnmarshalJSON(body []byte) error {
3081 var azFuture azure.Future
3082 if err := json.Unmarshal(body, &azFuture); err != nil {
3083 return err
3084 }
3085 future.FutureAPI = &azFuture
3086 future.Result = future.result
3087 return nil
3088 }
3089
3090
3091 func (future *DevicesScanForUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) {
3092 var done bool
3093 done, err = future.DoneWithContext(context.Background(), client)
3094 if err != nil {
3095 err = autorest.NewErrorWithError(err, "storsimple.DevicesScanForUpdatesFuture", "Result", future.Response(), "Polling failure")
3096 return
3097 }
3098 if !done {
3099 ar.Response = future.Response()
3100 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesScanForUpdatesFuture")
3101 return
3102 }
3103 ar.Response = future.Response()
3104 return
3105 }
3106
3107
3108 type DimensionFilter struct {
3109
3110 Name *string `json:"name,omitempty"`
3111
3112 Values *string `json:"values,omitempty"`
3113 }
3114
3115
3116 type DNSSettings struct {
3117
3118 PrimaryDNSServer *string `json:"primaryDnsServer,omitempty"`
3119
3120 PrimaryIpv6DNSServer *string `json:"primaryIpv6DnsServer,omitempty"`
3121
3122 SecondaryDNSServers *[]string `json:"secondaryDnsServers,omitempty"`
3123
3124 SecondaryIpv6DNSServers *[]string `json:"secondaryIpv6DnsServers,omitempty"`
3125 }
3126
3127
3128 type EncryptionSettings struct {
3129 autorest.Response `json:"-"`
3130
3131 *EncryptionSettingsProperties `json:"properties,omitempty"`
3132
3133 ID *string `json:"id,omitempty"`
3134
3135 Name *string `json:"name,omitempty"`
3136
3137 Type *string `json:"type,omitempty"`
3138
3139 Kind Kind `json:"kind,omitempty"`
3140 }
3141
3142
3143 func (es EncryptionSettings) MarshalJSON() ([]byte, error) {
3144 objectMap := make(map[string]interface{})
3145 if es.EncryptionSettingsProperties != nil {
3146 objectMap["properties"] = es.EncryptionSettingsProperties
3147 }
3148 if es.Kind != "" {
3149 objectMap["kind"] = es.Kind
3150 }
3151 return json.Marshal(objectMap)
3152 }
3153
3154
3155 func (es *EncryptionSettings) UnmarshalJSON(body []byte) error {
3156 var m map[string]*json.RawMessage
3157 err := json.Unmarshal(body, &m)
3158 if err != nil {
3159 return err
3160 }
3161 for k, v := range m {
3162 switch k {
3163 case "properties":
3164 if v != nil {
3165 var encryptionSettingsProperties EncryptionSettingsProperties
3166 err = json.Unmarshal(*v, &encryptionSettingsProperties)
3167 if err != nil {
3168 return err
3169 }
3170 es.EncryptionSettingsProperties = &encryptionSettingsProperties
3171 }
3172 case "id":
3173 if v != nil {
3174 var ID string
3175 err = json.Unmarshal(*v, &ID)
3176 if err != nil {
3177 return err
3178 }
3179 es.ID = &ID
3180 }
3181 case "name":
3182 if v != nil {
3183 var name string
3184 err = json.Unmarshal(*v, &name)
3185 if err != nil {
3186 return err
3187 }
3188 es.Name = &name
3189 }
3190 case "type":
3191 if v != nil {
3192 var typeVar string
3193 err = json.Unmarshal(*v, &typeVar)
3194 if err != nil {
3195 return err
3196 }
3197 es.Type = &typeVar
3198 }
3199 case "kind":
3200 if v != nil {
3201 var kind Kind
3202 err = json.Unmarshal(*v, &kind)
3203 if err != nil {
3204 return err
3205 }
3206 es.Kind = kind
3207 }
3208 }
3209 }
3210
3211 return nil
3212 }
3213
3214
3215 type EncryptionSettingsProperties struct {
3216
3217 EncryptionStatus EncryptionStatus `json:"encryptionStatus,omitempty"`
3218
3219 KeyRolloverStatus KeyRolloverStatus `json:"keyRolloverStatus,omitempty"`
3220 }
3221
3222
3223
3224 type FailoverRequest struct {
3225
3226 TargetDeviceID *string `json:"targetDeviceId,omitempty"`
3227
3228 VolumeContainers *[]string `json:"volumeContainers,omitempty"`
3229 }
3230
3231
3232 type FailoverSet struct {
3233
3234 VolumeContainers *[]VolumeContainerFailoverMetadata `json:"volumeContainers,omitempty"`
3235
3236 EligibilityResult *FailoverSetEligibilityResult `json:"eligibilityResult,omitempty"`
3237 }
3238
3239
3240 type FailoverSetEligibilityResult struct {
3241
3242 IsEligibleForFailover *bool `json:"isEligibleForFailover,omitempty"`
3243
3244 ErrorMessage *string `json:"errorMessage,omitempty"`
3245 }
3246
3247
3248 type FailoverSetsList struct {
3249 autorest.Response `json:"-"`
3250
3251 Value *[]FailoverSet `json:"value,omitempty"`
3252 }
3253
3254
3255 type FailoverTarget struct {
3256
3257 DeviceID *string `json:"deviceId,omitempty"`
3258
3259 DeviceStatus DeviceStatus `json:"deviceStatus,omitempty"`
3260
3261 ModelDescription *string `json:"modelDescription,omitempty"`
3262
3263 DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"`
3264
3265 DataContainersCount *int32 `json:"dataContainersCount,omitempty"`
3266
3267 VolumesCount *int32 `json:"volumesCount,omitempty"`
3268
3269 AvailableLocalStorageInBytes *int64 `json:"availableLocalStorageInBytes,omitempty"`
3270
3271 AvailableTieredStorageInBytes *int64 `json:"availableTieredStorageInBytes,omitempty"`
3272
3273 DeviceLocation *string `json:"deviceLocation,omitempty"`
3274
3275 FriendlyDeviceSoftwareVersion *string `json:"friendlyDeviceSoftwareVersion,omitempty"`
3276
3277 EligibilityResult *TargetEligibilityResult `json:"eligibilityResult,omitempty"`
3278 }
3279
3280
3281
3282 type FailoverTargetsList struct {
3283 autorest.Response `json:"-"`
3284
3285 Value *[]FailoverTarget `json:"value,omitempty"`
3286 }
3287
3288
3289 type Feature struct {
3290
3291 Name *string `json:"name,omitempty"`
3292
3293 Status FeatureSupportStatus `json:"status,omitempty"`
3294 }
3295
3296
3297 type FeatureFilter struct {
3298
3299 DeviceID *string `json:"deviceId,omitempty"`
3300 }
3301
3302
3303 type FeatureList struct {
3304 autorest.Response `json:"-"`
3305
3306 Value *[]Feature `json:"value,omitempty"`
3307 }
3308
3309
3310 type HardwareComponent struct {
3311
3312 ComponentID *string `json:"componentId,omitempty"`
3313
3314 DisplayName *string `json:"displayName,omitempty"`
3315
3316 Status HardwareComponentStatus `json:"status,omitempty"`
3317
3318 StatusDisplayName *string `json:"statusDisplayName,omitempty"`
3319 }
3320
3321
3322 type HardwareComponentGroup struct {
3323
3324 *HardwareComponentGroupProperties `json:"properties,omitempty"`
3325
3326 ID *string `json:"id,omitempty"`
3327
3328 Name *string `json:"name,omitempty"`
3329
3330 Type *string `json:"type,omitempty"`
3331
3332 Kind Kind `json:"kind,omitempty"`
3333 }
3334
3335
3336 func (hcg HardwareComponentGroup) MarshalJSON() ([]byte, error) {
3337 objectMap := make(map[string]interface{})
3338 if hcg.HardwareComponentGroupProperties != nil {
3339 objectMap["properties"] = hcg.HardwareComponentGroupProperties
3340 }
3341 if hcg.Kind != "" {
3342 objectMap["kind"] = hcg.Kind
3343 }
3344 return json.Marshal(objectMap)
3345 }
3346
3347
3348 func (hcg *HardwareComponentGroup) UnmarshalJSON(body []byte) error {
3349 var m map[string]*json.RawMessage
3350 err := json.Unmarshal(body, &m)
3351 if err != nil {
3352 return err
3353 }
3354 for k, v := range m {
3355 switch k {
3356 case "properties":
3357 if v != nil {
3358 var hardwareComponentGroupProperties HardwareComponentGroupProperties
3359 err = json.Unmarshal(*v, &hardwareComponentGroupProperties)
3360 if err != nil {
3361 return err
3362 }
3363 hcg.HardwareComponentGroupProperties = &hardwareComponentGroupProperties
3364 }
3365 case "id":
3366 if v != nil {
3367 var ID string
3368 err = json.Unmarshal(*v, &ID)
3369 if err != nil {
3370 return err
3371 }
3372 hcg.ID = &ID
3373 }
3374 case "name":
3375 if v != nil {
3376 var name string
3377 err = json.Unmarshal(*v, &name)
3378 if err != nil {
3379 return err
3380 }
3381 hcg.Name = &name
3382 }
3383 case "type":
3384 if v != nil {
3385 var typeVar string
3386 err = json.Unmarshal(*v, &typeVar)
3387 if err != nil {
3388 return err
3389 }
3390 hcg.Type = &typeVar
3391 }
3392 case "kind":
3393 if v != nil {
3394 var kind Kind
3395 err = json.Unmarshal(*v, &kind)
3396 if err != nil {
3397 return err
3398 }
3399 hcg.Kind = kind
3400 }
3401 }
3402 }
3403
3404 return nil
3405 }
3406
3407
3408 type HardwareComponentGroupList struct {
3409 autorest.Response `json:"-"`
3410
3411 Value *[]HardwareComponentGroup `json:"value,omitempty"`
3412 }
3413
3414
3415 type HardwareComponentGroupProperties struct {
3416
3417 DisplayName *string `json:"displayName,omitempty"`
3418
3419 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
3420
3421 Components *[]HardwareComponent `json:"components,omitempty"`
3422 }
3423
3424
3425
3426 type HardwareComponentGroupsChangeControllerPowerStateFuture struct {
3427 azure.FutureAPI
3428
3429
3430 Result func(HardwareComponentGroupsClient) (autorest.Response, error)
3431 }
3432
3433
3434 func (future *HardwareComponentGroupsChangeControllerPowerStateFuture) UnmarshalJSON(body []byte) error {
3435 var azFuture azure.Future
3436 if err := json.Unmarshal(body, &azFuture); err != nil {
3437 return err
3438 }
3439 future.FutureAPI = &azFuture
3440 future.Result = future.result
3441 return nil
3442 }
3443
3444
3445 func (future *HardwareComponentGroupsChangeControllerPowerStateFuture) result(client HardwareComponentGroupsClient) (ar autorest.Response, err error) {
3446 var done bool
3447 done, err = future.DoneWithContext(context.Background(), client)
3448 if err != nil {
3449 err = autorest.NewErrorWithError(err, "storsimple.HardwareComponentGroupsChangeControllerPowerStateFuture", "Result", future.Response(), "Polling failure")
3450 return
3451 }
3452 if !done {
3453 ar.Response = future.Response()
3454 err = azure.NewAsyncOpIncompleteError("storsimple.HardwareComponentGroupsChangeControllerPowerStateFuture")
3455 return
3456 }
3457 ar.Response = future.Response()
3458 return
3459 }
3460
3461
3462 type Job struct {
3463 autorest.Response `json:"-"`
3464
3465 Status JobStatus `json:"status,omitempty"`
3466
3467 StartTime *date.Time `json:"startTime,omitempty"`
3468
3469 EndTime *date.Time `json:"endTime,omitempty"`
3470
3471 PercentComplete *int32 `json:"percentComplete,omitempty"`
3472
3473 Error *JobErrorDetails `json:"error,omitempty"`
3474
3475 *JobProperties `json:"properties,omitempty"`
3476
3477 ID *string `json:"id,omitempty"`
3478
3479 Name *string `json:"name,omitempty"`
3480
3481 Type *string `json:"type,omitempty"`
3482
3483 Kind Kind `json:"kind,omitempty"`
3484 }
3485
3486
3487 func (j Job) MarshalJSON() ([]byte, error) {
3488 objectMap := make(map[string]interface{})
3489 if j.Status != "" {
3490 objectMap["status"] = j.Status
3491 }
3492 if j.StartTime != nil {
3493 objectMap["startTime"] = j.StartTime
3494 }
3495 if j.EndTime != nil {
3496 objectMap["endTime"] = j.EndTime
3497 }
3498 if j.PercentComplete != nil {
3499 objectMap["percentComplete"] = j.PercentComplete
3500 }
3501 if j.Error != nil {
3502 objectMap["error"] = j.Error
3503 }
3504 if j.JobProperties != nil {
3505 objectMap["properties"] = j.JobProperties
3506 }
3507 if j.Kind != "" {
3508 objectMap["kind"] = j.Kind
3509 }
3510 return json.Marshal(objectMap)
3511 }
3512
3513
3514 func (j *Job) UnmarshalJSON(body []byte) error {
3515 var m map[string]*json.RawMessage
3516 err := json.Unmarshal(body, &m)
3517 if err != nil {
3518 return err
3519 }
3520 for k, v := range m {
3521 switch k {
3522 case "status":
3523 if v != nil {
3524 var status JobStatus
3525 err = json.Unmarshal(*v, &status)
3526 if err != nil {
3527 return err
3528 }
3529 j.Status = status
3530 }
3531 case "startTime":
3532 if v != nil {
3533 var startTime date.Time
3534 err = json.Unmarshal(*v, &startTime)
3535 if err != nil {
3536 return err
3537 }
3538 j.StartTime = &startTime
3539 }
3540 case "endTime":
3541 if v != nil {
3542 var endTime date.Time
3543 err = json.Unmarshal(*v, &endTime)
3544 if err != nil {
3545 return err
3546 }
3547 j.EndTime = &endTime
3548 }
3549 case "percentComplete":
3550 if v != nil {
3551 var percentComplete int32
3552 err = json.Unmarshal(*v, &percentComplete)
3553 if err != nil {
3554 return err
3555 }
3556 j.PercentComplete = &percentComplete
3557 }
3558 case "error":
3559 if v != nil {
3560 var errorVar JobErrorDetails
3561 err = json.Unmarshal(*v, &errorVar)
3562 if err != nil {
3563 return err
3564 }
3565 j.Error = &errorVar
3566 }
3567 case "properties":
3568 if v != nil {
3569 var jobProperties JobProperties
3570 err = json.Unmarshal(*v, &jobProperties)
3571 if err != nil {
3572 return err
3573 }
3574 j.JobProperties = &jobProperties
3575 }
3576 case "id":
3577 if v != nil {
3578 var ID string
3579 err = json.Unmarshal(*v, &ID)
3580 if err != nil {
3581 return err
3582 }
3583 j.ID = &ID
3584 }
3585 case "name":
3586 if v != nil {
3587 var name string
3588 err = json.Unmarshal(*v, &name)
3589 if err != nil {
3590 return err
3591 }
3592 j.Name = &name
3593 }
3594 case "type":
3595 if v != nil {
3596 var typeVar string
3597 err = json.Unmarshal(*v, &typeVar)
3598 if err != nil {
3599 return err
3600 }
3601 j.Type = &typeVar
3602 }
3603 case "kind":
3604 if v != nil {
3605 var kind Kind
3606 err = json.Unmarshal(*v, &kind)
3607 if err != nil {
3608 return err
3609 }
3610 j.Kind = kind
3611 }
3612 }
3613 }
3614
3615 return nil
3616 }
3617
3618
3619 type JobErrorDetails struct {
3620
3621 ErrorDetails *[]JobErrorItem `json:"errorDetails,omitempty"`
3622
3623 Code *string `json:"code,omitempty"`
3624
3625 Message *string `json:"message,omitempty"`
3626 }
3627
3628
3629 type JobErrorItem struct {
3630
3631 Recommendations *[]string `json:"recommendations,omitempty"`
3632
3633 Code *string `json:"code,omitempty"`
3634
3635 Message *string `json:"message,omitempty"`
3636 }
3637
3638
3639 type JobFilter struct {
3640
3641 Status *string `json:"status,omitempty"`
3642
3643 JobType *string `json:"jobType,omitempty"`
3644
3645 StartTime *date.Time `json:"startTime,omitempty"`
3646 }
3647
3648
3649 type JobList struct {
3650 autorest.Response `json:"-"`
3651
3652 Value *[]Job `json:"value,omitempty"`
3653
3654 NextLink *string `json:"nextLink,omitempty"`
3655 }
3656
3657
3658 type JobListIterator struct {
3659 i int
3660 page JobListPage
3661 }
3662
3663
3664
3665 func (iter *JobListIterator) NextWithContext(ctx context.Context) (err error) {
3666 if tracing.IsEnabled() {
3667 ctx = tracing.StartSpan(ctx, fqdn+"/JobListIterator.NextWithContext")
3668 defer func() {
3669 sc := -1
3670 if iter.Response().Response.Response != nil {
3671 sc = iter.Response().Response.Response.StatusCode
3672 }
3673 tracing.EndSpan(ctx, sc, err)
3674 }()
3675 }
3676 iter.i++
3677 if iter.i < len(iter.page.Values()) {
3678 return nil
3679 }
3680 err = iter.page.NextWithContext(ctx)
3681 if err != nil {
3682 iter.i--
3683 return err
3684 }
3685 iter.i = 0
3686 return nil
3687 }
3688
3689
3690
3691
3692 func (iter *JobListIterator) Next() error {
3693 return iter.NextWithContext(context.Background())
3694 }
3695
3696
3697 func (iter JobListIterator) NotDone() bool {
3698 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3699 }
3700
3701
3702 func (iter JobListIterator) Response() JobList {
3703 return iter.page.Response()
3704 }
3705
3706
3707
3708 func (iter JobListIterator) Value() Job {
3709 if !iter.page.NotDone() {
3710 return Job{}
3711 }
3712 return iter.page.Values()[iter.i]
3713 }
3714
3715
3716 func NewJobListIterator(page JobListPage) JobListIterator {
3717 return JobListIterator{page: page}
3718 }
3719
3720
3721 func (jl JobList) IsEmpty() bool {
3722 return jl.Value == nil || len(*jl.Value) == 0
3723 }
3724
3725
3726 func (jl JobList) hasNextLink() bool {
3727 return jl.NextLink != nil && len(*jl.NextLink) != 0
3728 }
3729
3730
3731
3732 func (jl JobList) jobListPreparer(ctx context.Context) (*http.Request, error) {
3733 if !jl.hasNextLink() {
3734 return nil, nil
3735 }
3736 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3737 autorest.AsJSON(),
3738 autorest.AsGet(),
3739 autorest.WithBaseURL(to.String(jl.NextLink)))
3740 }
3741
3742
3743 type JobListPage struct {
3744 fn func(context.Context, JobList) (JobList, error)
3745 jl JobList
3746 }
3747
3748
3749
3750 func (page *JobListPage) NextWithContext(ctx context.Context) (err error) {
3751 if tracing.IsEnabled() {
3752 ctx = tracing.StartSpan(ctx, fqdn+"/JobListPage.NextWithContext")
3753 defer func() {
3754 sc := -1
3755 if page.Response().Response.Response != nil {
3756 sc = page.Response().Response.Response.StatusCode
3757 }
3758 tracing.EndSpan(ctx, sc, err)
3759 }()
3760 }
3761 for {
3762 next, err := page.fn(ctx, page.jl)
3763 if err != nil {
3764 return err
3765 }
3766 page.jl = next
3767 if !next.hasNextLink() || !next.IsEmpty() {
3768 break
3769 }
3770 }
3771 return nil
3772 }
3773
3774
3775
3776
3777 func (page *JobListPage) Next() error {
3778 return page.NextWithContext(context.Background())
3779 }
3780
3781
3782 func (page JobListPage) NotDone() bool {
3783 return !page.jl.IsEmpty()
3784 }
3785
3786
3787 func (page JobListPage) Response() JobList {
3788 return page.jl
3789 }
3790
3791
3792 func (page JobListPage) Values() []Job {
3793 if page.jl.IsEmpty() {
3794 return nil
3795 }
3796 return *page.jl.Value
3797 }
3798
3799
3800 func NewJobListPage(cur JobList, getNextPage func(context.Context, JobList) (JobList, error)) JobListPage {
3801 return JobListPage{
3802 fn: getNextPage,
3803 jl: cur,
3804 }
3805 }
3806
3807
3808 type JobProperties struct {
3809
3810 JobType JobType `json:"jobType,omitempty"`
3811
3812 DataStats *DataStatistics `json:"dataStats,omitempty"`
3813
3814 EntityLabel *string `json:"entityLabel,omitempty"`
3815
3816 EntityType *string `json:"entityType,omitempty"`
3817
3818 JobStages *[]JobStage `json:"jobStages,omitempty"`
3819
3820 DeviceID *string `json:"deviceId,omitempty"`
3821
3822 IsCancellable *bool `json:"isCancellable,omitempty"`
3823
3824 BackupType BackupType `json:"backupType,omitempty"`
3825
3826 SourceDeviceID *string `json:"sourceDeviceId,omitempty"`
3827
3828 BackupPointInTime *date.Time `json:"backupPointInTime,omitempty"`
3829 }
3830
3831
3832 type JobsCancelFuture struct {
3833 azure.FutureAPI
3834
3835
3836 Result func(JobsClient) (autorest.Response, error)
3837 }
3838
3839
3840 func (future *JobsCancelFuture) UnmarshalJSON(body []byte) error {
3841 var azFuture azure.Future
3842 if err := json.Unmarshal(body, &azFuture); err != nil {
3843 return err
3844 }
3845 future.FutureAPI = &azFuture
3846 future.Result = future.result
3847 return nil
3848 }
3849
3850
3851 func (future *JobsCancelFuture) result(client JobsClient) (ar autorest.Response, err error) {
3852 var done bool
3853 done, err = future.DoneWithContext(context.Background(), client)
3854 if err != nil {
3855 err = autorest.NewErrorWithError(err, "storsimple.JobsCancelFuture", "Result", future.Response(), "Polling failure")
3856 return
3857 }
3858 if !done {
3859 ar.Response = future.Response()
3860 err = azure.NewAsyncOpIncompleteError("storsimple.JobsCancelFuture")
3861 return
3862 }
3863 ar.Response = future.Response()
3864 return
3865 }
3866
3867
3868 type JobStage struct {
3869
3870 Message *string `json:"message,omitempty"`
3871
3872 StageStatus JobStatus `json:"stageStatus,omitempty"`
3873
3874 Detail *string `json:"detail,omitempty"`
3875
3876 ErrorCode *string `json:"errorCode,omitempty"`
3877 }
3878
3879
3880 type Key struct {
3881 autorest.Response `json:"-"`
3882
3883 ActivationKey *string `json:"activationKey,omitempty"`
3884 }
3885
3886
3887
3888 type ListFailoverTargetsRequest struct {
3889
3890 VolumeContainers *[]string `json:"volumeContainers,omitempty"`
3891 }
3892
3893
3894 type Manager struct {
3895 autorest.Response `json:"-"`
3896
3897 *ManagerProperties `json:"properties,omitempty"`
3898
3899 Etag *string `json:"etag,omitempty"`
3900
3901 ID *string `json:"id,omitempty"`
3902
3903 Name *string `json:"name,omitempty"`
3904
3905 Type *string `json:"type,omitempty"`
3906
3907 Location *string `json:"location,omitempty"`
3908
3909 Tags map[string]*string `json:"tags"`
3910 }
3911
3912
3913 func (mVar Manager) MarshalJSON() ([]byte, error) {
3914 objectMap := make(map[string]interface{})
3915 if mVar.ManagerProperties != nil {
3916 objectMap["properties"] = mVar.ManagerProperties
3917 }
3918 if mVar.Etag != nil {
3919 objectMap["etag"] = mVar.Etag
3920 }
3921 if mVar.Location != nil {
3922 objectMap["location"] = mVar.Location
3923 }
3924 if mVar.Tags != nil {
3925 objectMap["tags"] = mVar.Tags
3926 }
3927 return json.Marshal(objectMap)
3928 }
3929
3930
3931 func (mVar *Manager) UnmarshalJSON(body []byte) error {
3932 var m map[string]*json.RawMessage
3933 err := json.Unmarshal(body, &m)
3934 if err != nil {
3935 return err
3936 }
3937 for k, v := range m {
3938 switch k {
3939 case "properties":
3940 if v != nil {
3941 var managerProperties ManagerProperties
3942 err = json.Unmarshal(*v, &managerProperties)
3943 if err != nil {
3944 return err
3945 }
3946 mVar.ManagerProperties = &managerProperties
3947 }
3948 case "etag":
3949 if v != nil {
3950 var etag string
3951 err = json.Unmarshal(*v, &etag)
3952 if err != nil {
3953 return err
3954 }
3955 mVar.Etag = &etag
3956 }
3957 case "id":
3958 if v != nil {
3959 var ID string
3960 err = json.Unmarshal(*v, &ID)
3961 if err != nil {
3962 return err
3963 }
3964 mVar.ID = &ID
3965 }
3966 case "name":
3967 if v != nil {
3968 var name string
3969 err = json.Unmarshal(*v, &name)
3970 if err != nil {
3971 return err
3972 }
3973 mVar.Name = &name
3974 }
3975 case "type":
3976 if v != nil {
3977 var typeVar string
3978 err = json.Unmarshal(*v, &typeVar)
3979 if err != nil {
3980 return err
3981 }
3982 mVar.Type = &typeVar
3983 }
3984 case "location":
3985 if v != nil {
3986 var location string
3987 err = json.Unmarshal(*v, &location)
3988 if err != nil {
3989 return err
3990 }
3991 mVar.Location = &location
3992 }
3993 case "tags":
3994 if v != nil {
3995 var tags map[string]*string
3996 err = json.Unmarshal(*v, &tags)
3997 if err != nil {
3998 return err
3999 }
4000 mVar.Tags = tags
4001 }
4002 }
4003 }
4004
4005 return nil
4006 }
4007
4008
4009 type ManagerExtendedInfo struct {
4010 autorest.Response `json:"-"`
4011
4012 *ManagerExtendedInfoProperties `json:"properties,omitempty"`
4013
4014 Etag *string `json:"etag,omitempty"`
4015
4016 ID *string `json:"id,omitempty"`
4017
4018 Name *string `json:"name,omitempty"`
4019
4020 Type *string `json:"type,omitempty"`
4021
4022 Kind Kind `json:"kind,omitempty"`
4023 }
4024
4025
4026 func (mei ManagerExtendedInfo) MarshalJSON() ([]byte, error) {
4027 objectMap := make(map[string]interface{})
4028 if mei.ManagerExtendedInfoProperties != nil {
4029 objectMap["properties"] = mei.ManagerExtendedInfoProperties
4030 }
4031 if mei.Etag != nil {
4032 objectMap["etag"] = mei.Etag
4033 }
4034 if mei.Kind != "" {
4035 objectMap["kind"] = mei.Kind
4036 }
4037 return json.Marshal(objectMap)
4038 }
4039
4040
4041 func (mei *ManagerExtendedInfo) UnmarshalJSON(body []byte) error {
4042 var m map[string]*json.RawMessage
4043 err := json.Unmarshal(body, &m)
4044 if err != nil {
4045 return err
4046 }
4047 for k, v := range m {
4048 switch k {
4049 case "properties":
4050 if v != nil {
4051 var managerExtendedInfoProperties ManagerExtendedInfoProperties
4052 err = json.Unmarshal(*v, &managerExtendedInfoProperties)
4053 if err != nil {
4054 return err
4055 }
4056 mei.ManagerExtendedInfoProperties = &managerExtendedInfoProperties
4057 }
4058 case "etag":
4059 if v != nil {
4060 var etag string
4061 err = json.Unmarshal(*v, &etag)
4062 if err != nil {
4063 return err
4064 }
4065 mei.Etag = &etag
4066 }
4067 case "id":
4068 if v != nil {
4069 var ID string
4070 err = json.Unmarshal(*v, &ID)
4071 if err != nil {
4072 return err
4073 }
4074 mei.ID = &ID
4075 }
4076 case "name":
4077 if v != nil {
4078 var name string
4079 err = json.Unmarshal(*v, &name)
4080 if err != nil {
4081 return err
4082 }
4083 mei.Name = &name
4084 }
4085 case "type":
4086 if v != nil {
4087 var typeVar string
4088 err = json.Unmarshal(*v, &typeVar)
4089 if err != nil {
4090 return err
4091 }
4092 mei.Type = &typeVar
4093 }
4094 case "kind":
4095 if v != nil {
4096 var kind Kind
4097 err = json.Unmarshal(*v, &kind)
4098 if err != nil {
4099 return err
4100 }
4101 mei.Kind = kind
4102 }
4103 }
4104 }
4105
4106 return nil
4107 }
4108
4109
4110 type ManagerExtendedInfoProperties struct {
4111
4112 Version *string `json:"version,omitempty"`
4113
4114 IntegrityKey *string `json:"integrityKey,omitempty"`
4115
4116 EncryptionKey *string `json:"encryptionKey,omitempty"`
4117
4118 EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"`
4119
4120 PortalCertificateThumbprint *string `json:"portalCertificateThumbprint,omitempty"`
4121
4122 Algorithm *string `json:"algorithm,omitempty"`
4123 }
4124
4125
4126 type ManagerIntrinsicSettings struct {
4127
4128 Type ManagerType `json:"type,omitempty"`
4129 }
4130
4131
4132 type ManagerList struct {
4133 autorest.Response `json:"-"`
4134
4135 Value *[]Manager `json:"value,omitempty"`
4136 }
4137
4138
4139 type ManagerPatch struct {
4140
4141 Tags map[string]*string `json:"tags"`
4142 }
4143
4144
4145 func (mp ManagerPatch) MarshalJSON() ([]byte, error) {
4146 objectMap := make(map[string]interface{})
4147 if mp.Tags != nil {
4148 objectMap["tags"] = mp.Tags
4149 }
4150 return json.Marshal(objectMap)
4151 }
4152
4153
4154 type ManagerProperties struct {
4155
4156 CisIntrinsicSettings *ManagerIntrinsicSettings `json:"cisIntrinsicSettings,omitempty"`
4157
4158 Sku *ManagerSku `json:"sku,omitempty"`
4159
4160 ProvisioningState *string `json:"provisioningState,omitempty"`
4161 }
4162
4163
4164 type ManagerSku struct {
4165
4166 Name *string `json:"name,omitempty"`
4167 }
4168
4169
4170 type MetricAvailablity struct {
4171
4172 TimeGrain *string `json:"timeGrain,omitempty"`
4173
4174 Retention *string `json:"retention,omitempty"`
4175 }
4176
4177
4178 type MetricData struct {
4179
4180 TimeStamp *date.Time `json:"timeStamp,omitempty"`
4181
4182 Sum *float64 `json:"sum,omitempty"`
4183
4184 Count *int32 `json:"count,omitempty"`
4185
4186 Average *float64 `json:"average,omitempty"`
4187
4188 Minimum *float64 `json:"minimum,omitempty"`
4189
4190 Maximum *float64 `json:"maximum,omitempty"`
4191 }
4192
4193
4194 type MetricDefinition struct {
4195
4196 Name *MetricName `json:"name,omitempty"`
4197
4198 Unit MetricUnit `json:"unit,omitempty"`
4199
4200 PrimaryAggregationType MetricAggregationType `json:"primaryAggregationType,omitempty"`
4201
4202 ResourceID *string `json:"resourceId,omitempty"`
4203
4204 MetricAvailabilities *[]MetricAvailablity `json:"metricAvailabilities,omitempty"`
4205
4206 Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
4207
4208 Category *string `json:"category,omitempty"`
4209
4210 Type *string `json:"type,omitempty"`
4211 }
4212
4213
4214 type MetricDefinitionList struct {
4215 autorest.Response `json:"-"`
4216
4217 Value *[]MetricDefinition `json:"value,omitempty"`
4218 }
4219
4220
4221 type MetricDimension struct {
4222
4223 Name *string `json:"name,omitempty"`
4224
4225 Value *string `json:"value,omitempty"`
4226 }
4227
4228
4229 type MetricFilter struct {
4230
4231 Name *MetricNameFilter `json:"name,omitempty"`
4232
4233 StartTime *date.Time `json:"startTime,omitempty"`
4234
4235 EndTime *date.Time `json:"endTime,omitempty"`
4236
4237 TimeGrain *string `json:"timeGrain,omitempty"`
4238
4239 Category *string `json:"category,omitempty"`
4240
4241 Dimensions *DimensionFilter `json:"dimensions,omitempty"`
4242 }
4243
4244
4245 type MetricList struct {
4246 autorest.Response `json:"-"`
4247
4248 Value *[]Metrics `json:"value,omitempty"`
4249 }
4250
4251
4252 type MetricName struct {
4253
4254 Value *string `json:"value,omitempty"`
4255
4256 LocalizedValue *string `json:"localizedValue,omitempty"`
4257 }
4258
4259
4260 type MetricNameFilter struct {
4261
4262 Value *string `json:"value,omitempty"`
4263 }
4264
4265
4266 type Metrics struct {
4267
4268 ResourceID *string `json:"resourceId,omitempty"`
4269
4270 StartTime *date.Time `json:"startTime,omitempty"`
4271
4272 EndTime *date.Time `json:"endTime,omitempty"`
4273
4274 TimeGrain *string `json:"timeGrain,omitempty"`
4275
4276 PrimaryAggregation MetricAggregationType `json:"primaryAggregation,omitempty"`
4277
4278 Name *MetricName `json:"name,omitempty"`
4279
4280 Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
4281
4282 Unit MetricUnit `json:"unit,omitempty"`
4283
4284 Type *string `json:"type,omitempty"`
4285
4286 Values *[]MetricData `json:"values,omitempty"`
4287 }
4288
4289
4290 type NetworkAdapterList struct {
4291
4292 Value *[]NetworkAdapters `json:"value,omitempty"`
4293 }
4294
4295
4296 type NetworkAdapters struct {
4297
4298 InterfaceID NetInterfaceID `json:"interfaceId,omitempty"`
4299
4300 NetInterfaceStatus NetInterfaceStatus `json:"netInterfaceStatus,omitempty"`
4301
4302 IsDefault *bool `json:"isDefault,omitempty"`
4303
4304 IscsiAndCloudStatus ISCSIAndCloudStatus `json:"iscsiAndCloudStatus,omitempty"`
4305
4306 Speed *int64 `json:"speed,omitempty"`
4307
4308 Mode NetworkMode `json:"mode,omitempty"`
4309
4310 NicIpv4Settings *NicIPv4 `json:"nicIpv4Settings,omitempty"`
4311
4312 NicIpv6Settings *NicIPv6 `json:"nicIpv6Settings,omitempty"`
4313 }
4314
4315
4316 type NetworkInterfaceData0Settings struct {
4317
4318 ControllerZeroIP *string `json:"controllerZeroIp,omitempty"`
4319
4320 ControllerOneIP *string `json:"controllerOneIp,omitempty"`
4321 }
4322
4323
4324 type NetworkSettings struct {
4325 autorest.Response `json:"-"`
4326
4327 *NetworkSettingsProperties `json:"properties,omitempty"`
4328
4329 ID *string `json:"id,omitempty"`
4330
4331 Name *string `json:"name,omitempty"`
4332
4333 Type *string `json:"type,omitempty"`
4334
4335 Kind Kind `json:"kind,omitempty"`
4336 }
4337
4338
4339 func (ns NetworkSettings) MarshalJSON() ([]byte, error) {
4340 objectMap := make(map[string]interface{})
4341 if ns.NetworkSettingsProperties != nil {
4342 objectMap["properties"] = ns.NetworkSettingsProperties
4343 }
4344 if ns.Kind != "" {
4345 objectMap["kind"] = ns.Kind
4346 }
4347 return json.Marshal(objectMap)
4348 }
4349
4350
4351 func (ns *NetworkSettings) UnmarshalJSON(body []byte) error {
4352 var m map[string]*json.RawMessage
4353 err := json.Unmarshal(body, &m)
4354 if err != nil {
4355 return err
4356 }
4357 for k, v := range m {
4358 switch k {
4359 case "properties":
4360 if v != nil {
4361 var networkSettingsProperties NetworkSettingsProperties
4362 err = json.Unmarshal(*v, &networkSettingsProperties)
4363 if err != nil {
4364 return err
4365 }
4366 ns.NetworkSettingsProperties = &networkSettingsProperties
4367 }
4368 case "id":
4369 if v != nil {
4370 var ID string
4371 err = json.Unmarshal(*v, &ID)
4372 if err != nil {
4373 return err
4374 }
4375 ns.ID = &ID
4376 }
4377 case "name":
4378 if v != nil {
4379 var name string
4380 err = json.Unmarshal(*v, &name)
4381 if err != nil {
4382 return err
4383 }
4384 ns.Name = &name
4385 }
4386 case "type":
4387 if v != nil {
4388 var typeVar string
4389 err = json.Unmarshal(*v, &typeVar)
4390 if err != nil {
4391 return err
4392 }
4393 ns.Type = &typeVar
4394 }
4395 case "kind":
4396 if v != nil {
4397 var kind Kind
4398 err = json.Unmarshal(*v, &kind)
4399 if err != nil {
4400 return err
4401 }
4402 ns.Kind = kind
4403 }
4404 }
4405 }
4406
4407 return nil
4408 }
4409
4410
4411 type NetworkSettingsPatch struct {
4412
4413 *NetworkSettingsPatchProperties `json:"properties,omitempty"`
4414 }
4415
4416
4417 func (nsp NetworkSettingsPatch) MarshalJSON() ([]byte, error) {
4418 objectMap := make(map[string]interface{})
4419 if nsp.NetworkSettingsPatchProperties != nil {
4420 objectMap["properties"] = nsp.NetworkSettingsPatchProperties
4421 }
4422 return json.Marshal(objectMap)
4423 }
4424
4425
4426 func (nsp *NetworkSettingsPatch) UnmarshalJSON(body []byte) error {
4427 var m map[string]*json.RawMessage
4428 err := json.Unmarshal(body, &m)
4429 if err != nil {
4430 return err
4431 }
4432 for k, v := range m {
4433 switch k {
4434 case "properties":
4435 if v != nil {
4436 var networkSettingsPatchProperties NetworkSettingsPatchProperties
4437 err = json.Unmarshal(*v, &networkSettingsPatchProperties)
4438 if err != nil {
4439 return err
4440 }
4441 nsp.NetworkSettingsPatchProperties = &networkSettingsPatchProperties
4442 }
4443 }
4444 }
4445
4446 return nil
4447 }
4448
4449
4450 type NetworkSettingsPatchProperties struct {
4451
4452 DNSSettings *DNSSettings `json:"dnsSettings,omitempty"`
4453
4454 NetworkAdapters *NetworkAdapterList `json:"networkAdapters,omitempty"`
4455 }
4456
4457
4458 type NetworkSettingsProperties struct {
4459
4460 DNSSettings *DNSSettings `json:"dnsSettings,omitempty"`
4461
4462 NetworkAdapters *NetworkAdapterList `json:"networkAdapters,omitempty"`
4463
4464 WebproxySettings *WebproxySettings `json:"webproxySettings,omitempty"`
4465 }
4466
4467
4468 type NicIPv4 struct {
4469
4470 Ipv4Address *string `json:"ipv4Address,omitempty"`
4471
4472 Ipv4Netmask *string `json:"ipv4Netmask,omitempty"`
4473
4474 Ipv4Gateway *string `json:"ipv4Gateway,omitempty"`
4475
4476 Controller0Ipv4Address *string `json:"controller0Ipv4Address,omitempty"`
4477
4478 Controller1Ipv4Address *string `json:"controller1Ipv4Address,omitempty"`
4479 }
4480
4481
4482 type NicIPv6 struct {
4483
4484 Ipv6Address *string `json:"ipv6Address,omitempty"`
4485
4486 Ipv6Prefix *string `json:"ipv6Prefix,omitempty"`
4487
4488 Ipv6Gateway *string `json:"ipv6Gateway,omitempty"`
4489
4490 Controller0Ipv6Address *string `json:"controller0Ipv6Address,omitempty"`
4491
4492 Controller1Ipv6Address *string `json:"controller1Ipv6Address,omitempty"`
4493 }
4494
4495
4496 type PublicKey struct {
4497 autorest.Response `json:"-"`
4498
4499 Key *string `json:"key,omitempty"`
4500 }
4501
4502
4503 type RemoteManagementSettings struct {
4504
4505 RemoteManagementMode RemoteManagementModeConfiguration `json:"remoteManagementMode,omitempty"`
4506
4507 RemoteManagementCertificate *string `json:"remoteManagementCertificate,omitempty"`
4508 }
4509
4510
4511 type RemoteManagementSettingsPatch struct {
4512
4513 RemoteManagementMode RemoteManagementModeConfiguration `json:"remoteManagementMode,omitempty"`
4514 }
4515
4516
4517 type Resource struct {
4518
4519 ID *string `json:"id,omitempty"`
4520
4521 Name *string `json:"name,omitempty"`
4522
4523 Type *string `json:"type,omitempty"`
4524
4525 Location *string `json:"location,omitempty"`
4526
4527 Tags map[string]*string `json:"tags"`
4528 }
4529
4530
4531 func (r Resource) MarshalJSON() ([]byte, error) {
4532 objectMap := make(map[string]interface{})
4533 if r.Location != nil {
4534 objectMap["location"] = r.Location
4535 }
4536 if r.Tags != nil {
4537 objectMap["tags"] = r.Tags
4538 }
4539 return json.Marshal(objectMap)
4540 }
4541
4542
4543 type ScheduleRecurrence struct {
4544
4545 RecurrenceType RecurrenceType `json:"recurrenceType,omitempty"`
4546
4547 RecurrenceValue *int32 `json:"recurrenceValue,omitempty"`
4548
4549 WeeklyDaysList *[]DayOfWeek `json:"weeklyDaysList,omitempty"`
4550 }
4551
4552
4553 type SecondaryDNSSettings struct {
4554
4555 SecondaryDNSServers *[]string `json:"secondaryDnsServers,omitempty"`
4556 }
4557
4558
4559 type SecuritySettings struct {
4560 autorest.Response `json:"-"`
4561
4562 *SecuritySettingsProperties `json:"properties,omitempty"`
4563
4564 ID *string `json:"id,omitempty"`
4565
4566 Name *string `json:"name,omitempty"`
4567
4568 Type *string `json:"type,omitempty"`
4569
4570 Kind Kind `json:"kind,omitempty"`
4571 }
4572
4573
4574 func (ss SecuritySettings) MarshalJSON() ([]byte, error) {
4575 objectMap := make(map[string]interface{})
4576 if ss.SecuritySettingsProperties != nil {
4577 objectMap["properties"] = ss.SecuritySettingsProperties
4578 }
4579 if ss.Kind != "" {
4580 objectMap["kind"] = ss.Kind
4581 }
4582 return json.Marshal(objectMap)
4583 }
4584
4585
4586 func (ss *SecuritySettings) UnmarshalJSON(body []byte) error {
4587 var m map[string]*json.RawMessage
4588 err := json.Unmarshal(body, &m)
4589 if err != nil {
4590 return err
4591 }
4592 for k, v := range m {
4593 switch k {
4594 case "properties":
4595 if v != nil {
4596 var securitySettingsProperties SecuritySettingsProperties
4597 err = json.Unmarshal(*v, &securitySettingsProperties)
4598 if err != nil {
4599 return err
4600 }
4601 ss.SecuritySettingsProperties = &securitySettingsProperties
4602 }
4603 case "id":
4604 if v != nil {
4605 var ID string
4606 err = json.Unmarshal(*v, &ID)
4607 if err != nil {
4608 return err
4609 }
4610 ss.ID = &ID
4611 }
4612 case "name":
4613 if v != nil {
4614 var name string
4615 err = json.Unmarshal(*v, &name)
4616 if err != nil {
4617 return err
4618 }
4619 ss.Name = &name
4620 }
4621 case "type":
4622 if v != nil {
4623 var typeVar string
4624 err = json.Unmarshal(*v, &typeVar)
4625 if err != nil {
4626 return err
4627 }
4628 ss.Type = &typeVar
4629 }
4630 case "kind":
4631 if v != nil {
4632 var kind Kind
4633 err = json.Unmarshal(*v, &kind)
4634 if err != nil {
4635 return err
4636 }
4637 ss.Kind = kind
4638 }
4639 }
4640 }
4641
4642 return nil
4643 }
4644
4645
4646 type SecuritySettingsPatch struct {
4647
4648 *SecuritySettingsPatchProperties `json:"properties,omitempty"`
4649 }
4650
4651
4652 func (ssp SecuritySettingsPatch) MarshalJSON() ([]byte, error) {
4653 objectMap := make(map[string]interface{})
4654 if ssp.SecuritySettingsPatchProperties != nil {
4655 objectMap["properties"] = ssp.SecuritySettingsPatchProperties
4656 }
4657 return json.Marshal(objectMap)
4658 }
4659
4660
4661 func (ssp *SecuritySettingsPatch) UnmarshalJSON(body []byte) error {
4662 var m map[string]*json.RawMessage
4663 err := json.Unmarshal(body, &m)
4664 if err != nil {
4665 return err
4666 }
4667 for k, v := range m {
4668 switch k {
4669 case "properties":
4670 if v != nil {
4671 var securitySettingsPatchProperties SecuritySettingsPatchProperties
4672 err = json.Unmarshal(*v, &securitySettingsPatchProperties)
4673 if err != nil {
4674 return err
4675 }
4676 ssp.SecuritySettingsPatchProperties = &securitySettingsPatchProperties
4677 }
4678 }
4679 }
4680
4681 return nil
4682 }
4683
4684
4685 type SecuritySettingsPatchProperties struct {
4686
4687 RemoteManagementSettings *RemoteManagementSettingsPatch `json:"remoteManagementSettings,omitempty"`
4688
4689 DeviceAdminPassword *AsymmetricEncryptedSecret `json:"deviceAdminPassword,omitempty"`
4690
4691 SnapshotPassword *AsymmetricEncryptedSecret `json:"snapshotPassword,omitempty"`
4692
4693 ChapSettings *ChapSettings `json:"chapSettings,omitempty"`
4694
4695 CloudApplianceSettings *CloudApplianceSettings `json:"cloudApplianceSettings,omitempty"`
4696 }
4697
4698
4699 type SecuritySettingsProperties struct {
4700
4701 RemoteManagementSettings *RemoteManagementSettings `json:"remoteManagementSettings,omitempty"`
4702
4703 ChapSettings *ChapSettings `json:"chapSettings,omitempty"`
4704 }
4705
4706
4707 type SendTestAlertEmailRequest struct {
4708
4709 EmailList *[]string `json:"emailList,omitempty"`
4710 }
4711
4712
4713 type StorageAccountCredential struct {
4714 autorest.Response `json:"-"`
4715
4716 *StorageAccountCredentialProperties `json:"properties,omitempty"`
4717
4718 ID *string `json:"id,omitempty"`
4719
4720 Name *string `json:"name,omitempty"`
4721
4722 Type *string `json:"type,omitempty"`
4723
4724 Kind Kind `json:"kind,omitempty"`
4725 }
4726
4727
4728 func (sac StorageAccountCredential) MarshalJSON() ([]byte, error) {
4729 objectMap := make(map[string]interface{})
4730 if sac.StorageAccountCredentialProperties != nil {
4731 objectMap["properties"] = sac.StorageAccountCredentialProperties
4732 }
4733 if sac.Kind != "" {
4734 objectMap["kind"] = sac.Kind
4735 }
4736 return json.Marshal(objectMap)
4737 }
4738
4739
4740 func (sac *StorageAccountCredential) UnmarshalJSON(body []byte) error {
4741 var m map[string]*json.RawMessage
4742 err := json.Unmarshal(body, &m)
4743 if err != nil {
4744 return err
4745 }
4746 for k, v := range m {
4747 switch k {
4748 case "properties":
4749 if v != nil {
4750 var storageAccountCredentialProperties StorageAccountCredentialProperties
4751 err = json.Unmarshal(*v, &storageAccountCredentialProperties)
4752 if err != nil {
4753 return err
4754 }
4755 sac.StorageAccountCredentialProperties = &storageAccountCredentialProperties
4756 }
4757 case "id":
4758 if v != nil {
4759 var ID string
4760 err = json.Unmarshal(*v, &ID)
4761 if err != nil {
4762 return err
4763 }
4764 sac.ID = &ID
4765 }
4766 case "name":
4767 if v != nil {
4768 var name string
4769 err = json.Unmarshal(*v, &name)
4770 if err != nil {
4771 return err
4772 }
4773 sac.Name = &name
4774 }
4775 case "type":
4776 if v != nil {
4777 var typeVar string
4778 err = json.Unmarshal(*v, &typeVar)
4779 if err != nil {
4780 return err
4781 }
4782 sac.Type = &typeVar
4783 }
4784 case "kind":
4785 if v != nil {
4786 var kind Kind
4787 err = json.Unmarshal(*v, &kind)
4788 if err != nil {
4789 return err
4790 }
4791 sac.Kind = kind
4792 }
4793 }
4794 }
4795
4796 return nil
4797 }
4798
4799
4800 type StorageAccountCredentialList struct {
4801 autorest.Response `json:"-"`
4802
4803 Value *[]StorageAccountCredential `json:"value,omitempty"`
4804 }
4805
4806
4807 type StorageAccountCredentialProperties struct {
4808
4809 EndPoint *string `json:"endPoint,omitempty"`
4810
4811 SslStatus SslStatus `json:"sslStatus,omitempty"`
4812
4813 AccessKey *AsymmetricEncryptedSecret `json:"accessKey,omitempty"`
4814
4815 VolumesCount *int32 `json:"volumesCount,omitempty"`
4816 }
4817
4818
4819 func (sacp StorageAccountCredentialProperties) MarshalJSON() ([]byte, error) {
4820 objectMap := make(map[string]interface{})
4821 if sacp.EndPoint != nil {
4822 objectMap["endPoint"] = sacp.EndPoint
4823 }
4824 if sacp.SslStatus != "" {
4825 objectMap["sslStatus"] = sacp.SslStatus
4826 }
4827 if sacp.AccessKey != nil {
4828 objectMap["accessKey"] = sacp.AccessKey
4829 }
4830 return json.Marshal(objectMap)
4831 }
4832
4833
4834
4835 type StorageAccountCredentialsCreateOrUpdateFuture struct {
4836 azure.FutureAPI
4837
4838
4839 Result func(StorageAccountCredentialsClient) (StorageAccountCredential, error)
4840 }
4841
4842
4843 func (future *StorageAccountCredentialsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
4844 var azFuture azure.Future
4845 if err := json.Unmarshal(body, &azFuture); err != nil {
4846 return err
4847 }
4848 future.FutureAPI = &azFuture
4849 future.Result = future.result
4850 return nil
4851 }
4852
4853
4854 func (future *StorageAccountCredentialsCreateOrUpdateFuture) result(client StorageAccountCredentialsClient) (sac StorageAccountCredential, err error) {
4855 var done bool
4856 done, err = future.DoneWithContext(context.Background(), client)
4857 if err != nil {
4858 err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4859 return
4860 }
4861 if !done {
4862 sac.Response.Response = future.Response()
4863 err = azure.NewAsyncOpIncompleteError("storsimple.StorageAccountCredentialsCreateOrUpdateFuture")
4864 return
4865 }
4866 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4867 if sac.Response.Response, err = future.GetResult(sender); err == nil && sac.Response.Response.StatusCode != http.StatusNoContent {
4868 sac, err = client.CreateOrUpdateResponder(sac.Response.Response)
4869 if err != nil {
4870 err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsCreateOrUpdateFuture", "Result", sac.Response.Response, "Failure responding to request")
4871 }
4872 }
4873 return
4874 }
4875
4876
4877
4878 type StorageAccountCredentialsDeleteFuture struct {
4879 azure.FutureAPI
4880
4881
4882 Result func(StorageAccountCredentialsClient) (autorest.Response, error)
4883 }
4884
4885
4886 func (future *StorageAccountCredentialsDeleteFuture) UnmarshalJSON(body []byte) error {
4887 var azFuture azure.Future
4888 if err := json.Unmarshal(body, &azFuture); err != nil {
4889 return err
4890 }
4891 future.FutureAPI = &azFuture
4892 future.Result = future.result
4893 return nil
4894 }
4895
4896
4897 func (future *StorageAccountCredentialsDeleteFuture) result(client StorageAccountCredentialsClient) (ar autorest.Response, err error) {
4898 var done bool
4899 done, err = future.DoneWithContext(context.Background(), client)
4900 if err != nil {
4901 err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsDeleteFuture", "Result", future.Response(), "Polling failure")
4902 return
4903 }
4904 if !done {
4905 ar.Response = future.Response()
4906 err = azure.NewAsyncOpIncompleteError("storsimple.StorageAccountCredentialsDeleteFuture")
4907 return
4908 }
4909 ar.Response = future.Response()
4910 return
4911 }
4912
4913
4914 type SymmetricEncryptedSecret struct {
4915 autorest.Response `json:"-"`
4916
4917 Value *string `json:"value,omitempty"`
4918
4919 ValueCertificateThumbprint *string `json:"valueCertificateThumbprint,omitempty"`
4920
4921 EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"`
4922 }
4923
4924
4925
4926 type TargetEligibilityErrorMessage struct {
4927
4928 Message *string `json:"message,omitempty"`
4929
4930 Resolution *string `json:"resolution,omitempty"`
4931
4932 ResultCode TargetEligibilityResultCode `json:"resultCode,omitempty"`
4933 }
4934
4935
4936 type TargetEligibilityResult struct {
4937
4938 EligibilityStatus TargetEligibilityStatus `json:"eligibilityStatus,omitempty"`
4939
4940 Messages *[]TargetEligibilityErrorMessage `json:"messages,omitempty"`
4941 }
4942
4943
4944 type Time struct {
4945
4946 Hours *int32 `json:"hours,omitempty"`
4947
4948 Minutes *int32 `json:"minutes,omitempty"`
4949
4950 Seconds *int32 `json:"seconds,omitempty"`
4951 }
4952
4953
4954 type TimeSettings struct {
4955 autorest.Response `json:"-"`
4956
4957 *TimeSettingsProperties `json:"properties,omitempty"`
4958
4959 ID *string `json:"id,omitempty"`
4960
4961 Name *string `json:"name,omitempty"`
4962
4963 Type *string `json:"type,omitempty"`
4964
4965 Kind Kind `json:"kind,omitempty"`
4966 }
4967
4968
4969 func (ts TimeSettings) MarshalJSON() ([]byte, error) {
4970 objectMap := make(map[string]interface{})
4971 if ts.TimeSettingsProperties != nil {
4972 objectMap["properties"] = ts.TimeSettingsProperties
4973 }
4974 if ts.Kind != "" {
4975 objectMap["kind"] = ts.Kind
4976 }
4977 return json.Marshal(objectMap)
4978 }
4979
4980
4981 func (ts *TimeSettings) UnmarshalJSON(body []byte) error {
4982 var m map[string]*json.RawMessage
4983 err := json.Unmarshal(body, &m)
4984 if err != nil {
4985 return err
4986 }
4987 for k, v := range m {
4988 switch k {
4989 case "properties":
4990 if v != nil {
4991 var timeSettingsProperties TimeSettingsProperties
4992 err = json.Unmarshal(*v, &timeSettingsProperties)
4993 if err != nil {
4994 return err
4995 }
4996 ts.TimeSettingsProperties = &timeSettingsProperties
4997 }
4998 case "id":
4999 if v != nil {
5000 var ID string
5001 err = json.Unmarshal(*v, &ID)
5002 if err != nil {
5003 return err
5004 }
5005 ts.ID = &ID
5006 }
5007 case "name":
5008 if v != nil {
5009 var name string
5010 err = json.Unmarshal(*v, &name)
5011 if err != nil {
5012 return err
5013 }
5014 ts.Name = &name
5015 }
5016 case "type":
5017 if v != nil {
5018 var typeVar string
5019 err = json.Unmarshal(*v, &typeVar)
5020 if err != nil {
5021 return err
5022 }
5023 ts.Type = &typeVar
5024 }
5025 case "kind":
5026 if v != nil {
5027 var kind Kind
5028 err = json.Unmarshal(*v, &kind)
5029 if err != nil {
5030 return err
5031 }
5032 ts.Kind = kind
5033 }
5034 }
5035 }
5036
5037 return nil
5038 }
5039
5040
5041 type TimeSettingsProperties struct {
5042
5043 TimeZone *string `json:"timeZone,omitempty"`
5044
5045 PrimaryTimeServer *string `json:"primaryTimeServer,omitempty"`
5046
5047 SecondaryTimeServer *[]string `json:"secondaryTimeServer,omitempty"`
5048 }
5049
5050
5051 type Updates struct {
5052 autorest.Response `json:"-"`
5053
5054 *UpdatesProperties `json:"properties,omitempty"`
5055
5056 ID *string `json:"id,omitempty"`
5057
5058 Name *string `json:"name,omitempty"`
5059
5060 Type *string `json:"type,omitempty"`
5061
5062 Kind Kind `json:"kind,omitempty"`
5063 }
5064
5065
5066 func (u Updates) MarshalJSON() ([]byte, error) {
5067 objectMap := make(map[string]interface{})
5068 if u.UpdatesProperties != nil {
5069 objectMap["properties"] = u.UpdatesProperties
5070 }
5071 if u.Kind != "" {
5072 objectMap["kind"] = u.Kind
5073 }
5074 return json.Marshal(objectMap)
5075 }
5076
5077
5078 func (u *Updates) UnmarshalJSON(body []byte) error {
5079 var m map[string]*json.RawMessage
5080 err := json.Unmarshal(body, &m)
5081 if err != nil {
5082 return err
5083 }
5084 for k, v := range m {
5085 switch k {
5086 case "properties":
5087 if v != nil {
5088 var updatesProperties UpdatesProperties
5089 err = json.Unmarshal(*v, &updatesProperties)
5090 if err != nil {
5091 return err
5092 }
5093 u.UpdatesProperties = &updatesProperties
5094 }
5095 case "id":
5096 if v != nil {
5097 var ID string
5098 err = json.Unmarshal(*v, &ID)
5099 if err != nil {
5100 return err
5101 }
5102 u.ID = &ID
5103 }
5104 case "name":
5105 if v != nil {
5106 var name string
5107 err = json.Unmarshal(*v, &name)
5108 if err != nil {
5109 return err
5110 }
5111 u.Name = &name
5112 }
5113 case "type":
5114 if v != nil {
5115 var typeVar string
5116 err = json.Unmarshal(*v, &typeVar)
5117 if err != nil {
5118 return err
5119 }
5120 u.Type = &typeVar
5121 }
5122 case "kind":
5123 if v != nil {
5124 var kind Kind
5125 err = json.Unmarshal(*v, &kind)
5126 if err != nil {
5127 return err
5128 }
5129 u.Kind = kind
5130 }
5131 }
5132 }
5133
5134 return nil
5135 }
5136
5137
5138 type UpdatesProperties struct {
5139
5140 RegularUpdatesAvailable *bool `json:"regularUpdatesAvailable,omitempty"`
5141
5142 MaintenanceModeUpdatesAvailable *bool `json:"maintenanceModeUpdatesAvailable,omitempty"`
5143
5144 IsUpdateInProgress *bool `json:"isUpdateInProgress,omitempty"`
5145
5146 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
5147 }
5148
5149
5150 type VMImage struct {
5151
5152 Name *string `json:"name,omitempty"`
5153
5154 Version *string `json:"version,omitempty"`
5155
5156 Offer *string `json:"offer,omitempty"`
5157
5158 Publisher *string `json:"publisher,omitempty"`
5159
5160 Sku *string `json:"sku,omitempty"`
5161 }
5162
5163
5164 type Volume struct {
5165 autorest.Response `json:"-"`
5166
5167 *VolumeProperties `json:"properties,omitempty"`
5168
5169 ID *string `json:"id,omitempty"`
5170
5171 Name *string `json:"name,omitempty"`
5172
5173 Type *string `json:"type,omitempty"`
5174
5175 Kind Kind `json:"kind,omitempty"`
5176 }
5177
5178
5179 func (vVar Volume) MarshalJSON() ([]byte, error) {
5180 objectMap := make(map[string]interface{})
5181 if vVar.VolumeProperties != nil {
5182 objectMap["properties"] = vVar.VolumeProperties
5183 }
5184 if vVar.Kind != "" {
5185 objectMap["kind"] = vVar.Kind
5186 }
5187 return json.Marshal(objectMap)
5188 }
5189
5190
5191 func (vVar *Volume) UnmarshalJSON(body []byte) error {
5192 var m map[string]*json.RawMessage
5193 err := json.Unmarshal(body, &m)
5194 if err != nil {
5195 return err
5196 }
5197 for k, v := range m {
5198 switch k {
5199 case "properties":
5200 if v != nil {
5201 var volumeProperties VolumeProperties
5202 err = json.Unmarshal(*v, &volumeProperties)
5203 if err != nil {
5204 return err
5205 }
5206 vVar.VolumeProperties = &volumeProperties
5207 }
5208 case "id":
5209 if v != nil {
5210 var ID string
5211 err = json.Unmarshal(*v, &ID)
5212 if err != nil {
5213 return err
5214 }
5215 vVar.ID = &ID
5216 }
5217 case "name":
5218 if v != nil {
5219 var name string
5220 err = json.Unmarshal(*v, &name)
5221 if err != nil {
5222 return err
5223 }
5224 vVar.Name = &name
5225 }
5226 case "type":
5227 if v != nil {
5228 var typeVar string
5229 err = json.Unmarshal(*v, &typeVar)
5230 if err != nil {
5231 return err
5232 }
5233 vVar.Type = &typeVar
5234 }
5235 case "kind":
5236 if v != nil {
5237 var kind Kind
5238 err = json.Unmarshal(*v, &kind)
5239 if err != nil {
5240 return err
5241 }
5242 vVar.Kind = kind
5243 }
5244 }
5245 }
5246
5247 return nil
5248 }
5249
5250
5251 type VolumeContainer struct {
5252 autorest.Response `json:"-"`
5253
5254 *VolumeContainerProperties `json:"properties,omitempty"`
5255
5256 ID *string `json:"id,omitempty"`
5257
5258 Name *string `json:"name,omitempty"`
5259
5260 Type *string `json:"type,omitempty"`
5261
5262 Kind Kind `json:"kind,omitempty"`
5263 }
5264
5265
5266 func (vc VolumeContainer) MarshalJSON() ([]byte, error) {
5267 objectMap := make(map[string]interface{})
5268 if vc.VolumeContainerProperties != nil {
5269 objectMap["properties"] = vc.VolumeContainerProperties
5270 }
5271 if vc.Kind != "" {
5272 objectMap["kind"] = vc.Kind
5273 }
5274 return json.Marshal(objectMap)
5275 }
5276
5277
5278 func (vc *VolumeContainer) UnmarshalJSON(body []byte) error {
5279 var m map[string]*json.RawMessage
5280 err := json.Unmarshal(body, &m)
5281 if err != nil {
5282 return err
5283 }
5284 for k, v := range m {
5285 switch k {
5286 case "properties":
5287 if v != nil {
5288 var volumeContainerProperties VolumeContainerProperties
5289 err = json.Unmarshal(*v, &volumeContainerProperties)
5290 if err != nil {
5291 return err
5292 }
5293 vc.VolumeContainerProperties = &volumeContainerProperties
5294 }
5295 case "id":
5296 if v != nil {
5297 var ID string
5298 err = json.Unmarshal(*v, &ID)
5299 if err != nil {
5300 return err
5301 }
5302 vc.ID = &ID
5303 }
5304 case "name":
5305 if v != nil {
5306 var name string
5307 err = json.Unmarshal(*v, &name)
5308 if err != nil {
5309 return err
5310 }
5311 vc.Name = &name
5312 }
5313 case "type":
5314 if v != nil {
5315 var typeVar string
5316 err = json.Unmarshal(*v, &typeVar)
5317 if err != nil {
5318 return err
5319 }
5320 vc.Type = &typeVar
5321 }
5322 case "kind":
5323 if v != nil {
5324 var kind Kind
5325 err = json.Unmarshal(*v, &kind)
5326 if err != nil {
5327 return err
5328 }
5329 vc.Kind = kind
5330 }
5331 }
5332 }
5333
5334 return nil
5335 }
5336
5337
5338
5339 type VolumeContainerFailoverMetadata struct {
5340
5341 VolumeContainerID *string `json:"volumeContainerId,omitempty"`
5342
5343 Volumes *[]VolumeFailoverMetadata `json:"volumes,omitempty"`
5344 }
5345
5346
5347 type VolumeContainerList struct {
5348 autorest.Response `json:"-"`
5349
5350 Value *[]VolumeContainer `json:"value,omitempty"`
5351 }
5352
5353
5354 type VolumeContainerProperties struct {
5355
5356 EncryptionKey *AsymmetricEncryptedSecret `json:"encryptionKey,omitempty"`
5357
5358 EncryptionStatus EncryptionStatus `json:"encryptionStatus,omitempty"`
5359
5360 VolumeCount *int32 `json:"volumeCount,omitempty"`
5361
5362 StorageAccountCredentialID *string `json:"storageAccountCredentialId,omitempty"`
5363
5364 OwnerShipStatus OwnerShipStatus `json:"ownerShipStatus,omitempty"`
5365
5366 BandWidthRateInMbps *int32 `json:"bandWidthRateInMbps,omitempty"`
5367
5368 BandwidthSettingID *string `json:"bandwidthSettingId,omitempty"`
5369
5370 TotalCloudStorageUsageInBytes *int64 `json:"totalCloudStorageUsageInBytes,omitempty"`
5371 }
5372
5373
5374 func (vcp VolumeContainerProperties) MarshalJSON() ([]byte, error) {
5375 objectMap := make(map[string]interface{})
5376 if vcp.EncryptionKey != nil {
5377 objectMap["encryptionKey"] = vcp.EncryptionKey
5378 }
5379 if vcp.StorageAccountCredentialID != nil {
5380 objectMap["storageAccountCredentialId"] = vcp.StorageAccountCredentialID
5381 }
5382 if vcp.BandWidthRateInMbps != nil {
5383 objectMap["bandWidthRateInMbps"] = vcp.BandWidthRateInMbps
5384 }
5385 if vcp.BandwidthSettingID != nil {
5386 objectMap["bandwidthSettingId"] = vcp.BandwidthSettingID
5387 }
5388 return json.Marshal(objectMap)
5389 }
5390
5391
5392
5393 type VolumeContainersCreateOrUpdateFuture struct {
5394 azure.FutureAPI
5395
5396
5397 Result func(VolumeContainersClient) (VolumeContainer, error)
5398 }
5399
5400
5401 func (future *VolumeContainersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
5402 var azFuture azure.Future
5403 if err := json.Unmarshal(body, &azFuture); err != nil {
5404 return err
5405 }
5406 future.FutureAPI = &azFuture
5407 future.Result = future.result
5408 return nil
5409 }
5410
5411
5412 func (future *VolumeContainersCreateOrUpdateFuture) result(client VolumeContainersClient) (vc VolumeContainer, err error) {
5413 var done bool
5414 done, err = future.DoneWithContext(context.Background(), client)
5415 if err != nil {
5416 err = autorest.NewErrorWithError(err, "storsimple.VolumeContainersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5417 return
5418 }
5419 if !done {
5420 vc.Response.Response = future.Response()
5421 err = azure.NewAsyncOpIncompleteError("storsimple.VolumeContainersCreateOrUpdateFuture")
5422 return
5423 }
5424 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5425 if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent {
5426 vc, err = client.CreateOrUpdateResponder(vc.Response.Response)
5427 if err != nil {
5428 err = autorest.NewErrorWithError(err, "storsimple.VolumeContainersCreateOrUpdateFuture", "Result", vc.Response.Response, "Failure responding to request")
5429 }
5430 }
5431 return
5432 }
5433
5434
5435
5436 type VolumeContainersDeleteFuture struct {
5437 azure.FutureAPI
5438
5439
5440 Result func(VolumeContainersClient) (autorest.Response, error)
5441 }
5442
5443
5444 func (future *VolumeContainersDeleteFuture) UnmarshalJSON(body []byte) error {
5445 var azFuture azure.Future
5446 if err := json.Unmarshal(body, &azFuture); err != nil {
5447 return err
5448 }
5449 future.FutureAPI = &azFuture
5450 future.Result = future.result
5451 return nil
5452 }
5453
5454
5455 func (future *VolumeContainersDeleteFuture) result(client VolumeContainersClient) (ar autorest.Response, err error) {
5456 var done bool
5457 done, err = future.DoneWithContext(context.Background(), client)
5458 if err != nil {
5459 err = autorest.NewErrorWithError(err, "storsimple.VolumeContainersDeleteFuture", "Result", future.Response(), "Polling failure")
5460 return
5461 }
5462 if !done {
5463 ar.Response = future.Response()
5464 err = azure.NewAsyncOpIncompleteError("storsimple.VolumeContainersDeleteFuture")
5465 return
5466 }
5467 ar.Response = future.Response()
5468 return
5469 }
5470
5471
5472 type VolumeFailoverMetadata struct {
5473
5474 VolumeID *string `json:"volumeId,omitempty"`
5475
5476 VolumeType VolumeType `json:"volumeType,omitempty"`
5477
5478 SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
5479
5480 BackupCreatedDate *date.Time `json:"backupCreatedDate,omitempty"`
5481
5482 BackupElementID *string `json:"backupElementId,omitempty"`
5483
5484 BackupID *string `json:"backupId,omitempty"`
5485
5486 BackupPolicyID *string `json:"backupPolicyId,omitempty"`
5487 }
5488
5489
5490 type VolumeList struct {
5491 autorest.Response `json:"-"`
5492
5493 Value *[]Volume `json:"value,omitempty"`
5494 }
5495
5496
5497 type VolumeProperties struct {
5498
5499 SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
5500
5501 VolumeType VolumeType `json:"volumeType,omitempty"`
5502
5503 VolumeContainerID *string `json:"volumeContainerId,omitempty"`
5504
5505 AccessControlRecordIds *[]string `json:"accessControlRecordIds,omitempty"`
5506
5507 VolumeStatus VolumeStatus `json:"volumeStatus,omitempty"`
5508
5509 OperationStatus OperationStatus `json:"operationStatus,omitempty"`
5510
5511 BackupStatus BackupStatus `json:"backupStatus,omitempty"`
5512
5513 MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"`
5514
5515 BackupPolicyIds *[]string `json:"backupPolicyIds,omitempty"`
5516 }
5517
5518
5519 func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
5520 objectMap := make(map[string]interface{})
5521 if vp.SizeInBytes != nil {
5522 objectMap["sizeInBytes"] = vp.SizeInBytes
5523 }
5524 if vp.VolumeType != "" {
5525 objectMap["volumeType"] = vp.VolumeType
5526 }
5527 if vp.AccessControlRecordIds != nil {
5528 objectMap["accessControlRecordIds"] = vp.AccessControlRecordIds
5529 }
5530 if vp.VolumeStatus != "" {
5531 objectMap["volumeStatus"] = vp.VolumeStatus
5532 }
5533 if vp.MonitoringStatus != "" {
5534 objectMap["monitoringStatus"] = vp.MonitoringStatus
5535 }
5536 return json.Marshal(objectMap)
5537 }
5538
5539
5540
5541 type VolumesCreateOrUpdateFuture struct {
5542 azure.FutureAPI
5543
5544
5545 Result func(VolumesClient) (Volume, error)
5546 }
5547
5548
5549 func (future *VolumesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
5550 var azFuture azure.Future
5551 if err := json.Unmarshal(body, &azFuture); err != nil {
5552 return err
5553 }
5554 future.FutureAPI = &azFuture
5555 future.Result = future.result
5556 return nil
5557 }
5558
5559
5560 func (future *VolumesCreateOrUpdateFuture) result(client VolumesClient) (vVar Volume, err error) {
5561 var done bool
5562 done, err = future.DoneWithContext(context.Background(), client)
5563 if err != nil {
5564 err = autorest.NewErrorWithError(err, "storsimple.VolumesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5565 return
5566 }
5567 if !done {
5568 vVar.Response.Response = future.Response()
5569 err = azure.NewAsyncOpIncompleteError("storsimple.VolumesCreateOrUpdateFuture")
5570 return
5571 }
5572 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5573 if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent {
5574 vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response)
5575 if err != nil {
5576 err = autorest.NewErrorWithError(err, "storsimple.VolumesCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request")
5577 }
5578 }
5579 return
5580 }
5581
5582
5583
5584 type VolumesDeleteFuture struct {
5585 azure.FutureAPI
5586
5587
5588 Result func(VolumesClient) (autorest.Response, error)
5589 }
5590
5591
5592 func (future *VolumesDeleteFuture) UnmarshalJSON(body []byte) error {
5593 var azFuture azure.Future
5594 if err := json.Unmarshal(body, &azFuture); err != nil {
5595 return err
5596 }
5597 future.FutureAPI = &azFuture
5598 future.Result = future.result
5599 return nil
5600 }
5601
5602
5603 func (future *VolumesDeleteFuture) result(client VolumesClient) (ar autorest.Response, err error) {
5604 var done bool
5605 done, err = future.DoneWithContext(context.Background(), client)
5606 if err != nil {
5607 err = autorest.NewErrorWithError(err, "storsimple.VolumesDeleteFuture", "Result", future.Response(), "Polling failure")
5608 return
5609 }
5610 if !done {
5611 ar.Response = future.Response()
5612 err = azure.NewAsyncOpIncompleteError("storsimple.VolumesDeleteFuture")
5613 return
5614 }
5615 ar.Response = future.Response()
5616 return
5617 }
5618
5619
5620 type WebproxySettings struct {
5621
5622 ConnectionURI *string `json:"connectionUri,omitempty"`
5623
5624 Authentication AuthenticationType `json:"authentication,omitempty"`
5625
5626 Username *string `json:"username,omitempty"`
5627 }
5628
View as plain text