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/storsimple1200series/mgmt/2016-10-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
36
37 func (acr AccessControlRecord) MarshalJSON() ([]byte, error) {
38 objectMap := make(map[string]interface{})
39 if acr.AccessControlRecordProperties != nil {
40 objectMap["properties"] = acr.AccessControlRecordProperties
41 }
42 return json.Marshal(objectMap)
43 }
44
45
46 func (acr *AccessControlRecord) UnmarshalJSON(body []byte) error {
47 var m map[string]*json.RawMessage
48 err := json.Unmarshal(body, &m)
49 if err != nil {
50 return err
51 }
52 for k, v := range m {
53 switch k {
54 case "properties":
55 if v != nil {
56 var accessControlRecordProperties AccessControlRecordProperties
57 err = json.Unmarshal(*v, &accessControlRecordProperties)
58 if err != nil {
59 return err
60 }
61 acr.AccessControlRecordProperties = &accessControlRecordProperties
62 }
63 case "id":
64 if v != nil {
65 var ID string
66 err = json.Unmarshal(*v, &ID)
67 if err != nil {
68 return err
69 }
70 acr.ID = &ID
71 }
72 case "name":
73 if v != nil {
74 var name string
75 err = json.Unmarshal(*v, &name)
76 if err != nil {
77 return err
78 }
79 acr.Name = &name
80 }
81 case "type":
82 if v != nil {
83 var typeVar string
84 err = json.Unmarshal(*v, &typeVar)
85 if err != nil {
86 return err
87 }
88 acr.Type = &typeVar
89 }
90 }
91 }
92
93 return nil
94 }
95
96
97 type AccessControlRecordList struct {
98 autorest.Response `json:"-"`
99
100 Value *[]AccessControlRecord `json:"value,omitempty"`
101 }
102
103
104 type AccessControlRecordProperties struct {
105
106 InitiatorName *string `json:"initiatorName,omitempty"`
107 }
108
109
110
111 type AccessControlRecordsCreateOrUpdateFuture struct {
112 azure.FutureAPI
113
114
115 Result func(AccessControlRecordsClient) (AccessControlRecord, error)
116 }
117
118
119 func (future *AccessControlRecordsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
120 var azFuture azure.Future
121 if err := json.Unmarshal(body, &azFuture); err != nil {
122 return err
123 }
124 future.FutureAPI = &azFuture
125 future.Result = future.result
126 return nil
127 }
128
129
130 func (future *AccessControlRecordsCreateOrUpdateFuture) result(client AccessControlRecordsClient) (acr AccessControlRecord, err error) {
131 var done bool
132 done, err = future.DoneWithContext(context.Background(), client)
133 if err != nil {
134 err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
135 return
136 }
137 if !done {
138 acr.Response.Response = future.Response()
139 err = azure.NewAsyncOpIncompleteError("storsimple.AccessControlRecordsCreateOrUpdateFuture")
140 return
141 }
142 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
143 if acr.Response.Response, err = future.GetResult(sender); err == nil && acr.Response.Response.StatusCode != http.StatusNoContent {
144 acr, err = client.CreateOrUpdateResponder(acr.Response.Response)
145 if err != nil {
146 err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsCreateOrUpdateFuture", "Result", acr.Response.Response, "Failure responding to request")
147 }
148 }
149 return
150 }
151
152
153
154 type AccessControlRecordsDeleteFuture struct {
155 azure.FutureAPI
156
157
158 Result func(AccessControlRecordsClient) (autorest.Response, error)
159 }
160
161
162 func (future *AccessControlRecordsDeleteFuture) UnmarshalJSON(body []byte) error {
163 var azFuture azure.Future
164 if err := json.Unmarshal(body, &azFuture); err != nil {
165 return err
166 }
167 future.FutureAPI = &azFuture
168 future.Result = future.result
169 return nil
170 }
171
172
173 func (future *AccessControlRecordsDeleteFuture) result(client AccessControlRecordsClient) (ar autorest.Response, err error) {
174 var done bool
175 done, err = future.DoneWithContext(context.Background(), client)
176 if err != nil {
177 err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsDeleteFuture", "Result", future.Response(), "Polling failure")
178 return
179 }
180 if !done {
181 ar.Response = future.Response()
182 err = azure.NewAsyncOpIncompleteError("storsimple.AccessControlRecordsDeleteFuture")
183 return
184 }
185 ar.Response = future.Response()
186 return
187 }
188
189
190 type Alert struct {
191
192 *AlertProperties `json:"properties,omitempty"`
193
194 ID *string `json:"id,omitempty"`
195
196 Name *string `json:"name,omitempty"`
197
198 Type *string `json:"type,omitempty"`
199 }
200
201
202 func (a Alert) MarshalJSON() ([]byte, error) {
203 objectMap := make(map[string]interface{})
204 if a.AlertProperties != nil {
205 objectMap["properties"] = a.AlertProperties
206 }
207 return json.Marshal(objectMap)
208 }
209
210
211 func (a *Alert) UnmarshalJSON(body []byte) error {
212 var m map[string]*json.RawMessage
213 err := json.Unmarshal(body, &m)
214 if err != nil {
215 return err
216 }
217 for k, v := range m {
218 switch k {
219 case "properties":
220 if v != nil {
221 var alertProperties AlertProperties
222 err = json.Unmarshal(*v, &alertProperties)
223 if err != nil {
224 return err
225 }
226 a.AlertProperties = &alertProperties
227 }
228 case "id":
229 if v != nil {
230 var ID string
231 err = json.Unmarshal(*v, &ID)
232 if err != nil {
233 return err
234 }
235 a.ID = &ID
236 }
237 case "name":
238 if v != nil {
239 var name string
240 err = json.Unmarshal(*v, &name)
241 if err != nil {
242 return err
243 }
244 a.Name = &name
245 }
246 case "type":
247 if v != nil {
248 var typeVar string
249 err = json.Unmarshal(*v, &typeVar)
250 if err != nil {
251 return err
252 }
253 a.Type = &typeVar
254 }
255 }
256 }
257
258 return nil
259 }
260
261
262 type AlertErrorDetails struct {
263
264 ErrorCode *string `json:"errorCode,omitempty"`
265
266 ErrorMessage *string `json:"errorMessage,omitempty"`
267
268 Occurences *int32 `json:"occurences,omitempty"`
269 }
270
271
272 type AlertFilter struct {
273
274 Status AlertStatus `json:"status,omitempty"`
275
276 Severity AlertSeverity `json:"severity,omitempty"`
277
278 SourceType AlertSourceType `json:"sourceType,omitempty"`
279
280 SourceName *string `json:"sourceName,omitempty"`
281
282 AppearedOnTime *date.Time `json:"appearedOnTime,omitempty"`
283 }
284
285
286 type AlertList struct {
287 autorest.Response `json:"-"`
288
289 Value *[]Alert `json:"value,omitempty"`
290
291 NextLink *string `json:"nextLink,omitempty"`
292 }
293
294
295 type AlertListIterator struct {
296 i int
297 page AlertListPage
298 }
299
300
301
302 func (iter *AlertListIterator) NextWithContext(ctx context.Context) (err error) {
303 if tracing.IsEnabled() {
304 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListIterator.NextWithContext")
305 defer func() {
306 sc := -1
307 if iter.Response().Response.Response != nil {
308 sc = iter.Response().Response.Response.StatusCode
309 }
310 tracing.EndSpan(ctx, sc, err)
311 }()
312 }
313 iter.i++
314 if iter.i < len(iter.page.Values()) {
315 return nil
316 }
317 err = iter.page.NextWithContext(ctx)
318 if err != nil {
319 iter.i--
320 return err
321 }
322 iter.i = 0
323 return nil
324 }
325
326
327
328
329 func (iter *AlertListIterator) Next() error {
330 return iter.NextWithContext(context.Background())
331 }
332
333
334 func (iter AlertListIterator) NotDone() bool {
335 return iter.page.NotDone() && iter.i < len(iter.page.Values())
336 }
337
338
339 func (iter AlertListIterator) Response() AlertList {
340 return iter.page.Response()
341 }
342
343
344
345 func (iter AlertListIterator) Value() Alert {
346 if !iter.page.NotDone() {
347 return Alert{}
348 }
349 return iter.page.Values()[iter.i]
350 }
351
352
353 func NewAlertListIterator(page AlertListPage) AlertListIterator {
354 return AlertListIterator{page: page}
355 }
356
357
358 func (al AlertList) IsEmpty() bool {
359 return al.Value == nil || len(*al.Value) == 0
360 }
361
362
363 func (al AlertList) hasNextLink() bool {
364 return al.NextLink != nil && len(*al.NextLink) != 0
365 }
366
367
368
369 func (al AlertList) alertListPreparer(ctx context.Context) (*http.Request, error) {
370 if !al.hasNextLink() {
371 return nil, nil
372 }
373 return autorest.Prepare((&http.Request{}).WithContext(ctx),
374 autorest.AsJSON(),
375 autorest.AsGet(),
376 autorest.WithBaseURL(to.String(al.NextLink)))
377 }
378
379
380 type AlertListPage struct {
381 fn func(context.Context, AlertList) (AlertList, error)
382 al AlertList
383 }
384
385
386
387 func (page *AlertListPage) NextWithContext(ctx context.Context) (err error) {
388 if tracing.IsEnabled() {
389 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListPage.NextWithContext")
390 defer func() {
391 sc := -1
392 if page.Response().Response.Response != nil {
393 sc = page.Response().Response.Response.StatusCode
394 }
395 tracing.EndSpan(ctx, sc, err)
396 }()
397 }
398 for {
399 next, err := page.fn(ctx, page.al)
400 if err != nil {
401 return err
402 }
403 page.al = next
404 if !next.hasNextLink() || !next.IsEmpty() {
405 break
406 }
407 }
408 return nil
409 }
410
411
412
413
414 func (page *AlertListPage) Next() error {
415 return page.NextWithContext(context.Background())
416 }
417
418
419 func (page AlertListPage) NotDone() bool {
420 return !page.al.IsEmpty()
421 }
422
423
424 func (page AlertListPage) Response() AlertList {
425 return page.al
426 }
427
428
429 func (page AlertListPage) Values() []Alert {
430 if page.al.IsEmpty() {
431 return nil
432 }
433 return *page.al.Value
434 }
435
436
437 func NewAlertListPage(cur AlertList, getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage {
438 return AlertListPage{
439 fn: getNextPage,
440 al: cur,
441 }
442 }
443
444
445 type AlertProperties struct {
446
447 Title *string `json:"title,omitempty"`
448
449 Scope AlertScope `json:"scope,omitempty"`
450
451 AlertType *string `json:"alertType,omitempty"`
452
453 AppearedAtTime *date.Time `json:"appearedAtTime,omitempty"`
454
455 AppearedAtSourceTime *date.Time `json:"appearedAtSourceTime,omitempty"`
456
457 ClearedAtTime *date.Time `json:"clearedAtTime,omitempty"`
458
459 ClearedAtSourceTime *date.Time `json:"clearedAtSourceTime,omitempty"`
460
461 Source *AlertSource `json:"source,omitempty"`
462
463 Recommendation *string `json:"recommendation,omitempty"`
464
465 ResolutionReason *string `json:"resolutionReason,omitempty"`
466
467 Severity AlertSeverity `json:"severity,omitempty"`
468
469 Status AlertStatus `json:"status,omitempty"`
470
471 ErrorDetails *AlertErrorDetails `json:"errorDetails,omitempty"`
472
473 DetailedInformation map[string]*string `json:"detailedInformation"`
474 }
475
476
477 func (ap AlertProperties) MarshalJSON() ([]byte, error) {
478 objectMap := make(map[string]interface{})
479 if ap.Title != nil {
480 objectMap["title"] = ap.Title
481 }
482 if ap.Scope != "" {
483 objectMap["scope"] = ap.Scope
484 }
485 if ap.AlertType != nil {
486 objectMap["alertType"] = ap.AlertType
487 }
488 if ap.AppearedAtTime != nil {
489 objectMap["appearedAtTime"] = ap.AppearedAtTime
490 }
491 if ap.AppearedAtSourceTime != nil {
492 objectMap["appearedAtSourceTime"] = ap.AppearedAtSourceTime
493 }
494 if ap.ClearedAtTime != nil {
495 objectMap["clearedAtTime"] = ap.ClearedAtTime
496 }
497 if ap.ClearedAtSourceTime != nil {
498 objectMap["clearedAtSourceTime"] = ap.ClearedAtSourceTime
499 }
500 if ap.Source != nil {
501 objectMap["source"] = ap.Source
502 }
503 if ap.Recommendation != nil {
504 objectMap["recommendation"] = ap.Recommendation
505 }
506 if ap.ResolutionReason != nil {
507 objectMap["resolutionReason"] = ap.ResolutionReason
508 }
509 if ap.Severity != "" {
510 objectMap["severity"] = ap.Severity
511 }
512 if ap.Status != "" {
513 objectMap["status"] = ap.Status
514 }
515 if ap.ErrorDetails != nil {
516 objectMap["errorDetails"] = ap.ErrorDetails
517 }
518 if ap.DetailedInformation != nil {
519 objectMap["detailedInformation"] = ap.DetailedInformation
520 }
521 return json.Marshal(objectMap)
522 }
523
524
525 type AlertSettings struct {
526 autorest.Response `json:"-"`
527
528 *AlertSettingsProperties `json:"properties,omitempty"`
529
530 ID *string `json:"id,omitempty"`
531
532 Name *string `json:"name,omitempty"`
533
534 Type *string `json:"type,omitempty"`
535 }
536
537
538 func (as AlertSettings) MarshalJSON() ([]byte, error) {
539 objectMap := make(map[string]interface{})
540 if as.AlertSettingsProperties != nil {
541 objectMap["properties"] = as.AlertSettingsProperties
542 }
543 return json.Marshal(objectMap)
544 }
545
546
547 func (as *AlertSettings) UnmarshalJSON(body []byte) error {
548 var m map[string]*json.RawMessage
549 err := json.Unmarshal(body, &m)
550 if err != nil {
551 return err
552 }
553 for k, v := range m {
554 switch k {
555 case "properties":
556 if v != nil {
557 var alertSettingsProperties AlertSettingsProperties
558 err = json.Unmarshal(*v, &alertSettingsProperties)
559 if err != nil {
560 return err
561 }
562 as.AlertSettingsProperties = &alertSettingsProperties
563 }
564 case "id":
565 if v != nil {
566 var ID string
567 err = json.Unmarshal(*v, &ID)
568 if err != nil {
569 return err
570 }
571 as.ID = &ID
572 }
573 case "name":
574 if v != nil {
575 var name string
576 err = json.Unmarshal(*v, &name)
577 if err != nil {
578 return err
579 }
580 as.Name = &name
581 }
582 case "type":
583 if v != nil {
584 var typeVar string
585 err = json.Unmarshal(*v, &typeVar)
586 if err != nil {
587 return err
588 }
589 as.Type = &typeVar
590 }
591 }
592 }
593
594 return nil
595 }
596
597
598 type AlertSettingsProperties struct {
599
600 EmailNotification AlertEmailNotificationStatus `json:"emailNotification,omitempty"`
601
602 NotificationToServiceOwners ServiceOwnersAlertNotificationStatus `json:"notificationToServiceOwners,omitempty"`
603
604 AlertNotificationCulture *string `json:"alertNotificationCulture,omitempty"`
605
606 AdditionalRecipientEmailList *[]string `json:"additionalRecipientEmailList,omitempty"`
607 }
608
609
610 type AlertSource struct {
611
612 Name *string `json:"name,omitempty"`
613
614 TimeZone *string `json:"timeZone,omitempty"`
615
616 AlertSourceType AlertSourceType `json:"alertSourceType,omitempty"`
617 }
618
619
620
621
622
623 type AsymmetricEncryptedSecret struct {
624
625 Value *string `json:"value,omitempty"`
626
627 EncryptionCertificateThumbprint *string `json:"encryptionCertificateThumbprint,omitempty"`
628
629 EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"`
630 }
631
632
633 type AvailableProviderOperation struct {
634
635
636
637
638 Name *string `json:"name,omitempty"`
639
640
641 Display *AvailableProviderOperationDisplay `json:"display,omitempty"`
642
643
644
645 Origin *string `json:"origin,omitempty"`
646
647
648 Properties interface{} `json:"properties,omitempty"`
649 }
650
651
652
653
654
655
656
657 type AvailableProviderOperationDisplay struct {
658
659
660
661 Provider *string `json:"provider,omitempty"`
662
663
664
665 Resource *string `json:"resource,omitempty"`
666
667
668
669 Operation *string `json:"operation,omitempty"`
670
671
672
673 Description *string `json:"description,omitempty"`
674 }
675
676
677
678 type AvailableProviderOperations struct {
679 autorest.Response `json:"-"`
680
681 Value *[]AvailableProviderOperation `json:"value,omitempty"`
682
683 NextLink *string `json:"nextLink,omitempty"`
684 }
685
686
687
688 type AvailableProviderOperationsIterator struct {
689 i int
690 page AvailableProviderOperationsPage
691 }
692
693
694
695 func (iter *AvailableProviderOperationsIterator) NextWithContext(ctx context.Context) (err error) {
696 if tracing.IsEnabled() {
697 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationsIterator.NextWithContext")
698 defer func() {
699 sc := -1
700 if iter.Response().Response.Response != nil {
701 sc = iter.Response().Response.Response.StatusCode
702 }
703 tracing.EndSpan(ctx, sc, err)
704 }()
705 }
706 iter.i++
707 if iter.i < len(iter.page.Values()) {
708 return nil
709 }
710 err = iter.page.NextWithContext(ctx)
711 if err != nil {
712 iter.i--
713 return err
714 }
715 iter.i = 0
716 return nil
717 }
718
719
720
721
722 func (iter *AvailableProviderOperationsIterator) Next() error {
723 return iter.NextWithContext(context.Background())
724 }
725
726
727 func (iter AvailableProviderOperationsIterator) NotDone() bool {
728 return iter.page.NotDone() && iter.i < len(iter.page.Values())
729 }
730
731
732 func (iter AvailableProviderOperationsIterator) Response() AvailableProviderOperations {
733 return iter.page.Response()
734 }
735
736
737
738 func (iter AvailableProviderOperationsIterator) Value() AvailableProviderOperation {
739 if !iter.page.NotDone() {
740 return AvailableProviderOperation{}
741 }
742 return iter.page.Values()[iter.i]
743 }
744
745
746 func NewAvailableProviderOperationsIterator(page AvailableProviderOperationsPage) AvailableProviderOperationsIterator {
747 return AvailableProviderOperationsIterator{page: page}
748 }
749
750
751 func (apo AvailableProviderOperations) IsEmpty() bool {
752 return apo.Value == nil || len(*apo.Value) == 0
753 }
754
755
756 func (apo AvailableProviderOperations) hasNextLink() bool {
757 return apo.NextLink != nil && len(*apo.NextLink) != 0
758 }
759
760
761
762 func (apo AvailableProviderOperations) availableProviderOperationsPreparer(ctx context.Context) (*http.Request, error) {
763 if !apo.hasNextLink() {
764 return nil, nil
765 }
766 return autorest.Prepare((&http.Request{}).WithContext(ctx),
767 autorest.AsJSON(),
768 autorest.AsGet(),
769 autorest.WithBaseURL(to.String(apo.NextLink)))
770 }
771
772
773 type AvailableProviderOperationsPage struct {
774 fn func(context.Context, AvailableProviderOperations) (AvailableProviderOperations, error)
775 apo AvailableProviderOperations
776 }
777
778
779
780 func (page *AvailableProviderOperationsPage) NextWithContext(ctx context.Context) (err error) {
781 if tracing.IsEnabled() {
782 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationsPage.NextWithContext")
783 defer func() {
784 sc := -1
785 if page.Response().Response.Response != nil {
786 sc = page.Response().Response.Response.StatusCode
787 }
788 tracing.EndSpan(ctx, sc, err)
789 }()
790 }
791 for {
792 next, err := page.fn(ctx, page.apo)
793 if err != nil {
794 return err
795 }
796 page.apo = next
797 if !next.hasNextLink() || !next.IsEmpty() {
798 break
799 }
800 }
801 return nil
802 }
803
804
805
806
807 func (page *AvailableProviderOperationsPage) Next() error {
808 return page.NextWithContext(context.Background())
809 }
810
811
812 func (page AvailableProviderOperationsPage) NotDone() bool {
813 return !page.apo.IsEmpty()
814 }
815
816
817 func (page AvailableProviderOperationsPage) Response() AvailableProviderOperations {
818 return page.apo
819 }
820
821
822 func (page AvailableProviderOperationsPage) Values() []AvailableProviderOperation {
823 if page.apo.IsEmpty() {
824 return nil
825 }
826 return *page.apo.Value
827 }
828
829
830 func NewAvailableProviderOperationsPage(cur AvailableProviderOperations, getNextPage func(context.Context, AvailableProviderOperations) (AvailableProviderOperations, error)) AvailableProviderOperationsPage {
831 return AvailableProviderOperationsPage{
832 fn: getNextPage,
833 apo: cur,
834 }
835 }
836
837
838 type Backup struct {
839
840 *BackupProperties `json:"properties,omitempty"`
841
842 ID *string `json:"id,omitempty"`
843
844 Name *string `json:"name,omitempty"`
845
846 Type *string `json:"type,omitempty"`
847 }
848
849
850 func (b Backup) MarshalJSON() ([]byte, error) {
851 objectMap := make(map[string]interface{})
852 if b.BackupProperties != nil {
853 objectMap["properties"] = b.BackupProperties
854 }
855 return json.Marshal(objectMap)
856 }
857
858
859 func (b *Backup) UnmarshalJSON(body []byte) error {
860 var m map[string]*json.RawMessage
861 err := json.Unmarshal(body, &m)
862 if err != nil {
863 return err
864 }
865 for k, v := range m {
866 switch k {
867 case "properties":
868 if v != nil {
869 var backupProperties BackupProperties
870 err = json.Unmarshal(*v, &backupProperties)
871 if err != nil {
872 return err
873 }
874 b.BackupProperties = &backupProperties
875 }
876 case "id":
877 if v != nil {
878 var ID string
879 err = json.Unmarshal(*v, &ID)
880 if err != nil {
881 return err
882 }
883 b.ID = &ID
884 }
885 case "name":
886 if v != nil {
887 var name string
888 err = json.Unmarshal(*v, &name)
889 if err != nil {
890 return err
891 }
892 b.Name = &name
893 }
894 case "type":
895 if v != nil {
896 var typeVar string
897 err = json.Unmarshal(*v, &typeVar)
898 if err != nil {
899 return err
900 }
901 b.Type = &typeVar
902 }
903 }
904 }
905
906 return nil
907 }
908
909
910 type BackupElement struct {
911
912 *BackupElementProperties `json:"properties,omitempty"`
913
914 ID *string `json:"id,omitempty"`
915
916 Name *string `json:"name,omitempty"`
917
918 Type *string `json:"type,omitempty"`
919 }
920
921
922 func (be BackupElement) MarshalJSON() ([]byte, error) {
923 objectMap := make(map[string]interface{})
924 if be.BackupElementProperties != nil {
925 objectMap["properties"] = be.BackupElementProperties
926 }
927 return json.Marshal(objectMap)
928 }
929
930
931 func (be *BackupElement) UnmarshalJSON(body []byte) error {
932 var m map[string]*json.RawMessage
933 err := json.Unmarshal(body, &m)
934 if err != nil {
935 return err
936 }
937 for k, v := range m {
938 switch k {
939 case "properties":
940 if v != nil {
941 var backupElementProperties BackupElementProperties
942 err = json.Unmarshal(*v, &backupElementProperties)
943 if err != nil {
944 return err
945 }
946 be.BackupElementProperties = &backupElementProperties
947 }
948 case "id":
949 if v != nil {
950 var ID string
951 err = json.Unmarshal(*v, &ID)
952 if err != nil {
953 return err
954 }
955 be.ID = &ID
956 }
957 case "name":
958 if v != nil {
959 var name string
960 err = json.Unmarshal(*v, &name)
961 if err != nil {
962 return err
963 }
964 be.Name = &name
965 }
966 case "type":
967 if v != nil {
968 var typeVar string
969 err = json.Unmarshal(*v, &typeVar)
970 if err != nil {
971 return err
972 }
973 be.Type = &typeVar
974 }
975 }
976 }
977
978 return nil
979 }
980
981
982 type BackupElementProperties struct {
983
984 SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
985
986 EndpointName *string `json:"endpointName,omitempty"`
987
988 DataPolicy DataPolicy `json:"dataPolicy,omitempty"`
989 }
990
991
992 type BackupFilter struct {
993
994 InitiatedBy InitiatedBy `json:"initiatedBy,omitempty"`
995
996 CreatedTime *date.Time `json:"createdTime,omitempty"`
997 }
998
999
1000 type BackupList struct {
1001 autorest.Response `json:"-"`
1002
1003 Value *[]Backup `json:"value,omitempty"`
1004
1005 NextLink *string `json:"nextLink,omitempty"`
1006 }
1007
1008
1009 type BackupListIterator struct {
1010 i int
1011 page BackupListPage
1012 }
1013
1014
1015
1016 func (iter *BackupListIterator) NextWithContext(ctx context.Context) (err error) {
1017 if tracing.IsEnabled() {
1018 ctx = tracing.StartSpan(ctx, fqdn+"/BackupListIterator.NextWithContext")
1019 defer func() {
1020 sc := -1
1021 if iter.Response().Response.Response != nil {
1022 sc = iter.Response().Response.Response.StatusCode
1023 }
1024 tracing.EndSpan(ctx, sc, err)
1025 }()
1026 }
1027 iter.i++
1028 if iter.i < len(iter.page.Values()) {
1029 return nil
1030 }
1031 err = iter.page.NextWithContext(ctx)
1032 if err != nil {
1033 iter.i--
1034 return err
1035 }
1036 iter.i = 0
1037 return nil
1038 }
1039
1040
1041
1042
1043 func (iter *BackupListIterator) Next() error {
1044 return iter.NextWithContext(context.Background())
1045 }
1046
1047
1048 func (iter BackupListIterator) NotDone() bool {
1049 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1050 }
1051
1052
1053 func (iter BackupListIterator) Response() BackupList {
1054 return iter.page.Response()
1055 }
1056
1057
1058
1059 func (iter BackupListIterator) Value() Backup {
1060 if !iter.page.NotDone() {
1061 return Backup{}
1062 }
1063 return iter.page.Values()[iter.i]
1064 }
1065
1066
1067 func NewBackupListIterator(page BackupListPage) BackupListIterator {
1068 return BackupListIterator{page: page}
1069 }
1070
1071
1072 func (bl BackupList) IsEmpty() bool {
1073 return bl.Value == nil || len(*bl.Value) == 0
1074 }
1075
1076
1077 func (bl BackupList) hasNextLink() bool {
1078 return bl.NextLink != nil && len(*bl.NextLink) != 0
1079 }
1080
1081
1082
1083 func (bl BackupList) backupListPreparer(ctx context.Context) (*http.Request, error) {
1084 if !bl.hasNextLink() {
1085 return nil, nil
1086 }
1087 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1088 autorest.AsJSON(),
1089 autorest.AsGet(),
1090 autorest.WithBaseURL(to.String(bl.NextLink)))
1091 }
1092
1093
1094 type BackupListPage struct {
1095 fn func(context.Context, BackupList) (BackupList, error)
1096 bl BackupList
1097 }
1098
1099
1100
1101 func (page *BackupListPage) NextWithContext(ctx context.Context) (err error) {
1102 if tracing.IsEnabled() {
1103 ctx = tracing.StartSpan(ctx, fqdn+"/BackupListPage.NextWithContext")
1104 defer func() {
1105 sc := -1
1106 if page.Response().Response.Response != nil {
1107 sc = page.Response().Response.Response.StatusCode
1108 }
1109 tracing.EndSpan(ctx, sc, err)
1110 }()
1111 }
1112 for {
1113 next, err := page.fn(ctx, page.bl)
1114 if err != nil {
1115 return err
1116 }
1117 page.bl = next
1118 if !next.hasNextLink() || !next.IsEmpty() {
1119 break
1120 }
1121 }
1122 return nil
1123 }
1124
1125
1126
1127
1128 func (page *BackupListPage) Next() error {
1129 return page.NextWithContext(context.Background())
1130 }
1131
1132
1133 func (page BackupListPage) NotDone() bool {
1134 return !page.bl.IsEmpty()
1135 }
1136
1137
1138 func (page BackupListPage) Response() BackupList {
1139 return page.bl
1140 }
1141
1142
1143 func (page BackupListPage) Values() []Backup {
1144 if page.bl.IsEmpty() {
1145 return nil
1146 }
1147 return *page.bl.Value
1148 }
1149
1150
1151 func NewBackupListPage(cur BackupList, getNextPage func(context.Context, BackupList) (BackupList, error)) BackupListPage {
1152 return BackupListPage{
1153 fn: getNextPage,
1154 bl: cur,
1155 }
1156 }
1157
1158
1159 type BackupProperties struct {
1160
1161 TargetID *string `json:"targetId,omitempty"`
1162
1163 TargetType *string `json:"targetType,omitempty"`
1164
1165 SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
1166
1167 CreatedTime *date.Time `json:"createdTime,omitempty"`
1168
1169 ExpirationTime *date.Time `json:"expirationTime,omitempty"`
1170
1171 InitiatedBy InitiatedBy `json:"initiatedBy,omitempty"`
1172
1173 DeviceID *string `json:"deviceId,omitempty"`
1174
1175 Elements *[]BackupElement `json:"elements,omitempty"`
1176 }
1177
1178
1179 type BackupScheduleGroup struct {
1180 autorest.Response `json:"-"`
1181
1182 *BackupScheduleGroupProperties `json:"properties,omitempty"`
1183
1184 ID *string `json:"id,omitempty"`
1185
1186 Name *string `json:"name,omitempty"`
1187
1188 Type *string `json:"type,omitempty"`
1189 }
1190
1191
1192 func (bsg BackupScheduleGroup) MarshalJSON() ([]byte, error) {
1193 objectMap := make(map[string]interface{})
1194 if bsg.BackupScheduleGroupProperties != nil {
1195 objectMap["properties"] = bsg.BackupScheduleGroupProperties
1196 }
1197 return json.Marshal(objectMap)
1198 }
1199
1200
1201 func (bsg *BackupScheduleGroup) UnmarshalJSON(body []byte) error {
1202 var m map[string]*json.RawMessage
1203 err := json.Unmarshal(body, &m)
1204 if err != nil {
1205 return err
1206 }
1207 for k, v := range m {
1208 switch k {
1209 case "properties":
1210 if v != nil {
1211 var backupScheduleGroupProperties BackupScheduleGroupProperties
1212 err = json.Unmarshal(*v, &backupScheduleGroupProperties)
1213 if err != nil {
1214 return err
1215 }
1216 bsg.BackupScheduleGroupProperties = &backupScheduleGroupProperties
1217 }
1218 case "id":
1219 if v != nil {
1220 var ID string
1221 err = json.Unmarshal(*v, &ID)
1222 if err != nil {
1223 return err
1224 }
1225 bsg.ID = &ID
1226 }
1227 case "name":
1228 if v != nil {
1229 var name string
1230 err = json.Unmarshal(*v, &name)
1231 if err != nil {
1232 return err
1233 }
1234 bsg.Name = &name
1235 }
1236 case "type":
1237 if v != nil {
1238 var typeVar string
1239 err = json.Unmarshal(*v, &typeVar)
1240 if err != nil {
1241 return err
1242 }
1243 bsg.Type = &typeVar
1244 }
1245 }
1246 }
1247
1248 return nil
1249 }
1250
1251
1252 type BackupScheduleGroupList struct {
1253 autorest.Response `json:"-"`
1254
1255 Value *[]BackupScheduleGroup `json:"value,omitempty"`
1256 }
1257
1258
1259 type BackupScheduleGroupProperties struct {
1260
1261 StartTime *Time `json:"startTime,omitempty"`
1262 }
1263
1264
1265
1266 type BackupScheduleGroupsCreateOrUpdateFuture struct {
1267 azure.FutureAPI
1268
1269
1270 Result func(BackupScheduleGroupsClient) (BackupScheduleGroup, error)
1271 }
1272
1273
1274 func (future *BackupScheduleGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1275 var azFuture azure.Future
1276 if err := json.Unmarshal(body, &azFuture); err != nil {
1277 return err
1278 }
1279 future.FutureAPI = &azFuture
1280 future.Result = future.result
1281 return nil
1282 }
1283
1284
1285 func (future *BackupScheduleGroupsCreateOrUpdateFuture) result(client BackupScheduleGroupsClient) (bsg BackupScheduleGroup, err error) {
1286 var done bool
1287 done, err = future.DoneWithContext(context.Background(), client)
1288 if err != nil {
1289 err = autorest.NewErrorWithError(err, "storsimple.BackupScheduleGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1290 return
1291 }
1292 if !done {
1293 bsg.Response.Response = future.Response()
1294 err = azure.NewAsyncOpIncompleteError("storsimple.BackupScheduleGroupsCreateOrUpdateFuture")
1295 return
1296 }
1297 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1298 if bsg.Response.Response, err = future.GetResult(sender); err == nil && bsg.Response.Response.StatusCode != http.StatusNoContent {
1299 bsg, err = client.CreateOrUpdateResponder(bsg.Response.Response)
1300 if err != nil {
1301 err = autorest.NewErrorWithError(err, "storsimple.BackupScheduleGroupsCreateOrUpdateFuture", "Result", bsg.Response.Response, "Failure responding to request")
1302 }
1303 }
1304 return
1305 }
1306
1307
1308
1309 type BackupScheduleGroupsDeleteFuture struct {
1310 azure.FutureAPI
1311
1312
1313 Result func(BackupScheduleGroupsClient) (autorest.Response, error)
1314 }
1315
1316
1317 func (future *BackupScheduleGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
1318 var azFuture azure.Future
1319 if err := json.Unmarshal(body, &azFuture); err != nil {
1320 return err
1321 }
1322 future.FutureAPI = &azFuture
1323 future.Result = future.result
1324 return nil
1325 }
1326
1327
1328 func (future *BackupScheduleGroupsDeleteFuture) result(client BackupScheduleGroupsClient) (ar autorest.Response, err error) {
1329 var done bool
1330 done, err = future.DoneWithContext(context.Background(), client)
1331 if err != nil {
1332 err = autorest.NewErrorWithError(err, "storsimple.BackupScheduleGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
1333 return
1334 }
1335 if !done {
1336 ar.Response = future.Response()
1337 err = azure.NewAsyncOpIncompleteError("storsimple.BackupScheduleGroupsDeleteFuture")
1338 return
1339 }
1340 ar.Response = future.Response()
1341 return
1342 }
1343
1344
1345 type BackupsCloneFuture struct {
1346 azure.FutureAPI
1347
1348
1349 Result func(BackupsClient) (autorest.Response, error)
1350 }
1351
1352
1353 func (future *BackupsCloneFuture) UnmarshalJSON(body []byte) error {
1354 var azFuture azure.Future
1355 if err := json.Unmarshal(body, &azFuture); err != nil {
1356 return err
1357 }
1358 future.FutureAPI = &azFuture
1359 future.Result = future.result
1360 return nil
1361 }
1362
1363
1364 func (future *BackupsCloneFuture) result(client BackupsClient) (ar autorest.Response, err error) {
1365 var done bool
1366 done, err = future.DoneWithContext(context.Background(), client)
1367 if err != nil {
1368 err = autorest.NewErrorWithError(err, "storsimple.BackupsCloneFuture", "Result", future.Response(), "Polling failure")
1369 return
1370 }
1371 if !done {
1372 ar.Response = future.Response()
1373 err = azure.NewAsyncOpIncompleteError("storsimple.BackupsCloneFuture")
1374 return
1375 }
1376 ar.Response = future.Response()
1377 return
1378 }
1379
1380
1381
1382 type BackupsDeleteFuture struct {
1383 azure.FutureAPI
1384
1385
1386 Result func(BackupsClient) (autorest.Response, error)
1387 }
1388
1389
1390 func (future *BackupsDeleteFuture) UnmarshalJSON(body []byte) error {
1391 var azFuture azure.Future
1392 if err := json.Unmarshal(body, &azFuture); err != nil {
1393 return err
1394 }
1395 future.FutureAPI = &azFuture
1396 future.Result = future.result
1397 return nil
1398 }
1399
1400
1401 func (future *BackupsDeleteFuture) result(client BackupsClient) (ar autorest.Response, err error) {
1402 var done bool
1403 done, err = future.DoneWithContext(context.Background(), client)
1404 if err != nil {
1405 err = autorest.NewErrorWithError(err, "storsimple.BackupsDeleteFuture", "Result", future.Response(), "Polling failure")
1406 return
1407 }
1408 if !done {
1409 ar.Response = future.Response()
1410 err = azure.NewAsyncOpIncompleteError("storsimple.BackupsDeleteFuture")
1411 return
1412 }
1413 ar.Response = future.Response()
1414 return
1415 }
1416
1417
1418 type BaseModel struct {
1419
1420 ID *string `json:"id,omitempty"`
1421
1422 Name *string `json:"name,omitempty"`
1423
1424 Type *string `json:"type,omitempty"`
1425 }
1426
1427
1428 func (bm BaseModel) MarshalJSON() ([]byte, error) {
1429 objectMap := make(map[string]interface{})
1430 return json.Marshal(objectMap)
1431 }
1432
1433
1434 type ChapProperties struct {
1435
1436 Password *AsymmetricEncryptedSecret `json:"password,omitempty"`
1437 }
1438
1439
1440 type ChapSettings struct {
1441 autorest.Response `json:"-"`
1442
1443 *ChapProperties `json:"properties,omitempty"`
1444
1445 ID *string `json:"id,omitempty"`
1446
1447 Name *string `json:"name,omitempty"`
1448
1449 Type *string `json:"type,omitempty"`
1450 }
1451
1452
1453 func (cs ChapSettings) MarshalJSON() ([]byte, error) {
1454 objectMap := make(map[string]interface{})
1455 if cs.ChapProperties != nil {
1456 objectMap["properties"] = cs.ChapProperties
1457 }
1458 return json.Marshal(objectMap)
1459 }
1460
1461
1462 func (cs *ChapSettings) UnmarshalJSON(body []byte) error {
1463 var m map[string]*json.RawMessage
1464 err := json.Unmarshal(body, &m)
1465 if err != nil {
1466 return err
1467 }
1468 for k, v := range m {
1469 switch k {
1470 case "properties":
1471 if v != nil {
1472 var chapProperties ChapProperties
1473 err = json.Unmarshal(*v, &chapProperties)
1474 if err != nil {
1475 return err
1476 }
1477 cs.ChapProperties = &chapProperties
1478 }
1479 case "id":
1480 if v != nil {
1481 var ID string
1482 err = json.Unmarshal(*v, &ID)
1483 if err != nil {
1484 return err
1485 }
1486 cs.ID = &ID
1487 }
1488 case "name":
1489 if v != nil {
1490 var name string
1491 err = json.Unmarshal(*v, &name)
1492 if err != nil {
1493 return err
1494 }
1495 cs.Name = &name
1496 }
1497 case "type":
1498 if v != nil {
1499 var typeVar string
1500 err = json.Unmarshal(*v, &typeVar)
1501 if err != nil {
1502 return err
1503 }
1504 cs.Type = &typeVar
1505 }
1506 }
1507 }
1508
1509 return nil
1510 }
1511
1512
1513
1514 type ChapSettingsCreateOrUpdateFuture struct {
1515 azure.FutureAPI
1516
1517
1518 Result func(ChapSettingsClient) (ChapSettings, error)
1519 }
1520
1521
1522 func (future *ChapSettingsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1523 var azFuture azure.Future
1524 if err := json.Unmarshal(body, &azFuture); err != nil {
1525 return err
1526 }
1527 future.FutureAPI = &azFuture
1528 future.Result = future.result
1529 return nil
1530 }
1531
1532
1533 func (future *ChapSettingsCreateOrUpdateFuture) result(client ChapSettingsClient) (cs ChapSettings, err error) {
1534 var done bool
1535 done, err = future.DoneWithContext(context.Background(), client)
1536 if err != nil {
1537 err = autorest.NewErrorWithError(err, "storsimple.ChapSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1538 return
1539 }
1540 if !done {
1541 cs.Response.Response = future.Response()
1542 err = azure.NewAsyncOpIncompleteError("storsimple.ChapSettingsCreateOrUpdateFuture")
1543 return
1544 }
1545 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1546 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent {
1547 cs, err = client.CreateOrUpdateResponder(cs.Response.Response)
1548 if err != nil {
1549 err = autorest.NewErrorWithError(err, "storsimple.ChapSettingsCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request")
1550 }
1551 }
1552 return
1553 }
1554
1555
1556
1557 type ChapSettingsDeleteFuture struct {
1558 azure.FutureAPI
1559
1560
1561 Result func(ChapSettingsClient) (autorest.Response, error)
1562 }
1563
1564
1565 func (future *ChapSettingsDeleteFuture) UnmarshalJSON(body []byte) error {
1566 var azFuture azure.Future
1567 if err := json.Unmarshal(body, &azFuture); err != nil {
1568 return err
1569 }
1570 future.FutureAPI = &azFuture
1571 future.Result = future.result
1572 return nil
1573 }
1574
1575
1576 func (future *ChapSettingsDeleteFuture) result(client ChapSettingsClient) (ar autorest.Response, err error) {
1577 var done bool
1578 done, err = future.DoneWithContext(context.Background(), client)
1579 if err != nil {
1580 err = autorest.NewErrorWithError(err, "storsimple.ChapSettingsDeleteFuture", "Result", future.Response(), "Polling failure")
1581 return
1582 }
1583 if !done {
1584 ar.Response = future.Response()
1585 err = azure.NewAsyncOpIncompleteError("storsimple.ChapSettingsDeleteFuture")
1586 return
1587 }
1588 ar.Response = future.Response()
1589 return
1590 }
1591
1592
1593 type ChapSettingsList struct {
1594 autorest.Response `json:"-"`
1595
1596 Value *[]ChapSettings `json:"value,omitempty"`
1597 }
1598
1599
1600 type ClearAlertRequest struct {
1601
1602 ResolutionMessage *string `json:"resolutionMessage,omitempty"`
1603
1604 Alerts *[]string `json:"alerts,omitempty"`
1605 }
1606
1607
1608 type CloneRequest struct {
1609
1610 *CloneRequestProperties `json:"properties,omitempty"`
1611 }
1612
1613
1614 func (cr CloneRequest) MarshalJSON() ([]byte, error) {
1615 objectMap := make(map[string]interface{})
1616 if cr.CloneRequestProperties != nil {
1617 objectMap["properties"] = cr.CloneRequestProperties
1618 }
1619 return json.Marshal(objectMap)
1620 }
1621
1622
1623 func (cr *CloneRequest) UnmarshalJSON(body []byte) error {
1624 var m map[string]*json.RawMessage
1625 err := json.Unmarshal(body, &m)
1626 if err != nil {
1627 return err
1628 }
1629 for k, v := range m {
1630 switch k {
1631 case "properties":
1632 if v != nil {
1633 var cloneRequestProperties CloneRequestProperties
1634 err = json.Unmarshal(*v, &cloneRequestProperties)
1635 if err != nil {
1636 return err
1637 }
1638 cr.CloneRequestProperties = &cloneRequestProperties
1639 }
1640 }
1641 }
1642
1643 return nil
1644 }
1645
1646
1647 type CloneRequestProperties struct {
1648
1649 TargetDeviceID *string `json:"targetDeviceId,omitempty"`
1650
1651 TargetAccessPointID *string `json:"targetAccessPointId,omitempty"`
1652
1653 NewEndpointName *string `json:"newEndpointName,omitempty"`
1654
1655 Share *FileShare `json:"share,omitempty"`
1656
1657 Disk *ISCSIDisk `json:"disk,omitempty"`
1658 }
1659
1660
1661 type Device struct {
1662 autorest.Response `json:"-"`
1663
1664 *DeviceProperties `json:"properties,omitempty"`
1665
1666 ID *string `json:"id,omitempty"`
1667
1668 Name *string `json:"name,omitempty"`
1669
1670 Type *string `json:"type,omitempty"`
1671 }
1672
1673
1674 func (d Device) MarshalJSON() ([]byte, error) {
1675 objectMap := make(map[string]interface{})
1676 if d.DeviceProperties != nil {
1677 objectMap["properties"] = d.DeviceProperties
1678 }
1679 return json.Marshal(objectMap)
1680 }
1681
1682
1683 func (d *Device) UnmarshalJSON(body []byte) error {
1684 var m map[string]*json.RawMessage
1685 err := json.Unmarshal(body, &m)
1686 if err != nil {
1687 return err
1688 }
1689 for k, v := range m {
1690 switch k {
1691 case "properties":
1692 if v != nil {
1693 var deviceProperties DeviceProperties
1694 err = json.Unmarshal(*v, &deviceProperties)
1695 if err != nil {
1696 return err
1697 }
1698 d.DeviceProperties = &deviceProperties
1699 }
1700 case "id":
1701 if v != nil {
1702 var ID string
1703 err = json.Unmarshal(*v, &ID)
1704 if err != nil {
1705 return err
1706 }
1707 d.ID = &ID
1708 }
1709 case "name":
1710 if v != nil {
1711 var name string
1712 err = json.Unmarshal(*v, &name)
1713 if err != nil {
1714 return err
1715 }
1716 d.Name = &name
1717 }
1718 case "type":
1719 if v != nil {
1720 var typeVar string
1721 err = json.Unmarshal(*v, &typeVar)
1722 if err != nil {
1723 return err
1724 }
1725 d.Type = &typeVar
1726 }
1727 }
1728 }
1729
1730 return nil
1731 }
1732
1733
1734 type DeviceDetails struct {
1735
1736 EndpointCount *int32 `json:"endpointCount,omitempty"`
1737
1738 TotalStorageInBytes *int64 `json:"totalStorageInBytes,omitempty"`
1739
1740 TotalLocalStorageInBytes *int64 `json:"totalLocalStorageInBytes,omitempty"`
1741
1742 ProvisionedStorageInBytes *int64 `json:"provisionedStorageInBytes,omitempty"`
1743
1744 ProvisionedLocalStorageInBytes *int64 `json:"provisionedLocalStorageInBytes,omitempty"`
1745
1746 UsingStorageInBytes *int64 `json:"usingStorageInBytes,omitempty"`
1747
1748 UsingLocalStorageInBytes *int64 `json:"usingLocalStorageInBytes,omitempty"`
1749
1750 TotalBackupSizeInBytes *int64 `json:"totalBackupSizeInBytes,omitempty"`
1751
1752 AvailableStorageInBytes *int64 `json:"availableStorageInBytes,omitempty"`
1753
1754 AvailableLocalStorageInBytes *int64 `json:"availableLocalStorageInBytes,omitempty"`
1755 }
1756
1757
1758 type DeviceList struct {
1759 autorest.Response `json:"-"`
1760
1761 Value *[]Device `json:"value,omitempty"`
1762 }
1763
1764
1765
1766 type DevicePatch struct {
1767
1768 DeviceDescription *string `json:"deviceDescription,omitempty"`
1769 }
1770
1771
1772 type DeviceProperties struct {
1773
1774 ActivationTime *date.Time `json:"activationTime,omitempty"`
1775
1776 AllowedDeviceOperations *[]DeviceOperation `json:"allowedDeviceOperations,omitempty"`
1777
1778 Culture *string `json:"culture,omitempty"`
1779
1780 DeviceCapabilities *[]SupportedDeviceCapabilities `json:"deviceCapabilities,omitempty"`
1781
1782 DeviceDescription *string `json:"deviceDescription,omitempty"`
1783
1784 DomainName *string `json:"domainName,omitempty"`
1785
1786 DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"`
1787
1788 FriendlySoftwareName *string `json:"friendlySoftwareName,omitempty"`
1789
1790 DeviceConfigurationStatus DeviceConfigurationStatus `json:"deviceConfigurationStatus,omitempty"`
1791
1792 ModelDescription *string `json:"modelDescription,omitempty"`
1793
1794 Status DeviceStatus `json:"status,omitempty"`
1795
1796 Type DeviceType `json:"type,omitempty"`
1797
1798 Details *DeviceDetails `json:"details,omitempty"`
1799 }
1800
1801
1802
1803 type DevicesCreateOrUpdateAlertSettingsFuture struct {
1804 azure.FutureAPI
1805
1806
1807 Result func(DevicesClient) (AlertSettings, error)
1808 }
1809
1810
1811 func (future *DevicesCreateOrUpdateAlertSettingsFuture) UnmarshalJSON(body []byte) error {
1812 var azFuture azure.Future
1813 if err := json.Unmarshal(body, &azFuture); err != nil {
1814 return err
1815 }
1816 future.FutureAPI = &azFuture
1817 future.Result = future.result
1818 return nil
1819 }
1820
1821
1822 func (future *DevicesCreateOrUpdateAlertSettingsFuture) result(client DevicesClient) (as AlertSettings, err error) {
1823 var done bool
1824 done, err = future.DoneWithContext(context.Background(), client)
1825 if err != nil {
1826 err = autorest.NewErrorWithError(err, "storsimple.DevicesCreateOrUpdateAlertSettingsFuture", "Result", future.Response(), "Polling failure")
1827 return
1828 }
1829 if !done {
1830 as.Response.Response = future.Response()
1831 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesCreateOrUpdateAlertSettingsFuture")
1832 return
1833 }
1834 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1835 if as.Response.Response, err = future.GetResult(sender); err == nil && as.Response.Response.StatusCode != http.StatusNoContent {
1836 as, err = client.CreateOrUpdateAlertSettingsResponder(as.Response.Response)
1837 if err != nil {
1838 err = autorest.NewErrorWithError(err, "storsimple.DevicesCreateOrUpdateAlertSettingsFuture", "Result", as.Response.Response, "Failure responding to request")
1839 }
1840 }
1841 return
1842 }
1843
1844
1845
1846 type DevicesCreateOrUpdateSecuritySettingsFuture struct {
1847 azure.FutureAPI
1848
1849
1850 Result func(DevicesClient) (autorest.Response, error)
1851 }
1852
1853
1854 func (future *DevicesCreateOrUpdateSecuritySettingsFuture) UnmarshalJSON(body []byte) error {
1855 var azFuture azure.Future
1856 if err := json.Unmarshal(body, &azFuture); err != nil {
1857 return err
1858 }
1859 future.FutureAPI = &azFuture
1860 future.Result = future.result
1861 return nil
1862 }
1863
1864
1865 func (future *DevicesCreateOrUpdateSecuritySettingsFuture) result(client DevicesClient) (ar autorest.Response, err error) {
1866 var done bool
1867 done, err = future.DoneWithContext(context.Background(), client)
1868 if err != nil {
1869 err = autorest.NewErrorWithError(err, "storsimple.DevicesCreateOrUpdateSecuritySettingsFuture", "Result", future.Response(), "Polling failure")
1870 return
1871 }
1872 if !done {
1873 ar.Response = future.Response()
1874 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesCreateOrUpdateSecuritySettingsFuture")
1875 return
1876 }
1877 ar.Response = future.Response()
1878 return
1879 }
1880
1881
1882
1883 type DevicesDeactivateFuture struct {
1884 azure.FutureAPI
1885
1886
1887 Result func(DevicesClient) (autorest.Response, error)
1888 }
1889
1890
1891 func (future *DevicesDeactivateFuture) UnmarshalJSON(body []byte) error {
1892 var azFuture azure.Future
1893 if err := json.Unmarshal(body, &azFuture); err != nil {
1894 return err
1895 }
1896 future.FutureAPI = &azFuture
1897 future.Result = future.result
1898 return nil
1899 }
1900
1901
1902 func (future *DevicesDeactivateFuture) result(client DevicesClient) (ar autorest.Response, err error) {
1903 var done bool
1904 done, err = future.DoneWithContext(context.Background(), client)
1905 if err != nil {
1906 err = autorest.NewErrorWithError(err, "storsimple.DevicesDeactivateFuture", "Result", future.Response(), "Polling failure")
1907 return
1908 }
1909 if !done {
1910 ar.Response = future.Response()
1911 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDeactivateFuture")
1912 return
1913 }
1914 ar.Response = future.Response()
1915 return
1916 }
1917
1918
1919
1920 type DevicesDeleteFuture struct {
1921 azure.FutureAPI
1922
1923
1924 Result func(DevicesClient) (autorest.Response, error)
1925 }
1926
1927
1928 func (future *DevicesDeleteFuture) UnmarshalJSON(body []byte) error {
1929 var azFuture azure.Future
1930 if err := json.Unmarshal(body, &azFuture); err != nil {
1931 return err
1932 }
1933 future.FutureAPI = &azFuture
1934 future.Result = future.result
1935 return nil
1936 }
1937
1938
1939 func (future *DevicesDeleteFuture) result(client DevicesClient) (ar autorest.Response, err error) {
1940 var done bool
1941 done, err = future.DoneWithContext(context.Background(), client)
1942 if err != nil {
1943 err = autorest.NewErrorWithError(err, "storsimple.DevicesDeleteFuture", "Result", future.Response(), "Polling failure")
1944 return
1945 }
1946 if !done {
1947 ar.Response = future.Response()
1948 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDeleteFuture")
1949 return
1950 }
1951 ar.Response = future.Response()
1952 return
1953 }
1954
1955
1956
1957 type DevicesDownloadUpdatesFuture struct {
1958 azure.FutureAPI
1959
1960
1961 Result func(DevicesClient) (autorest.Response, error)
1962 }
1963
1964
1965 func (future *DevicesDownloadUpdatesFuture) UnmarshalJSON(body []byte) error {
1966 var azFuture azure.Future
1967 if err := json.Unmarshal(body, &azFuture); err != nil {
1968 return err
1969 }
1970 future.FutureAPI = &azFuture
1971 future.Result = future.result
1972 return nil
1973 }
1974
1975
1976 func (future *DevicesDownloadUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) {
1977 var done bool
1978 done, err = future.DoneWithContext(context.Background(), client)
1979 if err != nil {
1980 err = autorest.NewErrorWithError(err, "storsimple.DevicesDownloadUpdatesFuture", "Result", future.Response(), "Polling failure")
1981 return
1982 }
1983 if !done {
1984 ar.Response = future.Response()
1985 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDownloadUpdatesFuture")
1986 return
1987 }
1988 ar.Response = future.Response()
1989 return
1990 }
1991
1992
1993
1994 type DevicesFailoverFuture struct {
1995 azure.FutureAPI
1996
1997
1998 Result func(DevicesClient) (autorest.Response, error)
1999 }
2000
2001
2002 func (future *DevicesFailoverFuture) UnmarshalJSON(body []byte) error {
2003 var azFuture azure.Future
2004 if err := json.Unmarshal(body, &azFuture); err != nil {
2005 return err
2006 }
2007 future.FutureAPI = &azFuture
2008 future.Result = future.result
2009 return nil
2010 }
2011
2012
2013 func (future *DevicesFailoverFuture) result(client DevicesClient) (ar autorest.Response, err error) {
2014 var done bool
2015 done, err = future.DoneWithContext(context.Background(), client)
2016 if err != nil {
2017 err = autorest.NewErrorWithError(err, "storsimple.DevicesFailoverFuture", "Result", future.Response(), "Polling failure")
2018 return
2019 }
2020 if !done {
2021 ar.Response = future.Response()
2022 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesFailoverFuture")
2023 return
2024 }
2025 ar.Response = future.Response()
2026 return
2027 }
2028
2029
2030
2031 type DevicesInstallUpdatesFuture struct {
2032 azure.FutureAPI
2033
2034
2035 Result func(DevicesClient) (autorest.Response, error)
2036 }
2037
2038
2039 func (future *DevicesInstallUpdatesFuture) UnmarshalJSON(body []byte) error {
2040 var azFuture azure.Future
2041 if err := json.Unmarshal(body, &azFuture); err != nil {
2042 return err
2043 }
2044 future.FutureAPI = &azFuture
2045 future.Result = future.result
2046 return nil
2047 }
2048
2049
2050 func (future *DevicesInstallUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) {
2051 var done bool
2052 done, err = future.DoneWithContext(context.Background(), client)
2053 if err != nil {
2054 err = autorest.NewErrorWithError(err, "storsimple.DevicesInstallUpdatesFuture", "Result", future.Response(), "Polling failure")
2055 return
2056 }
2057 if !done {
2058 ar.Response = future.Response()
2059 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesInstallUpdatesFuture")
2060 return
2061 }
2062 ar.Response = future.Response()
2063 return
2064 }
2065
2066
2067 type DevicesPatchFuture struct {
2068 azure.FutureAPI
2069
2070
2071 Result func(DevicesClient) (Device, error)
2072 }
2073
2074
2075 func (future *DevicesPatchFuture) UnmarshalJSON(body []byte) error {
2076 var azFuture azure.Future
2077 if err := json.Unmarshal(body, &azFuture); err != nil {
2078 return err
2079 }
2080 future.FutureAPI = &azFuture
2081 future.Result = future.result
2082 return nil
2083 }
2084
2085
2086 func (future *DevicesPatchFuture) result(client DevicesClient) (d Device, err error) {
2087 var done bool
2088 done, err = future.DoneWithContext(context.Background(), client)
2089 if err != nil {
2090 err = autorest.NewErrorWithError(err, "storsimple.DevicesPatchFuture", "Result", future.Response(), "Polling failure")
2091 return
2092 }
2093 if !done {
2094 d.Response.Response = future.Response()
2095 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesPatchFuture")
2096 return
2097 }
2098 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2099 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2100 d, err = client.PatchResponder(d.Response.Response)
2101 if err != nil {
2102 err = autorest.NewErrorWithError(err, "storsimple.DevicesPatchFuture", "Result", d.Response.Response, "Failure responding to request")
2103 }
2104 }
2105 return
2106 }
2107
2108
2109
2110 type DevicesScanForUpdatesFuture struct {
2111 azure.FutureAPI
2112
2113
2114 Result func(DevicesClient) (autorest.Response, error)
2115 }
2116
2117
2118 func (future *DevicesScanForUpdatesFuture) UnmarshalJSON(body []byte) error {
2119 var azFuture azure.Future
2120 if err := json.Unmarshal(body, &azFuture); err != nil {
2121 return err
2122 }
2123 future.FutureAPI = &azFuture
2124 future.Result = future.result
2125 return nil
2126 }
2127
2128
2129 func (future *DevicesScanForUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) {
2130 var done bool
2131 done, err = future.DoneWithContext(context.Background(), client)
2132 if err != nil {
2133 err = autorest.NewErrorWithError(err, "storsimple.DevicesScanForUpdatesFuture", "Result", future.Response(), "Polling failure")
2134 return
2135 }
2136 if !done {
2137 ar.Response = future.Response()
2138 err = azure.NewAsyncOpIncompleteError("storsimple.DevicesScanForUpdatesFuture")
2139 return
2140 }
2141 ar.Response = future.Response()
2142 return
2143 }
2144
2145
2146 type EncryptionSettings struct {
2147 autorest.Response `json:"-"`
2148
2149 *EncryptionSettingsProperties `json:"properties,omitempty"`
2150
2151 ID *string `json:"id,omitempty"`
2152
2153 Name *string `json:"name,omitempty"`
2154
2155 Type *string `json:"type,omitempty"`
2156 }
2157
2158
2159 func (es EncryptionSettings) MarshalJSON() ([]byte, error) {
2160 objectMap := make(map[string]interface{})
2161 if es.EncryptionSettingsProperties != nil {
2162 objectMap["properties"] = es.EncryptionSettingsProperties
2163 }
2164 return json.Marshal(objectMap)
2165 }
2166
2167
2168 func (es *EncryptionSettings) UnmarshalJSON(body []byte) error {
2169 var m map[string]*json.RawMessage
2170 err := json.Unmarshal(body, &m)
2171 if err != nil {
2172 return err
2173 }
2174 for k, v := range m {
2175 switch k {
2176 case "properties":
2177 if v != nil {
2178 var encryptionSettingsProperties EncryptionSettingsProperties
2179 err = json.Unmarshal(*v, &encryptionSettingsProperties)
2180 if err != nil {
2181 return err
2182 }
2183 es.EncryptionSettingsProperties = &encryptionSettingsProperties
2184 }
2185 case "id":
2186 if v != nil {
2187 var ID string
2188 err = json.Unmarshal(*v, &ID)
2189 if err != nil {
2190 return err
2191 }
2192 es.ID = &ID
2193 }
2194 case "name":
2195 if v != nil {
2196 var name string
2197 err = json.Unmarshal(*v, &name)
2198 if err != nil {
2199 return err
2200 }
2201 es.Name = &name
2202 }
2203 case "type":
2204 if v != nil {
2205 var typeVar string
2206 err = json.Unmarshal(*v, &typeVar)
2207 if err != nil {
2208 return err
2209 }
2210 es.Type = &typeVar
2211 }
2212 }
2213 }
2214
2215 return nil
2216 }
2217
2218
2219 type EncryptionSettingsProperties struct {
2220
2221 EncryptionStatus EncryptionStatus `json:"encryptionStatus,omitempty"`
2222
2223 KeyRolloverStatus KeyRolloverStatus `json:"keyRolloverStatus,omitempty"`
2224 }
2225
2226
2227 type Error struct {
2228 ErrorCode *string `json:"errorCode,omitempty"`
2229 Message *Message `json:"message,omitempty"`
2230 Values *[]Item `json:"values,omitempty"`
2231 }
2232
2233
2234 type FailoverRequest struct {
2235 AccesspointIds *[]string `json:"accesspointIds,omitempty"`
2236 TargetDeviceID *string `json:"targetDeviceId,omitempty"`
2237 SkipValidation *bool `json:"skipValidation,omitempty"`
2238 KeepSourceDevice *bool `json:"keepSourceDevice,omitempty"`
2239 }
2240
2241
2242 type FileServer struct {
2243 autorest.Response `json:"-"`
2244
2245 *FileServerProperties `json:"properties,omitempty"`
2246
2247 ID *string `json:"id,omitempty"`
2248
2249 Name *string `json:"name,omitempty"`
2250
2251 Type *string `json:"type,omitempty"`
2252 }
2253
2254
2255 func (fs FileServer) MarshalJSON() ([]byte, error) {
2256 objectMap := make(map[string]interface{})
2257 if fs.FileServerProperties != nil {
2258 objectMap["properties"] = fs.FileServerProperties
2259 }
2260 return json.Marshal(objectMap)
2261 }
2262
2263
2264 func (fs *FileServer) UnmarshalJSON(body []byte) error {
2265 var m map[string]*json.RawMessage
2266 err := json.Unmarshal(body, &m)
2267 if err != nil {
2268 return err
2269 }
2270 for k, v := range m {
2271 switch k {
2272 case "properties":
2273 if v != nil {
2274 var fileServerProperties FileServerProperties
2275 err = json.Unmarshal(*v, &fileServerProperties)
2276 if err != nil {
2277 return err
2278 }
2279 fs.FileServerProperties = &fileServerProperties
2280 }
2281 case "id":
2282 if v != nil {
2283 var ID string
2284 err = json.Unmarshal(*v, &ID)
2285 if err != nil {
2286 return err
2287 }
2288 fs.ID = &ID
2289 }
2290 case "name":
2291 if v != nil {
2292 var name string
2293 err = json.Unmarshal(*v, &name)
2294 if err != nil {
2295 return err
2296 }
2297 fs.Name = &name
2298 }
2299 case "type":
2300 if v != nil {
2301 var typeVar string
2302 err = json.Unmarshal(*v, &typeVar)
2303 if err != nil {
2304 return err
2305 }
2306 fs.Type = &typeVar
2307 }
2308 }
2309 }
2310
2311 return nil
2312 }
2313
2314
2315 type FileServerList struct {
2316 autorest.Response `json:"-"`
2317
2318 Value *[]FileServer `json:"value,omitempty"`
2319 }
2320
2321
2322 type FileServerProperties struct {
2323
2324 DomainName *string `json:"domainName,omitempty"`
2325
2326 StorageDomainID *string `json:"storageDomainId,omitempty"`
2327
2328 BackupScheduleGroupID *string `json:"backupScheduleGroupId,omitempty"`
2329
2330 Description *string `json:"description,omitempty"`
2331 }
2332
2333
2334
2335 type FileServersBackupNowFuture struct {
2336 azure.FutureAPI
2337
2338
2339 Result func(FileServersClient) (autorest.Response, error)
2340 }
2341
2342
2343 func (future *FileServersBackupNowFuture) UnmarshalJSON(body []byte) error {
2344 var azFuture azure.Future
2345 if err := json.Unmarshal(body, &azFuture); err != nil {
2346 return err
2347 }
2348 future.FutureAPI = &azFuture
2349 future.Result = future.result
2350 return nil
2351 }
2352
2353
2354 func (future *FileServersBackupNowFuture) result(client FileServersClient) (ar autorest.Response, err error) {
2355 var done bool
2356 done, err = future.DoneWithContext(context.Background(), client)
2357 if err != nil {
2358 err = autorest.NewErrorWithError(err, "storsimple.FileServersBackupNowFuture", "Result", future.Response(), "Polling failure")
2359 return
2360 }
2361 if !done {
2362 ar.Response = future.Response()
2363 err = azure.NewAsyncOpIncompleteError("storsimple.FileServersBackupNowFuture")
2364 return
2365 }
2366 ar.Response = future.Response()
2367 return
2368 }
2369
2370
2371
2372 type FileServersCreateOrUpdateFuture struct {
2373 azure.FutureAPI
2374
2375
2376 Result func(FileServersClient) (FileServer, error)
2377 }
2378
2379
2380 func (future *FileServersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2381 var azFuture azure.Future
2382 if err := json.Unmarshal(body, &azFuture); err != nil {
2383 return err
2384 }
2385 future.FutureAPI = &azFuture
2386 future.Result = future.result
2387 return nil
2388 }
2389
2390
2391 func (future *FileServersCreateOrUpdateFuture) result(client FileServersClient) (fs FileServer, err error) {
2392 var done bool
2393 done, err = future.DoneWithContext(context.Background(), client)
2394 if err != nil {
2395 err = autorest.NewErrorWithError(err, "storsimple.FileServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2396 return
2397 }
2398 if !done {
2399 fs.Response.Response = future.Response()
2400 err = azure.NewAsyncOpIncompleteError("storsimple.FileServersCreateOrUpdateFuture")
2401 return
2402 }
2403 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2404 if fs.Response.Response, err = future.GetResult(sender); err == nil && fs.Response.Response.StatusCode != http.StatusNoContent {
2405 fs, err = client.CreateOrUpdateResponder(fs.Response.Response)
2406 if err != nil {
2407 err = autorest.NewErrorWithError(err, "storsimple.FileServersCreateOrUpdateFuture", "Result", fs.Response.Response, "Failure responding to request")
2408 }
2409 }
2410 return
2411 }
2412
2413
2414
2415 type FileServersDeleteFuture struct {
2416 azure.FutureAPI
2417
2418
2419 Result func(FileServersClient) (autorest.Response, error)
2420 }
2421
2422
2423 func (future *FileServersDeleteFuture) UnmarshalJSON(body []byte) error {
2424 var azFuture azure.Future
2425 if err := json.Unmarshal(body, &azFuture); err != nil {
2426 return err
2427 }
2428 future.FutureAPI = &azFuture
2429 future.Result = future.result
2430 return nil
2431 }
2432
2433
2434 func (future *FileServersDeleteFuture) result(client FileServersClient) (ar autorest.Response, err error) {
2435 var done bool
2436 done, err = future.DoneWithContext(context.Background(), client)
2437 if err != nil {
2438 err = autorest.NewErrorWithError(err, "storsimple.FileServersDeleteFuture", "Result", future.Response(), "Polling failure")
2439 return
2440 }
2441 if !done {
2442 ar.Response = future.Response()
2443 err = azure.NewAsyncOpIncompleteError("storsimple.FileServersDeleteFuture")
2444 return
2445 }
2446 ar.Response = future.Response()
2447 return
2448 }
2449
2450
2451 type FileShare struct {
2452 autorest.Response `json:"-"`
2453
2454 *FileShareProperties `json:"properties,omitempty"`
2455
2456 ID *string `json:"id,omitempty"`
2457
2458 Name *string `json:"name,omitempty"`
2459
2460 Type *string `json:"type,omitempty"`
2461 }
2462
2463
2464 func (fs FileShare) MarshalJSON() ([]byte, error) {
2465 objectMap := make(map[string]interface{})
2466 if fs.FileShareProperties != nil {
2467 objectMap["properties"] = fs.FileShareProperties
2468 }
2469 return json.Marshal(objectMap)
2470 }
2471
2472
2473 func (fs *FileShare) UnmarshalJSON(body []byte) error {
2474 var m map[string]*json.RawMessage
2475 err := json.Unmarshal(body, &m)
2476 if err != nil {
2477 return err
2478 }
2479 for k, v := range m {
2480 switch k {
2481 case "properties":
2482 if v != nil {
2483 var fileShareProperties FileShareProperties
2484 err = json.Unmarshal(*v, &fileShareProperties)
2485 if err != nil {
2486 return err
2487 }
2488 fs.FileShareProperties = &fileShareProperties
2489 }
2490 case "id":
2491 if v != nil {
2492 var ID string
2493 err = json.Unmarshal(*v, &ID)
2494 if err != nil {
2495 return err
2496 }
2497 fs.ID = &ID
2498 }
2499 case "name":
2500 if v != nil {
2501 var name string
2502 err = json.Unmarshal(*v, &name)
2503 if err != nil {
2504 return err
2505 }
2506 fs.Name = &name
2507 }
2508 case "type":
2509 if v != nil {
2510 var typeVar string
2511 err = json.Unmarshal(*v, &typeVar)
2512 if err != nil {
2513 return err
2514 }
2515 fs.Type = &typeVar
2516 }
2517 }
2518 }
2519
2520 return nil
2521 }
2522
2523
2524 type FileShareList struct {
2525 autorest.Response `json:"-"`
2526
2527 Value *[]FileShare `json:"value,omitempty"`
2528 }
2529
2530
2531 type FileShareProperties struct {
2532
2533 Description *string `json:"description,omitempty"`
2534
2535 ShareStatus ShareStatus `json:"shareStatus,omitempty"`
2536
2537 DataPolicy DataPolicy `json:"dataPolicy,omitempty"`
2538
2539 AdminUser *string `json:"adminUser,omitempty"`
2540
2541 ProvisionedCapacityInBytes *int64 `json:"provisionedCapacityInBytes,omitempty"`
2542
2543 UsedCapacityInBytes *int64 `json:"usedCapacityInBytes,omitempty"`
2544
2545 LocalUsedCapacityInBytes *int64 `json:"localUsedCapacityInBytes,omitempty"`
2546
2547 MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"`
2548 }
2549
2550
2551 func (fsp FileShareProperties) MarshalJSON() ([]byte, error) {
2552 objectMap := make(map[string]interface{})
2553 if fsp.Description != nil {
2554 objectMap["description"] = fsp.Description
2555 }
2556 if fsp.ShareStatus != "" {
2557 objectMap["shareStatus"] = fsp.ShareStatus
2558 }
2559 if fsp.DataPolicy != "" {
2560 objectMap["dataPolicy"] = fsp.DataPolicy
2561 }
2562 if fsp.AdminUser != nil {
2563 objectMap["adminUser"] = fsp.AdminUser
2564 }
2565 if fsp.ProvisionedCapacityInBytes != nil {
2566 objectMap["provisionedCapacityInBytes"] = fsp.ProvisionedCapacityInBytes
2567 }
2568 if fsp.MonitoringStatus != "" {
2569 objectMap["monitoringStatus"] = fsp.MonitoringStatus
2570 }
2571 return json.Marshal(objectMap)
2572 }
2573
2574
2575
2576 type FileSharesCreateOrUpdateFuture struct {
2577 azure.FutureAPI
2578
2579
2580 Result func(FileSharesClient) (FileShare, error)
2581 }
2582
2583
2584 func (future *FileSharesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2585 var azFuture azure.Future
2586 if err := json.Unmarshal(body, &azFuture); err != nil {
2587 return err
2588 }
2589 future.FutureAPI = &azFuture
2590 future.Result = future.result
2591 return nil
2592 }
2593
2594
2595 func (future *FileSharesCreateOrUpdateFuture) result(client FileSharesClient) (fs FileShare, err error) {
2596 var done bool
2597 done, err = future.DoneWithContext(context.Background(), client)
2598 if err != nil {
2599 err = autorest.NewErrorWithError(err, "storsimple.FileSharesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2600 return
2601 }
2602 if !done {
2603 fs.Response.Response = future.Response()
2604 err = azure.NewAsyncOpIncompleteError("storsimple.FileSharesCreateOrUpdateFuture")
2605 return
2606 }
2607 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2608 if fs.Response.Response, err = future.GetResult(sender); err == nil && fs.Response.Response.StatusCode != http.StatusNoContent {
2609 fs, err = client.CreateOrUpdateResponder(fs.Response.Response)
2610 if err != nil {
2611 err = autorest.NewErrorWithError(err, "storsimple.FileSharesCreateOrUpdateFuture", "Result", fs.Response.Response, "Failure responding to request")
2612 }
2613 }
2614 return
2615 }
2616
2617
2618
2619 type FileSharesDeleteFuture struct {
2620 azure.FutureAPI
2621
2622
2623 Result func(FileSharesClient) (autorest.Response, error)
2624 }
2625
2626
2627 func (future *FileSharesDeleteFuture) UnmarshalJSON(body []byte) error {
2628 var azFuture azure.Future
2629 if err := json.Unmarshal(body, &azFuture); err != nil {
2630 return err
2631 }
2632 future.FutureAPI = &azFuture
2633 future.Result = future.result
2634 return nil
2635 }
2636
2637
2638 func (future *FileSharesDeleteFuture) result(client FileSharesClient) (ar autorest.Response, err error) {
2639 var done bool
2640 done, err = future.DoneWithContext(context.Background(), client)
2641 if err != nil {
2642 err = autorest.NewErrorWithError(err, "storsimple.FileSharesDeleteFuture", "Result", future.Response(), "Polling failure")
2643 return
2644 }
2645 if !done {
2646 ar.Response = future.Response()
2647 err = azure.NewAsyncOpIncompleteError("storsimple.FileSharesDeleteFuture")
2648 return
2649 }
2650 ar.Response = future.Response()
2651 return
2652 }
2653
2654
2655 type IPConfig struct {
2656
2657 IPAddress *string `json:"ipAddress,omitempty"`
2658
2659 PrefixLength *int32 `json:"prefixLength,omitempty"`
2660
2661 Gateway *string `json:"gateway,omitempty"`
2662 }
2663
2664
2665 type ISCSIDisk struct {
2666 autorest.Response `json:"-"`
2667
2668 *ISCSIDiskProperties `json:"properties,omitempty"`
2669
2670 ID *string `json:"id,omitempty"`
2671
2672 Name *string `json:"name,omitempty"`
2673
2674 Type *string `json:"type,omitempty"`
2675 }
2676
2677
2678 func (ID ISCSIDisk) MarshalJSON() ([]byte, error) {
2679 objectMap := make(map[string]interface{})
2680 if ID.ISCSIDiskProperties != nil {
2681 objectMap["properties"] = ID.ISCSIDiskProperties
2682 }
2683 return json.Marshal(objectMap)
2684 }
2685
2686
2687 func (ID *ISCSIDisk) UnmarshalJSON(body []byte) error {
2688 var m map[string]*json.RawMessage
2689 err := json.Unmarshal(body, &m)
2690 if err != nil {
2691 return err
2692 }
2693 for k, v := range m {
2694 switch k {
2695 case "properties":
2696 if v != nil {
2697 var iSCSIDiskProperties ISCSIDiskProperties
2698 err = json.Unmarshal(*v, &iSCSIDiskProperties)
2699 if err != nil {
2700 return err
2701 }
2702 ID.ISCSIDiskProperties = &iSCSIDiskProperties
2703 }
2704 case "id":
2705 if v != nil {
2706 var ID1 string
2707 err = json.Unmarshal(*v, &ID1)
2708 if err != nil {
2709 return err
2710 }
2711 ID.ID = &ID1
2712 }
2713 case "name":
2714 if v != nil {
2715 var name string
2716 err = json.Unmarshal(*v, &name)
2717 if err != nil {
2718 return err
2719 }
2720 ID.Name = &name
2721 }
2722 case "type":
2723 if v != nil {
2724 var typeVar string
2725 err = json.Unmarshal(*v, &typeVar)
2726 if err != nil {
2727 return err
2728 }
2729 ID.Type = &typeVar
2730 }
2731 }
2732 }
2733
2734 return nil
2735 }
2736
2737
2738 type ISCSIDiskList struct {
2739 autorest.Response `json:"-"`
2740
2741 Value *[]ISCSIDisk `json:"value,omitempty"`
2742 }
2743
2744
2745 type ISCSIDiskProperties struct {
2746
2747 Description *string `json:"description,omitempty"`
2748
2749 DiskStatus DiskStatus `json:"diskStatus,omitempty"`
2750
2751 AccessControlRecords *[]string `json:"accessControlRecords,omitempty"`
2752
2753 DataPolicy DataPolicy `json:"dataPolicy,omitempty"`
2754
2755 ProvisionedCapacityInBytes *int64 `json:"provisionedCapacityInBytes,omitempty"`
2756
2757 UsedCapacityInBytes *int64 `json:"usedCapacityInBytes,omitempty"`
2758
2759 LocalUsedCapacityInBytes *int64 `json:"localUsedCapacityInBytes,omitempty"`
2760
2761 MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"`
2762 }
2763
2764
2765 func (idp ISCSIDiskProperties) MarshalJSON() ([]byte, error) {
2766 objectMap := make(map[string]interface{})
2767 if idp.Description != nil {
2768 objectMap["description"] = idp.Description
2769 }
2770 if idp.DiskStatus != "" {
2771 objectMap["diskStatus"] = idp.DiskStatus
2772 }
2773 if idp.AccessControlRecords != nil {
2774 objectMap["accessControlRecords"] = idp.AccessControlRecords
2775 }
2776 if idp.DataPolicy != "" {
2777 objectMap["dataPolicy"] = idp.DataPolicy
2778 }
2779 if idp.ProvisionedCapacityInBytes != nil {
2780 objectMap["provisionedCapacityInBytes"] = idp.ProvisionedCapacityInBytes
2781 }
2782 if idp.MonitoringStatus != "" {
2783 objectMap["monitoringStatus"] = idp.MonitoringStatus
2784 }
2785 return json.Marshal(objectMap)
2786 }
2787
2788
2789
2790 type IscsiDisksCreateOrUpdateFuture struct {
2791 azure.FutureAPI
2792
2793
2794 Result func(IscsiDisksClient) (ISCSIDisk, error)
2795 }
2796
2797
2798 func (future *IscsiDisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2799 var azFuture azure.Future
2800 if err := json.Unmarshal(body, &azFuture); err != nil {
2801 return err
2802 }
2803 future.FutureAPI = &azFuture
2804 future.Result = future.result
2805 return nil
2806 }
2807
2808
2809 func (future *IscsiDisksCreateOrUpdateFuture) result(client IscsiDisksClient) (ID ISCSIDisk, err error) {
2810 var done bool
2811 done, err = future.DoneWithContext(context.Background(), client)
2812 if err != nil {
2813 err = autorest.NewErrorWithError(err, "storsimple.IscsiDisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2814 return
2815 }
2816 if !done {
2817 ID.Response.Response = future.Response()
2818 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiDisksCreateOrUpdateFuture")
2819 return
2820 }
2821 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2822 if ID.Response.Response, err = future.GetResult(sender); err == nil && ID.Response.Response.StatusCode != http.StatusNoContent {
2823 ID, err = client.CreateOrUpdateResponder(ID.Response.Response)
2824 if err != nil {
2825 err = autorest.NewErrorWithError(err, "storsimple.IscsiDisksCreateOrUpdateFuture", "Result", ID.Response.Response, "Failure responding to request")
2826 }
2827 }
2828 return
2829 }
2830
2831
2832
2833 type IscsiDisksDeleteFuture struct {
2834 azure.FutureAPI
2835
2836
2837 Result func(IscsiDisksClient) (autorest.Response, error)
2838 }
2839
2840
2841 func (future *IscsiDisksDeleteFuture) UnmarshalJSON(body []byte) error {
2842 var azFuture azure.Future
2843 if err := json.Unmarshal(body, &azFuture); err != nil {
2844 return err
2845 }
2846 future.FutureAPI = &azFuture
2847 future.Result = future.result
2848 return nil
2849 }
2850
2851
2852 func (future *IscsiDisksDeleteFuture) result(client IscsiDisksClient) (ar autorest.Response, err error) {
2853 var done bool
2854 done, err = future.DoneWithContext(context.Background(), client)
2855 if err != nil {
2856 err = autorest.NewErrorWithError(err, "storsimple.IscsiDisksDeleteFuture", "Result", future.Response(), "Polling failure")
2857 return
2858 }
2859 if !done {
2860 ar.Response = future.Response()
2861 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiDisksDeleteFuture")
2862 return
2863 }
2864 ar.Response = future.Response()
2865 return
2866 }
2867
2868
2869 type ISCSIServer struct {
2870 autorest.Response `json:"-"`
2871
2872 *ISCSIServerProperties `json:"properties,omitempty"`
2873
2874 ID *string `json:"id,omitempty"`
2875
2876 Name *string `json:"name,omitempty"`
2877
2878 Type *string `json:"type,omitempty"`
2879 }
2880
2881
2882 func (is ISCSIServer) MarshalJSON() ([]byte, error) {
2883 objectMap := make(map[string]interface{})
2884 if is.ISCSIServerProperties != nil {
2885 objectMap["properties"] = is.ISCSIServerProperties
2886 }
2887 return json.Marshal(objectMap)
2888 }
2889
2890
2891 func (is *ISCSIServer) UnmarshalJSON(body []byte) error {
2892 var m map[string]*json.RawMessage
2893 err := json.Unmarshal(body, &m)
2894 if err != nil {
2895 return err
2896 }
2897 for k, v := range m {
2898 switch k {
2899 case "properties":
2900 if v != nil {
2901 var iSCSIServerProperties ISCSIServerProperties
2902 err = json.Unmarshal(*v, &iSCSIServerProperties)
2903 if err != nil {
2904 return err
2905 }
2906 is.ISCSIServerProperties = &iSCSIServerProperties
2907 }
2908 case "id":
2909 if v != nil {
2910 var ID string
2911 err = json.Unmarshal(*v, &ID)
2912 if err != nil {
2913 return err
2914 }
2915 is.ID = &ID
2916 }
2917 case "name":
2918 if v != nil {
2919 var name string
2920 err = json.Unmarshal(*v, &name)
2921 if err != nil {
2922 return err
2923 }
2924 is.Name = &name
2925 }
2926 case "type":
2927 if v != nil {
2928 var typeVar string
2929 err = json.Unmarshal(*v, &typeVar)
2930 if err != nil {
2931 return err
2932 }
2933 is.Type = &typeVar
2934 }
2935 }
2936 }
2937
2938 return nil
2939 }
2940
2941
2942 type ISCSIServerList struct {
2943 autorest.Response `json:"-"`
2944
2945 Value *[]ISCSIServer `json:"value,omitempty"`
2946 }
2947
2948
2949 type ISCSIServerProperties struct {
2950
2951 StorageDomainID *string `json:"storageDomainId,omitempty"`
2952
2953 BackupScheduleGroupID *string `json:"backupScheduleGroupId,omitempty"`
2954
2955 Description *string `json:"description,omitempty"`
2956
2957 ChapID *string `json:"chapId,omitempty"`
2958
2959 ReverseChapID *string `json:"reverseChapId,omitempty"`
2960 }
2961
2962
2963
2964 type IscsiServersBackupNowFuture struct {
2965 azure.FutureAPI
2966
2967
2968 Result func(IscsiServersClient) (autorest.Response, error)
2969 }
2970
2971
2972 func (future *IscsiServersBackupNowFuture) UnmarshalJSON(body []byte) error {
2973 var azFuture azure.Future
2974 if err := json.Unmarshal(body, &azFuture); err != nil {
2975 return err
2976 }
2977 future.FutureAPI = &azFuture
2978 future.Result = future.result
2979 return nil
2980 }
2981
2982
2983 func (future *IscsiServersBackupNowFuture) result(client IscsiServersClient) (ar autorest.Response, err error) {
2984 var done bool
2985 done, err = future.DoneWithContext(context.Background(), client)
2986 if err != nil {
2987 err = autorest.NewErrorWithError(err, "storsimple.IscsiServersBackupNowFuture", "Result", future.Response(), "Polling failure")
2988 return
2989 }
2990 if !done {
2991 ar.Response = future.Response()
2992 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiServersBackupNowFuture")
2993 return
2994 }
2995 ar.Response = future.Response()
2996 return
2997 }
2998
2999
3000
3001 type IscsiServersCreateOrUpdateFuture struct {
3002 azure.FutureAPI
3003
3004
3005 Result func(IscsiServersClient) (ISCSIServer, error)
3006 }
3007
3008
3009 func (future *IscsiServersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
3010 var azFuture azure.Future
3011 if err := json.Unmarshal(body, &azFuture); err != nil {
3012 return err
3013 }
3014 future.FutureAPI = &azFuture
3015 future.Result = future.result
3016 return nil
3017 }
3018
3019
3020 func (future *IscsiServersCreateOrUpdateFuture) result(client IscsiServersClient) (is ISCSIServer, err error) {
3021 var done bool
3022 done, err = future.DoneWithContext(context.Background(), client)
3023 if err != nil {
3024 err = autorest.NewErrorWithError(err, "storsimple.IscsiServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3025 return
3026 }
3027 if !done {
3028 is.Response.Response = future.Response()
3029 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiServersCreateOrUpdateFuture")
3030 return
3031 }
3032 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3033 if is.Response.Response, err = future.GetResult(sender); err == nil && is.Response.Response.StatusCode != http.StatusNoContent {
3034 is, err = client.CreateOrUpdateResponder(is.Response.Response)
3035 if err != nil {
3036 err = autorest.NewErrorWithError(err, "storsimple.IscsiServersCreateOrUpdateFuture", "Result", is.Response.Response, "Failure responding to request")
3037 }
3038 }
3039 return
3040 }
3041
3042
3043
3044 type IscsiServersDeleteFuture struct {
3045 azure.FutureAPI
3046
3047
3048 Result func(IscsiServersClient) (autorest.Response, error)
3049 }
3050
3051
3052 func (future *IscsiServersDeleteFuture) UnmarshalJSON(body []byte) error {
3053 var azFuture azure.Future
3054 if err := json.Unmarshal(body, &azFuture); err != nil {
3055 return err
3056 }
3057 future.FutureAPI = &azFuture
3058 future.Result = future.result
3059 return nil
3060 }
3061
3062
3063 func (future *IscsiServersDeleteFuture) result(client IscsiServersClient) (ar autorest.Response, err error) {
3064 var done bool
3065 done, err = future.DoneWithContext(context.Background(), client)
3066 if err != nil {
3067 err = autorest.NewErrorWithError(err, "storsimple.IscsiServersDeleteFuture", "Result", future.Response(), "Polling failure")
3068 return
3069 }
3070 if !done {
3071 ar.Response = future.Response()
3072 err = azure.NewAsyncOpIncompleteError("storsimple.IscsiServersDeleteFuture")
3073 return
3074 }
3075 ar.Response = future.Response()
3076 return
3077 }
3078
3079
3080 type Item struct {
3081 Key *string `json:"key,omitempty"`
3082 Value *string `json:"value,omitempty"`
3083 }
3084
3085
3086 type Job struct {
3087 autorest.Response `json:"-"`
3088
3089 Status JobStatus `json:"status,omitempty"`
3090
3091 StartTime *date.Time `json:"startTime,omitempty"`
3092
3093 EndTime *date.Time `json:"endTime,omitempty"`
3094
3095 PercentComplete *int32 `json:"percentComplete,omitempty"`
3096
3097 Error *JobErrorDetails `json:"error,omitempty"`
3098
3099 *JobProperties `json:"properties,omitempty"`
3100
3101 ID *string `json:"id,omitempty"`
3102
3103 Name *string `json:"name,omitempty"`
3104
3105 Type *string `json:"type,omitempty"`
3106 }
3107
3108
3109 func (j Job) MarshalJSON() ([]byte, error) {
3110 objectMap := make(map[string]interface{})
3111 if j.Status != "" {
3112 objectMap["status"] = j.Status
3113 }
3114 if j.StartTime != nil {
3115 objectMap["startTime"] = j.StartTime
3116 }
3117 if j.EndTime != nil {
3118 objectMap["endTime"] = j.EndTime
3119 }
3120 if j.PercentComplete != nil {
3121 objectMap["percentComplete"] = j.PercentComplete
3122 }
3123 if j.Error != nil {
3124 objectMap["error"] = j.Error
3125 }
3126 if j.JobProperties != nil {
3127 objectMap["properties"] = j.JobProperties
3128 }
3129 return json.Marshal(objectMap)
3130 }
3131
3132
3133 func (j *Job) UnmarshalJSON(body []byte) error {
3134 var m map[string]*json.RawMessage
3135 err := json.Unmarshal(body, &m)
3136 if err != nil {
3137 return err
3138 }
3139 for k, v := range m {
3140 switch k {
3141 case "status":
3142 if v != nil {
3143 var status JobStatus
3144 err = json.Unmarshal(*v, &status)
3145 if err != nil {
3146 return err
3147 }
3148 j.Status = status
3149 }
3150 case "startTime":
3151 if v != nil {
3152 var startTime date.Time
3153 err = json.Unmarshal(*v, &startTime)
3154 if err != nil {
3155 return err
3156 }
3157 j.StartTime = &startTime
3158 }
3159 case "endTime":
3160 if v != nil {
3161 var endTime date.Time
3162 err = json.Unmarshal(*v, &endTime)
3163 if err != nil {
3164 return err
3165 }
3166 j.EndTime = &endTime
3167 }
3168 case "percentComplete":
3169 if v != nil {
3170 var percentComplete int32
3171 err = json.Unmarshal(*v, &percentComplete)
3172 if err != nil {
3173 return err
3174 }
3175 j.PercentComplete = &percentComplete
3176 }
3177 case "error":
3178 if v != nil {
3179 var errorVar JobErrorDetails
3180 err = json.Unmarshal(*v, &errorVar)
3181 if err != nil {
3182 return err
3183 }
3184 j.Error = &errorVar
3185 }
3186 case "properties":
3187 if v != nil {
3188 var jobProperties JobProperties
3189 err = json.Unmarshal(*v, &jobProperties)
3190 if err != nil {
3191 return err
3192 }
3193 j.JobProperties = &jobProperties
3194 }
3195 case "id":
3196 if v != nil {
3197 var ID string
3198 err = json.Unmarshal(*v, &ID)
3199 if err != nil {
3200 return err
3201 }
3202 j.ID = &ID
3203 }
3204 case "name":
3205 if v != nil {
3206 var name string
3207 err = json.Unmarshal(*v, &name)
3208 if err != nil {
3209 return err
3210 }
3211 j.Name = &name
3212 }
3213 case "type":
3214 if v != nil {
3215 var typeVar string
3216 err = json.Unmarshal(*v, &typeVar)
3217 if err != nil {
3218 return err
3219 }
3220 j.Type = &typeVar
3221 }
3222 }
3223 }
3224
3225 return nil
3226 }
3227
3228
3229 type JobErrorDetails struct {
3230
3231 ErrorDetails *[]JobErrorItem `json:"errorDetails,omitempty"`
3232
3233 Code *string `json:"code,omitempty"`
3234
3235 Message *string `json:"message,omitempty"`
3236 }
3237
3238
3239 type JobErrorItem struct {
3240
3241 Recommendations *[]string `json:"recommendations,omitempty"`
3242
3243 Code *string `json:"code,omitempty"`
3244
3245 Message *string `json:"message,omitempty"`
3246 }
3247
3248
3249 type JobFilter struct {
3250
3251 JobType JobType `json:"jobType,omitempty"`
3252
3253 Status JobStatus `json:"status,omitempty"`
3254
3255 StartTime *date.Time `json:"startTime,omitempty"`
3256 }
3257
3258
3259 type JobList struct {
3260 autorest.Response `json:"-"`
3261
3262 Value *[]Job `json:"value,omitempty"`
3263
3264 NextLink *string `json:"nextLink,omitempty"`
3265 }
3266
3267
3268 type JobListIterator struct {
3269 i int
3270 page JobListPage
3271 }
3272
3273
3274
3275 func (iter *JobListIterator) NextWithContext(ctx context.Context) (err error) {
3276 if tracing.IsEnabled() {
3277 ctx = tracing.StartSpan(ctx, fqdn+"/JobListIterator.NextWithContext")
3278 defer func() {
3279 sc := -1
3280 if iter.Response().Response.Response != nil {
3281 sc = iter.Response().Response.Response.StatusCode
3282 }
3283 tracing.EndSpan(ctx, sc, err)
3284 }()
3285 }
3286 iter.i++
3287 if iter.i < len(iter.page.Values()) {
3288 return nil
3289 }
3290 err = iter.page.NextWithContext(ctx)
3291 if err != nil {
3292 iter.i--
3293 return err
3294 }
3295 iter.i = 0
3296 return nil
3297 }
3298
3299
3300
3301
3302 func (iter *JobListIterator) Next() error {
3303 return iter.NextWithContext(context.Background())
3304 }
3305
3306
3307 func (iter JobListIterator) NotDone() bool {
3308 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3309 }
3310
3311
3312 func (iter JobListIterator) Response() JobList {
3313 return iter.page.Response()
3314 }
3315
3316
3317
3318 func (iter JobListIterator) Value() Job {
3319 if !iter.page.NotDone() {
3320 return Job{}
3321 }
3322 return iter.page.Values()[iter.i]
3323 }
3324
3325
3326 func NewJobListIterator(page JobListPage) JobListIterator {
3327 return JobListIterator{page: page}
3328 }
3329
3330
3331 func (jl JobList) IsEmpty() bool {
3332 return jl.Value == nil || len(*jl.Value) == 0
3333 }
3334
3335
3336 func (jl JobList) hasNextLink() bool {
3337 return jl.NextLink != nil && len(*jl.NextLink) != 0
3338 }
3339
3340
3341
3342 func (jl JobList) jobListPreparer(ctx context.Context) (*http.Request, error) {
3343 if !jl.hasNextLink() {
3344 return nil, nil
3345 }
3346 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3347 autorest.AsJSON(),
3348 autorest.AsGet(),
3349 autorest.WithBaseURL(to.String(jl.NextLink)))
3350 }
3351
3352
3353 type JobListPage struct {
3354 fn func(context.Context, JobList) (JobList, error)
3355 jl JobList
3356 }
3357
3358
3359
3360 func (page *JobListPage) NextWithContext(ctx context.Context) (err error) {
3361 if tracing.IsEnabled() {
3362 ctx = tracing.StartSpan(ctx, fqdn+"/JobListPage.NextWithContext")
3363 defer func() {
3364 sc := -1
3365 if page.Response().Response.Response != nil {
3366 sc = page.Response().Response.Response.StatusCode
3367 }
3368 tracing.EndSpan(ctx, sc, err)
3369 }()
3370 }
3371 for {
3372 next, err := page.fn(ctx, page.jl)
3373 if err != nil {
3374 return err
3375 }
3376 page.jl = next
3377 if !next.hasNextLink() || !next.IsEmpty() {
3378 break
3379 }
3380 }
3381 return nil
3382 }
3383
3384
3385
3386
3387 func (page *JobListPage) Next() error {
3388 return page.NextWithContext(context.Background())
3389 }
3390
3391
3392 func (page JobListPage) NotDone() bool {
3393 return !page.jl.IsEmpty()
3394 }
3395
3396
3397 func (page JobListPage) Response() JobList {
3398 return page.jl
3399 }
3400
3401
3402 func (page JobListPage) Values() []Job {
3403 if page.jl.IsEmpty() {
3404 return nil
3405 }
3406 return *page.jl.Value
3407 }
3408
3409
3410 func NewJobListPage(cur JobList, getNextPage func(context.Context, JobList) (JobList, error)) JobListPage {
3411 return JobListPage{
3412 fn: getNextPage,
3413 jl: cur,
3414 }
3415 }
3416
3417
3418 type JobProperties struct {
3419
3420 JobType JobType `json:"jobType,omitempty"`
3421
3422 TargetID *string `json:"targetId,omitempty"`
3423
3424 EntityID *string `json:"entityId,omitempty"`
3425
3426 EntityType *string `json:"entityType,omitempty"`
3427
3428 JobStages *[]JobStage `json:"jobStages,omitempty"`
3429
3430 DeviceID *string `json:"deviceId,omitempty"`
3431
3432 IsCancellable *bool `json:"isCancellable,omitempty"`
3433
3434 Stats *JobStats `json:"stats,omitempty"`
3435
3436 TargetType TargetType `json:"targetType,omitempty"`
3437
3438 SourceDeviceID *string `json:"sourceDeviceId,omitempty"`
3439
3440 BackupPointInTime *date.Time `json:"backupPointInTime,omitempty"`
3441
3442 DownloadProgress *UpdateDownloadProgress `json:"downloadProgress,omitempty"`
3443
3444 InstallProgress *UpdateInstallProgress `json:"installProgress,omitempty"`
3445 }
3446
3447
3448 type JobStage struct {
3449
3450 Message *string `json:"message,omitempty"`
3451
3452 StageStatus JobStatus `json:"stageStatus,omitempty"`
3453
3454 Detail *string `json:"detail,omitempty"`
3455
3456 ErrorCode *string `json:"errorCode,omitempty"`
3457 }
3458
3459
3460 type JobStats struct {
3461
3462 CompletedWorkItemCount *int32 `json:"completedWorkItemCount,omitempty"`
3463
3464 TotalWorkItemCount *int32 `json:"totalWorkItemCount,omitempty"`
3465
3466 EstimatedTimeRemaining *int32 `json:"estimatedTimeRemaining,omitempty"`
3467 }
3468
3469
3470 type Manager struct {
3471 autorest.Response `json:"-"`
3472
3473 *ManagerProperties `json:"properties,omitempty"`
3474
3475 Etag *string `json:"etag,omitempty"`
3476
3477 ID *string `json:"id,omitempty"`
3478
3479 Name *string `json:"name,omitempty"`
3480
3481 Type *string `json:"type,omitempty"`
3482
3483 Location *string `json:"location,omitempty"`
3484
3485 Tags map[string]*string `json:"tags"`
3486 }
3487
3488
3489 func (mVar Manager) MarshalJSON() ([]byte, error) {
3490 objectMap := make(map[string]interface{})
3491 if mVar.ManagerProperties != nil {
3492 objectMap["properties"] = mVar.ManagerProperties
3493 }
3494 if mVar.Etag != nil {
3495 objectMap["etag"] = mVar.Etag
3496 }
3497 if mVar.Location != nil {
3498 objectMap["location"] = mVar.Location
3499 }
3500 if mVar.Tags != nil {
3501 objectMap["tags"] = mVar.Tags
3502 }
3503 return json.Marshal(objectMap)
3504 }
3505
3506
3507 func (mVar *Manager) UnmarshalJSON(body []byte) error {
3508 var m map[string]*json.RawMessage
3509 err := json.Unmarshal(body, &m)
3510 if err != nil {
3511 return err
3512 }
3513 for k, v := range m {
3514 switch k {
3515 case "properties":
3516 if v != nil {
3517 var managerProperties ManagerProperties
3518 err = json.Unmarshal(*v, &managerProperties)
3519 if err != nil {
3520 return err
3521 }
3522 mVar.ManagerProperties = &managerProperties
3523 }
3524 case "etag":
3525 if v != nil {
3526 var etag string
3527 err = json.Unmarshal(*v, &etag)
3528 if err != nil {
3529 return err
3530 }
3531 mVar.Etag = &etag
3532 }
3533 case "id":
3534 if v != nil {
3535 var ID string
3536 err = json.Unmarshal(*v, &ID)
3537 if err != nil {
3538 return err
3539 }
3540 mVar.ID = &ID
3541 }
3542 case "name":
3543 if v != nil {
3544 var name string
3545 err = json.Unmarshal(*v, &name)
3546 if err != nil {
3547 return err
3548 }
3549 mVar.Name = &name
3550 }
3551 case "type":
3552 if v != nil {
3553 var typeVar string
3554 err = json.Unmarshal(*v, &typeVar)
3555 if err != nil {
3556 return err
3557 }
3558 mVar.Type = &typeVar
3559 }
3560 case "location":
3561 if v != nil {
3562 var location string
3563 err = json.Unmarshal(*v, &location)
3564 if err != nil {
3565 return err
3566 }
3567 mVar.Location = &location
3568 }
3569 case "tags":
3570 if v != nil {
3571 var tags map[string]*string
3572 err = json.Unmarshal(*v, &tags)
3573 if err != nil {
3574 return err
3575 }
3576 mVar.Tags = tags
3577 }
3578 }
3579 }
3580
3581 return nil
3582 }
3583
3584
3585 type ManagerExtendedInfo struct {
3586 autorest.Response `json:"-"`
3587
3588 *ManagerExtendedInfoProperties `json:"properties,omitempty"`
3589
3590 Etag *string `json:"etag,omitempty"`
3591
3592 ID *string `json:"id,omitempty"`
3593
3594 Name *string `json:"name,omitempty"`
3595
3596 Type *string `json:"type,omitempty"`
3597 }
3598
3599
3600 func (mei ManagerExtendedInfo) MarshalJSON() ([]byte, error) {
3601 objectMap := make(map[string]interface{})
3602 if mei.ManagerExtendedInfoProperties != nil {
3603 objectMap["properties"] = mei.ManagerExtendedInfoProperties
3604 }
3605 if mei.Etag != nil {
3606 objectMap["etag"] = mei.Etag
3607 }
3608 return json.Marshal(objectMap)
3609 }
3610
3611
3612 func (mei *ManagerExtendedInfo) UnmarshalJSON(body []byte) error {
3613 var m map[string]*json.RawMessage
3614 err := json.Unmarshal(body, &m)
3615 if err != nil {
3616 return err
3617 }
3618 for k, v := range m {
3619 switch k {
3620 case "properties":
3621 if v != nil {
3622 var managerExtendedInfoProperties ManagerExtendedInfoProperties
3623 err = json.Unmarshal(*v, &managerExtendedInfoProperties)
3624 if err != nil {
3625 return err
3626 }
3627 mei.ManagerExtendedInfoProperties = &managerExtendedInfoProperties
3628 }
3629 case "etag":
3630 if v != nil {
3631 var etag string
3632 err = json.Unmarshal(*v, &etag)
3633 if err != nil {
3634 return err
3635 }
3636 mei.Etag = &etag
3637 }
3638 case "id":
3639 if v != nil {
3640 var ID string
3641 err = json.Unmarshal(*v, &ID)
3642 if err != nil {
3643 return err
3644 }
3645 mei.ID = &ID
3646 }
3647 case "name":
3648 if v != nil {
3649 var name string
3650 err = json.Unmarshal(*v, &name)
3651 if err != nil {
3652 return err
3653 }
3654 mei.Name = &name
3655 }
3656 case "type":
3657 if v != nil {
3658 var typeVar string
3659 err = json.Unmarshal(*v, &typeVar)
3660 if err != nil {
3661 return err
3662 }
3663 mei.Type = &typeVar
3664 }
3665 }
3666 }
3667
3668 return nil
3669 }
3670
3671
3672 type ManagerExtendedInfoProperties struct {
3673
3674 Version *string `json:"version,omitempty"`
3675
3676 IntegrityKey *string `json:"integrityKey,omitempty"`
3677
3678 EncryptionKey *string `json:"encryptionKey,omitempty"`
3679
3680 EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"`
3681
3682 PortalCertificateThumbprint *string `json:"portalCertificateThumbprint,omitempty"`
3683
3684 Algorithm *string `json:"algorithm,omitempty"`
3685 }
3686
3687
3688 type ManagerIntrinsicSettings struct {
3689
3690 Type ManagerType `json:"type,omitempty"`
3691 }
3692
3693
3694 type ManagerList struct {
3695 autorest.Response `json:"-"`
3696
3697 Value *[]Manager `json:"value,omitempty"`
3698 }
3699
3700
3701 type ManagerPatch struct {
3702
3703 Tags map[string]*string `json:"tags"`
3704 }
3705
3706
3707 func (mp ManagerPatch) MarshalJSON() ([]byte, error) {
3708 objectMap := make(map[string]interface{})
3709 if mp.Tags != nil {
3710 objectMap["tags"] = mp.Tags
3711 }
3712 return json.Marshal(objectMap)
3713 }
3714
3715
3716 type ManagerProperties struct {
3717
3718 CisIntrinsicSettings *ManagerIntrinsicSettings `json:"cisIntrinsicSettings,omitempty"`
3719
3720 Sku *ManagerSku `json:"sku,omitempty"`
3721
3722 ProvisioningState *string `json:"provisioningState,omitempty"`
3723 }
3724
3725
3726 func (mp ManagerProperties) MarshalJSON() ([]byte, error) {
3727 objectMap := make(map[string]interface{})
3728 if mp.CisIntrinsicSettings != nil {
3729 objectMap["cisIntrinsicSettings"] = mp.CisIntrinsicSettings
3730 }
3731 if mp.Sku != nil {
3732 objectMap["sku"] = mp.Sku
3733 }
3734 return json.Marshal(objectMap)
3735 }
3736
3737
3738 type ManagerSku struct {
3739
3740 Name *string `json:"name,omitempty"`
3741 }
3742
3743
3744 type Message struct {
3745 Language *string `json:"language,omitempty"`
3746 Value *string `json:"value,omitempty"`
3747 }
3748
3749
3750
3751 type MetricAvailablity struct {
3752
3753 TimeGrain *string `json:"timeGrain,omitempty"`
3754
3755 Retention *string `json:"retention,omitempty"`
3756 }
3757
3758
3759 type MetricData struct {
3760
3761 TimeStamp *date.Time `json:"timeStamp,omitempty"`
3762
3763 Sum *float64 `json:"sum,omitempty"`
3764
3765 Count *int32 `json:"count,omitempty"`
3766
3767 Average *float64 `json:"average,omitempty"`
3768
3769 Minimum *float64 `json:"minimum,omitempty"`
3770
3771 Maximum *float64 `json:"maximum,omitempty"`
3772 }
3773
3774
3775 type MetricDefinition struct {
3776
3777 Name *MetricName `json:"name,omitempty"`
3778
3779 Unit MetricUnit `json:"unit,omitempty"`
3780
3781 PrimaryAggregationType MetricAggregationType `json:"primaryAggregationType,omitempty"`
3782
3783 ResourceID *string `json:"resourceId,omitempty"`
3784
3785 MetricAvailabilities *[]MetricAvailablity `json:"metricAvailabilities,omitempty"`
3786
3787 Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
3788
3789 Type *string `json:"type,omitempty"`
3790 }
3791
3792
3793 type MetricDefinitionList struct {
3794 autorest.Response `json:"-"`
3795
3796 Value *[]MetricDefinition `json:"value,omitempty"`
3797 }
3798
3799
3800 type MetricDimension struct {
3801
3802 Name *string `json:"name,omitempty"`
3803
3804 Value *string `json:"value,omitempty"`
3805 }
3806
3807
3808 type MetricFilter struct {
3809
3810 Name *MetricNameFilter `json:"name,omitempty"`
3811
3812 StartTime *date.Time `json:"startTime,omitempty"`
3813
3814 EndTime *date.Time `json:"endTime,omitempty"`
3815
3816 TimeGrain *string `json:"timeGrain,omitempty"`
3817 }
3818
3819
3820 type MetricList struct {
3821 autorest.Response `json:"-"`
3822
3823 Value *[]Metrics `json:"value,omitempty"`
3824 }
3825
3826
3827 type MetricName struct {
3828
3829 Value *string `json:"value,omitempty"`
3830
3831 LocalizedValue *string `json:"localizedValue,omitempty"`
3832 }
3833
3834
3835 type MetricNameFilter struct {
3836
3837 Value *string `json:"value,omitempty"`
3838 }
3839
3840
3841 type Metrics struct {
3842
3843 ResourceID *string `json:"resourceId,omitempty"`
3844
3845 StartTime *date.Time `json:"startTime,omitempty"`
3846
3847 EndTime *date.Time `json:"endTime,omitempty"`
3848
3849 TimeGrain *string `json:"timeGrain,omitempty"`
3850
3851 PrimaryAggregation MetricAggregationType `json:"primaryAggregation,omitempty"`
3852
3853 Name *MetricName `json:"name,omitempty"`
3854
3855 Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
3856
3857 Unit MetricUnit `json:"unit,omitempty"`
3858
3859 Type *string `json:"type,omitempty"`
3860
3861 Values *[]MetricData `json:"values,omitempty"`
3862 }
3863
3864
3865 type NetworkAdapter struct {
3866
3867 NetworkAdapterName *string `json:"networkAdapterName,omitempty"`
3868
3869 IPv4Info *IPConfig `json:"iPv4Info,omitempty"`
3870
3871 IPv6Info *IPConfig `json:"iPv6Info,omitempty"`
3872
3873 DhcpStatus DhcpStatus `json:"dhcpStatus,omitempty"`
3874
3875 LinkSpeed *int64 `json:"linkSpeed,omitempty"`
3876 }
3877
3878
3879 type NetworkSettings struct {
3880 autorest.Response `json:"-"`
3881
3882 *NetworkSettingsProperties `json:"properties,omitempty"`
3883
3884 ID *string `json:"id,omitempty"`
3885
3886 Name *string `json:"name,omitempty"`
3887
3888 Type *string `json:"type,omitempty"`
3889 }
3890
3891
3892 func (ns NetworkSettings) MarshalJSON() ([]byte, error) {
3893 objectMap := make(map[string]interface{})
3894 if ns.NetworkSettingsProperties != nil {
3895 objectMap["properties"] = ns.NetworkSettingsProperties
3896 }
3897 return json.Marshal(objectMap)
3898 }
3899
3900
3901 func (ns *NetworkSettings) UnmarshalJSON(body []byte) error {
3902 var m map[string]*json.RawMessage
3903 err := json.Unmarshal(body, &m)
3904 if err != nil {
3905 return err
3906 }
3907 for k, v := range m {
3908 switch k {
3909 case "properties":
3910 if v != nil {
3911 var networkSettingsProperties NetworkSettingsProperties
3912 err = json.Unmarshal(*v, &networkSettingsProperties)
3913 if err != nil {
3914 return err
3915 }
3916 ns.NetworkSettingsProperties = &networkSettingsProperties
3917 }
3918 case "id":
3919 if v != nil {
3920 var ID string
3921 err = json.Unmarshal(*v, &ID)
3922 if err != nil {
3923 return err
3924 }
3925 ns.ID = &ID
3926 }
3927 case "name":
3928 if v != nil {
3929 var name string
3930 err = json.Unmarshal(*v, &name)
3931 if err != nil {
3932 return err
3933 }
3934 ns.Name = &name
3935 }
3936 case "type":
3937 if v != nil {
3938 var typeVar string
3939 err = json.Unmarshal(*v, &typeVar)
3940 if err != nil {
3941 return err
3942 }
3943 ns.Type = &typeVar
3944 }
3945 }
3946 }
3947
3948 return nil
3949 }
3950
3951
3952 type NetworkSettingsProperties struct {
3953
3954 PrimaryDNSServer *string `json:"primaryDnsServer,omitempty"`
3955
3956 SecondaryDNSServer *string `json:"secondaryDnsServer,omitempty"`
3957
3958 NodeNetworks *[]NodeNetwork `json:"nodeNetworks,omitempty"`
3959 }
3960
3961
3962 type NodeNetwork struct {
3963
3964 NetworkAdapters *[]NetworkAdapter `json:"networkAdapters,omitempty"`
3965 }
3966
3967
3968 type RawCertificateData struct {
3969
3970 AuthType AuthType `json:"authType,omitempty"`
3971
3972 Certificate *string `json:"certificate,omitempty"`
3973 }
3974
3975
3976 type Resource struct {
3977
3978 ID *string `json:"id,omitempty"`
3979
3980 Name *string `json:"name,omitempty"`
3981
3982 Type *string `json:"type,omitempty"`
3983
3984 Location *string `json:"location,omitempty"`
3985
3986 Tags map[string]*string `json:"tags"`
3987 }
3988
3989
3990 func (r Resource) MarshalJSON() ([]byte, error) {
3991 objectMap := make(map[string]interface{})
3992 if r.Location != nil {
3993 objectMap["location"] = r.Location
3994 }
3995 if r.Tags != nil {
3996 objectMap["tags"] = r.Tags
3997 }
3998 return json.Marshal(objectMap)
3999 }
4000
4001
4002 type ResourceCertificateAndAADDetails struct {
4003
4004 AuthType AuthType `json:"authType,omitempty"`
4005
4006 Certificate *string `json:"certificate,omitempty"`
4007
4008 ResourceID *int64 `json:"resourceId,omitempty"`
4009
4010 AadAuthority *string `json:"aadAuthority,omitempty"`
4011
4012 AadTenantID *string `json:"aadTenantId,omitempty"`
4013
4014 ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"`
4015
4016 ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"`
4017
4018 AzureManagementEndpointAudience *string `json:"azureManagementEndpointAudience,omitempty"`
4019
4020 Subject *string `json:"subject,omitempty"`
4021
4022 ValidFrom *date.Time `json:"validFrom,omitempty"`
4023
4024 ValidTo *date.Time `json:"validTo,omitempty"`
4025
4026 Thumbprint *string `json:"thumbprint,omitempty"`
4027
4028 FriendlyName *string `json:"friendlyName,omitempty"`
4029
4030 Issuer *string `json:"issuer,omitempty"`
4031 }
4032
4033
4034 type SecuritySettings struct {
4035
4036 *SecuritySettingsProperties `json:"properties,omitempty"`
4037
4038 ID *string `json:"id,omitempty"`
4039
4040 Name *string `json:"name,omitempty"`
4041
4042 Type *string `json:"type,omitempty"`
4043 }
4044
4045
4046 func (ss SecuritySettings) MarshalJSON() ([]byte, error) {
4047 objectMap := make(map[string]interface{})
4048 if ss.SecuritySettingsProperties != nil {
4049 objectMap["properties"] = ss.SecuritySettingsProperties
4050 }
4051 return json.Marshal(objectMap)
4052 }
4053
4054
4055 func (ss *SecuritySettings) UnmarshalJSON(body []byte) error {
4056 var m map[string]*json.RawMessage
4057 err := json.Unmarshal(body, &m)
4058 if err != nil {
4059 return err
4060 }
4061 for k, v := range m {
4062 switch k {
4063 case "properties":
4064 if v != nil {
4065 var securitySettingsProperties SecuritySettingsProperties
4066 err = json.Unmarshal(*v, &securitySettingsProperties)
4067 if err != nil {
4068 return err
4069 }
4070 ss.SecuritySettingsProperties = &securitySettingsProperties
4071 }
4072 case "id":
4073 if v != nil {
4074 var ID string
4075 err = json.Unmarshal(*v, &ID)
4076 if err != nil {
4077 return err
4078 }
4079 ss.ID = &ID
4080 }
4081 case "name":
4082 if v != nil {
4083 var name string
4084 err = json.Unmarshal(*v, &name)
4085 if err != nil {
4086 return err
4087 }
4088 ss.Name = &name
4089 }
4090 case "type":
4091 if v != nil {
4092 var typeVar string
4093 err = json.Unmarshal(*v, &typeVar)
4094 if err != nil {
4095 return err
4096 }
4097 ss.Type = &typeVar
4098 }
4099 }
4100 }
4101
4102 return nil
4103 }
4104
4105
4106 type SecuritySettingsProperties struct {
4107
4108 DeviceAdminPassword *AsymmetricEncryptedSecret `json:"deviceAdminPassword,omitempty"`
4109 }
4110
4111
4112 type SendTestAlertEmailRequest struct {
4113
4114 EmailList *[]string `json:"emailList,omitempty"`
4115 }
4116
4117
4118 type StorageAccountCredential struct {
4119 autorest.Response `json:"-"`
4120
4121 *StorageAccountCredentialProperties `json:"properties,omitempty"`
4122
4123 ID *string `json:"id,omitempty"`
4124
4125 Name *string `json:"name,omitempty"`
4126
4127 Type *string `json:"type,omitempty"`
4128 }
4129
4130
4131 func (sac StorageAccountCredential) MarshalJSON() ([]byte, error) {
4132 objectMap := make(map[string]interface{})
4133 if sac.StorageAccountCredentialProperties != nil {
4134 objectMap["properties"] = sac.StorageAccountCredentialProperties
4135 }
4136 return json.Marshal(objectMap)
4137 }
4138
4139
4140 func (sac *StorageAccountCredential) UnmarshalJSON(body []byte) error {
4141 var m map[string]*json.RawMessage
4142 err := json.Unmarshal(body, &m)
4143 if err != nil {
4144 return err
4145 }
4146 for k, v := range m {
4147 switch k {
4148 case "properties":
4149 if v != nil {
4150 var storageAccountCredentialProperties StorageAccountCredentialProperties
4151 err = json.Unmarshal(*v, &storageAccountCredentialProperties)
4152 if err != nil {
4153 return err
4154 }
4155 sac.StorageAccountCredentialProperties = &storageAccountCredentialProperties
4156 }
4157 case "id":
4158 if v != nil {
4159 var ID string
4160 err = json.Unmarshal(*v, &ID)
4161 if err != nil {
4162 return err
4163 }
4164 sac.ID = &ID
4165 }
4166 case "name":
4167 if v != nil {
4168 var name string
4169 err = json.Unmarshal(*v, &name)
4170 if err != nil {
4171 return err
4172 }
4173 sac.Name = &name
4174 }
4175 case "type":
4176 if v != nil {
4177 var typeVar string
4178 err = json.Unmarshal(*v, &typeVar)
4179 if err != nil {
4180 return err
4181 }
4182 sac.Type = &typeVar
4183 }
4184 }
4185 }
4186
4187 return nil
4188 }
4189
4190
4191 type StorageAccountCredentialList struct {
4192 autorest.Response `json:"-"`
4193
4194 Value *[]StorageAccountCredential `json:"value,omitempty"`
4195 }
4196
4197
4198 type StorageAccountCredentialProperties struct {
4199
4200 CloudType CloudType `json:"cloudType,omitempty"`
4201
4202 EndPoint *string `json:"endPoint,omitempty"`
4203
4204 Login *string `json:"login,omitempty"`
4205
4206 Location *string `json:"location,omitempty"`
4207
4208 EnableSSL SslStatus `json:"enableSSL,omitempty"`
4209
4210 AccessKey *AsymmetricEncryptedSecret `json:"accessKey,omitempty"`
4211 }
4212
4213
4214
4215 type StorageAccountCredentialsCreateOrUpdateFuture struct {
4216 azure.FutureAPI
4217
4218
4219 Result func(StorageAccountCredentialsClient) (StorageAccountCredential, error)
4220 }
4221
4222
4223 func (future *StorageAccountCredentialsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
4224 var azFuture azure.Future
4225 if err := json.Unmarshal(body, &azFuture); err != nil {
4226 return err
4227 }
4228 future.FutureAPI = &azFuture
4229 future.Result = future.result
4230 return nil
4231 }
4232
4233
4234 func (future *StorageAccountCredentialsCreateOrUpdateFuture) result(client StorageAccountCredentialsClient) (sac StorageAccountCredential, err error) {
4235 var done bool
4236 done, err = future.DoneWithContext(context.Background(), client)
4237 if err != nil {
4238 err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4239 return
4240 }
4241 if !done {
4242 sac.Response.Response = future.Response()
4243 err = azure.NewAsyncOpIncompleteError("storsimple.StorageAccountCredentialsCreateOrUpdateFuture")
4244 return
4245 }
4246 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4247 if sac.Response.Response, err = future.GetResult(sender); err == nil && sac.Response.Response.StatusCode != http.StatusNoContent {
4248 sac, err = client.CreateOrUpdateResponder(sac.Response.Response)
4249 if err != nil {
4250 err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsCreateOrUpdateFuture", "Result", sac.Response.Response, "Failure responding to request")
4251 }
4252 }
4253 return
4254 }
4255
4256
4257
4258 type StorageAccountCredentialsDeleteFuture struct {
4259 azure.FutureAPI
4260
4261
4262 Result func(StorageAccountCredentialsClient) (autorest.Response, error)
4263 }
4264
4265
4266 func (future *StorageAccountCredentialsDeleteFuture) UnmarshalJSON(body []byte) error {
4267 var azFuture azure.Future
4268 if err := json.Unmarshal(body, &azFuture); err != nil {
4269 return err
4270 }
4271 future.FutureAPI = &azFuture
4272 future.Result = future.result
4273 return nil
4274 }
4275
4276
4277 func (future *StorageAccountCredentialsDeleteFuture) result(client StorageAccountCredentialsClient) (ar autorest.Response, err error) {
4278 var done bool
4279 done, err = future.DoneWithContext(context.Background(), client)
4280 if err != nil {
4281 err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsDeleteFuture", "Result", future.Response(), "Polling failure")
4282 return
4283 }
4284 if !done {
4285 ar.Response = future.Response()
4286 err = azure.NewAsyncOpIncompleteError("storsimple.StorageAccountCredentialsDeleteFuture")
4287 return
4288 }
4289 ar.Response = future.Response()
4290 return
4291 }
4292
4293
4294 type StorageDomain struct {
4295 autorest.Response `json:"-"`
4296
4297 *StorageDomainProperties `json:"properties,omitempty"`
4298
4299 ID *string `json:"id,omitempty"`
4300
4301 Name *string `json:"name,omitempty"`
4302
4303 Type *string `json:"type,omitempty"`
4304 }
4305
4306
4307 func (sd StorageDomain) MarshalJSON() ([]byte, error) {
4308 objectMap := make(map[string]interface{})
4309 if sd.StorageDomainProperties != nil {
4310 objectMap["properties"] = sd.StorageDomainProperties
4311 }
4312 return json.Marshal(objectMap)
4313 }
4314
4315
4316 func (sd *StorageDomain) UnmarshalJSON(body []byte) error {
4317 var m map[string]*json.RawMessage
4318 err := json.Unmarshal(body, &m)
4319 if err != nil {
4320 return err
4321 }
4322 for k, v := range m {
4323 switch k {
4324 case "properties":
4325 if v != nil {
4326 var storageDomainProperties StorageDomainProperties
4327 err = json.Unmarshal(*v, &storageDomainProperties)
4328 if err != nil {
4329 return err
4330 }
4331 sd.StorageDomainProperties = &storageDomainProperties
4332 }
4333 case "id":
4334 if v != nil {
4335 var ID string
4336 err = json.Unmarshal(*v, &ID)
4337 if err != nil {
4338 return err
4339 }
4340 sd.ID = &ID
4341 }
4342 case "name":
4343 if v != nil {
4344 var name string
4345 err = json.Unmarshal(*v, &name)
4346 if err != nil {
4347 return err
4348 }
4349 sd.Name = &name
4350 }
4351 case "type":
4352 if v != nil {
4353 var typeVar string
4354 err = json.Unmarshal(*v, &typeVar)
4355 if err != nil {
4356 return err
4357 }
4358 sd.Type = &typeVar
4359 }
4360 }
4361 }
4362
4363 return nil
4364 }
4365
4366
4367 type StorageDomainList struct {
4368 autorest.Response `json:"-"`
4369
4370 Value *[]StorageDomain `json:"value,omitempty"`
4371 }
4372
4373
4374 type StorageDomainProperties struct {
4375
4376 StorageAccountCredentialIds *[]string `json:"storageAccountCredentialIds,omitempty"`
4377
4378 EncryptionKey *AsymmetricEncryptedSecret `json:"encryptionKey,omitempty"`
4379
4380 EncryptionStatus EncryptionStatus `json:"encryptionStatus,omitempty"`
4381 }
4382
4383
4384
4385 type StorageDomainsCreateOrUpdateFuture struct {
4386 azure.FutureAPI
4387
4388
4389 Result func(StorageDomainsClient) (StorageDomain, error)
4390 }
4391
4392
4393 func (future *StorageDomainsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
4394 var azFuture azure.Future
4395 if err := json.Unmarshal(body, &azFuture); err != nil {
4396 return err
4397 }
4398 future.FutureAPI = &azFuture
4399 future.Result = future.result
4400 return nil
4401 }
4402
4403
4404 func (future *StorageDomainsCreateOrUpdateFuture) result(client StorageDomainsClient) (sd StorageDomain, err error) {
4405 var done bool
4406 done, err = future.DoneWithContext(context.Background(), client)
4407 if err != nil {
4408 err = autorest.NewErrorWithError(err, "storsimple.StorageDomainsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4409 return
4410 }
4411 if !done {
4412 sd.Response.Response = future.Response()
4413 err = azure.NewAsyncOpIncompleteError("storsimple.StorageDomainsCreateOrUpdateFuture")
4414 return
4415 }
4416 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4417 if sd.Response.Response, err = future.GetResult(sender); err == nil && sd.Response.Response.StatusCode != http.StatusNoContent {
4418 sd, err = client.CreateOrUpdateResponder(sd.Response.Response)
4419 if err != nil {
4420 err = autorest.NewErrorWithError(err, "storsimple.StorageDomainsCreateOrUpdateFuture", "Result", sd.Response.Response, "Failure responding to request")
4421 }
4422 }
4423 return
4424 }
4425
4426
4427
4428 type StorageDomainsDeleteFuture struct {
4429 azure.FutureAPI
4430
4431
4432 Result func(StorageDomainsClient) (autorest.Response, error)
4433 }
4434
4435
4436 func (future *StorageDomainsDeleteFuture) UnmarshalJSON(body []byte) error {
4437 var azFuture azure.Future
4438 if err := json.Unmarshal(body, &azFuture); err != nil {
4439 return err
4440 }
4441 future.FutureAPI = &azFuture
4442 future.Result = future.result
4443 return nil
4444 }
4445
4446
4447 func (future *StorageDomainsDeleteFuture) result(client StorageDomainsClient) (ar autorest.Response, err error) {
4448 var done bool
4449 done, err = future.DoneWithContext(context.Background(), client)
4450 if err != nil {
4451 err = autorest.NewErrorWithError(err, "storsimple.StorageDomainsDeleteFuture", "Result", future.Response(), "Polling failure")
4452 return
4453 }
4454 if !done {
4455 ar.Response = future.Response()
4456 err = azure.NewAsyncOpIncompleteError("storsimple.StorageDomainsDeleteFuture")
4457 return
4458 }
4459 ar.Response = future.Response()
4460 return
4461 }
4462
4463
4464
4465
4466
4467 type SymmetricEncryptedSecret struct {
4468 autorest.Response `json:"-"`
4469
4470 Value *string `json:"value,omitempty"`
4471
4472 ValueCertificateThumbprint *string `json:"valueCertificateThumbprint,omitempty"`
4473
4474 EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"`
4475 }
4476
4477
4478 type Time struct {
4479
4480 Hour *int32 `json:"hour,omitempty"`
4481
4482 Minute *int32 `json:"minute,omitempty"`
4483 }
4484
4485
4486 type TimeSettings struct {
4487 autorest.Response `json:"-"`
4488
4489 *TimeSettingsProperties `json:"properties,omitempty"`
4490
4491 ID *string `json:"id,omitempty"`
4492
4493 Name *string `json:"name,omitempty"`
4494
4495 Type *string `json:"type,omitempty"`
4496 }
4497
4498
4499 func (ts TimeSettings) MarshalJSON() ([]byte, error) {
4500 objectMap := make(map[string]interface{})
4501 if ts.TimeSettingsProperties != nil {
4502 objectMap["properties"] = ts.TimeSettingsProperties
4503 }
4504 return json.Marshal(objectMap)
4505 }
4506
4507
4508 func (ts *TimeSettings) UnmarshalJSON(body []byte) error {
4509 var m map[string]*json.RawMessage
4510 err := json.Unmarshal(body, &m)
4511 if err != nil {
4512 return err
4513 }
4514 for k, v := range m {
4515 switch k {
4516 case "properties":
4517 if v != nil {
4518 var timeSettingsProperties TimeSettingsProperties
4519 err = json.Unmarshal(*v, &timeSettingsProperties)
4520 if err != nil {
4521 return err
4522 }
4523 ts.TimeSettingsProperties = &timeSettingsProperties
4524 }
4525 case "id":
4526 if v != nil {
4527 var ID string
4528 err = json.Unmarshal(*v, &ID)
4529 if err != nil {
4530 return err
4531 }
4532 ts.ID = &ID
4533 }
4534 case "name":
4535 if v != nil {
4536 var name string
4537 err = json.Unmarshal(*v, &name)
4538 if err != nil {
4539 return err
4540 }
4541 ts.Name = &name
4542 }
4543 case "type":
4544 if v != nil {
4545 var typeVar string
4546 err = json.Unmarshal(*v, &typeVar)
4547 if err != nil {
4548 return err
4549 }
4550 ts.Type = &typeVar
4551 }
4552 }
4553 }
4554
4555 return nil
4556 }
4557
4558
4559 type TimeSettingsProperties struct {
4560
4561 TimeZone *string `json:"timeZone,omitempty"`
4562
4563 PrimaryTimeServer *string `json:"primaryTimeServer,omitempty"`
4564
4565 SecondaryTimeServer *string `json:"secondaryTimeServer,omitempty"`
4566 }
4567
4568
4569 type UpdateDownloadProgress struct {
4570
4571 DownloadPhase DownloadPhase `json:"downloadPhase,omitempty"`
4572
4573 PercentComplete *int32 `json:"percentComplete,omitempty"`
4574
4575 TotalBytesToDownload *float64 `json:"totalBytesToDownload,omitempty"`
4576
4577 TotalBytesDownloaded *float64 `json:"totalBytesDownloaded,omitempty"`
4578
4579 NumberOfUpdatesToDownload *int32 `json:"numberOfUpdatesToDownload,omitempty"`
4580
4581 NumberOfUpdatesDownloaded *int32 `json:"numberOfUpdatesDownloaded,omitempty"`
4582 }
4583
4584
4585 type UpdateInstallProgress struct {
4586
4587 PercentComplete *int32 `json:"percentComplete,omitempty"`
4588
4589 NumberOfUpdatesToInstall *int32 `json:"numberOfUpdatesToInstall,omitempty"`
4590
4591 NumberOfUpdatesInstalled *int32 `json:"numberOfUpdatesInstalled,omitempty"`
4592 }
4593
4594
4595 type Updates struct {
4596 autorest.Response `json:"-"`
4597
4598 *UpdatesProperties `json:"properties,omitempty"`
4599
4600 ID *string `json:"id,omitempty"`
4601
4602 Name *string `json:"name,omitempty"`
4603
4604 Type *string `json:"type,omitempty"`
4605 }
4606
4607
4608 func (u Updates) MarshalJSON() ([]byte, error) {
4609 objectMap := make(map[string]interface{})
4610 if u.UpdatesProperties != nil {
4611 objectMap["properties"] = u.UpdatesProperties
4612 }
4613 return json.Marshal(objectMap)
4614 }
4615
4616
4617 func (u *Updates) UnmarshalJSON(body []byte) error {
4618 var m map[string]*json.RawMessage
4619 err := json.Unmarshal(body, &m)
4620 if err != nil {
4621 return err
4622 }
4623 for k, v := range m {
4624 switch k {
4625 case "properties":
4626 if v != nil {
4627 var updatesProperties UpdatesProperties
4628 err = json.Unmarshal(*v, &updatesProperties)
4629 if err != nil {
4630 return err
4631 }
4632 u.UpdatesProperties = &updatesProperties
4633 }
4634 case "id":
4635 if v != nil {
4636 var ID string
4637 err = json.Unmarshal(*v, &ID)
4638 if err != nil {
4639 return err
4640 }
4641 u.ID = &ID
4642 }
4643 case "name":
4644 if v != nil {
4645 var name string
4646 err = json.Unmarshal(*v, &name)
4647 if err != nil {
4648 return err
4649 }
4650 u.Name = &name
4651 }
4652 case "type":
4653 if v != nil {
4654 var typeVar string
4655 err = json.Unmarshal(*v, &typeVar)
4656 if err != nil {
4657 return err
4658 }
4659 u.Type = &typeVar
4660 }
4661 }
4662 }
4663
4664 return nil
4665 }
4666
4667
4668 type UpdatesProperties struct {
4669
4670 DeviceVersion *string `json:"deviceVersion,omitempty"`
4671
4672 DeviceLastScannedTime *date.Time `json:"deviceLastScannedTime,omitempty"`
4673
4674 RegularUpdatesAvailable *bool `json:"regularUpdatesAvailable,omitempty"`
4675
4676 RebootRequiredForInstall *bool `json:"rebootRequiredForInstall,omitempty"`
4677
4678 TotalItemsPendingForDownload *int32 `json:"totalItemsPendingForDownload,omitempty"`
4679
4680 TotalItemsPendingForInstall *int32 `json:"totalItemsPendingForInstall,omitempty"`
4681
4682 Status UpdateOperation `json:"status,omitempty"`
4683
4684 LastCompletedScanTime *date.Time `json:"lastCompletedScanTime,omitempty"`
4685
4686 LastCompletedDownloadJobTime *date.Time `json:"lastCompletedDownloadJobTime,omitempty"`
4687
4688 LastCompletedInstallJobTime *date.Time `json:"lastCompletedInstallJobTime,omitempty"`
4689
4690 InProgressDownloadJobID *string `json:"inProgressDownloadJobId,omitempty"`
4691
4692 InProgressInstallJobID *string `json:"inProgressInstallJobId,omitempty"`
4693
4694 InProgressScanStartedTime *date.Time `json:"inProgressScanStartedTime,omitempty"`
4695
4696 InProgressDownloadJobStartedTime *date.Time `json:"inProgressDownloadJobStartedTime,omitempty"`
4697
4698 InProgressInstallJobStartedTime *date.Time `json:"inProgressInstallJobStartedTime,omitempty"`
4699 }
4700
4701
4702 type UploadCertificateRequest struct {
4703 *RawCertificateData `json:"properties,omitempty"`
4704
4705 ContractVersion ContractVersions `json:"contractVersion,omitempty"`
4706 }
4707
4708
4709 func (ucr UploadCertificateRequest) MarshalJSON() ([]byte, error) {
4710 objectMap := make(map[string]interface{})
4711 if ucr.RawCertificateData != nil {
4712 objectMap["properties"] = ucr.RawCertificateData
4713 }
4714 return json.Marshal(objectMap)
4715 }
4716
4717
4718 func (ucr *UploadCertificateRequest) UnmarshalJSON(body []byte) error {
4719 var m map[string]*json.RawMessage
4720 err := json.Unmarshal(body, &m)
4721 if err != nil {
4722 return err
4723 }
4724 for k, v := range m {
4725 switch k {
4726 case "properties":
4727 if v != nil {
4728 var rawCertificateData RawCertificateData
4729 err = json.Unmarshal(*v, &rawCertificateData)
4730 if err != nil {
4731 return err
4732 }
4733 ucr.RawCertificateData = &rawCertificateData
4734 }
4735 case "contractVersion":
4736 if v != nil {
4737 var contractVersion ContractVersions
4738 err = json.Unmarshal(*v, &contractVersion)
4739 if err != nil {
4740 return err
4741 }
4742 ucr.ContractVersion = contractVersion
4743 }
4744 }
4745 }
4746
4747 return nil
4748 }
4749
4750
4751 type UploadCertificateResponse struct {
4752 autorest.Response `json:"-"`
4753 *ResourceCertificateAndAADDetails `json:"properties,omitempty"`
4754
4755 ID *string `json:"id,omitempty"`
4756
4757 Name *string `json:"name,omitempty"`
4758
4759 Type *string `json:"type,omitempty"`
4760 }
4761
4762
4763 func (ucr UploadCertificateResponse) MarshalJSON() ([]byte, error) {
4764 objectMap := make(map[string]interface{})
4765 if ucr.ResourceCertificateAndAADDetails != nil {
4766 objectMap["properties"] = ucr.ResourceCertificateAndAADDetails
4767 }
4768 return json.Marshal(objectMap)
4769 }
4770
4771
4772 func (ucr *UploadCertificateResponse) UnmarshalJSON(body []byte) error {
4773 var m map[string]*json.RawMessage
4774 err := json.Unmarshal(body, &m)
4775 if err != nil {
4776 return err
4777 }
4778 for k, v := range m {
4779 switch k {
4780 case "properties":
4781 if v != nil {
4782 var resourceCertificateAndAADDetails ResourceCertificateAndAADDetails
4783 err = json.Unmarshal(*v, &resourceCertificateAndAADDetails)
4784 if err != nil {
4785 return err
4786 }
4787 ucr.ResourceCertificateAndAADDetails = &resourceCertificateAndAADDetails
4788 }
4789 case "id":
4790 if v != nil {
4791 var ID string
4792 err = json.Unmarshal(*v, &ID)
4793 if err != nil {
4794 return err
4795 }
4796 ucr.ID = &ID
4797 }
4798 case "name":
4799 if v != nil {
4800 var name string
4801 err = json.Unmarshal(*v, &name)
4802 if err != nil {
4803 return err
4804 }
4805 ucr.Name = &name
4806 }
4807 case "type":
4808 if v != nil {
4809 var typeVar string
4810 err = json.Unmarshal(*v, &typeVar)
4811 if err != nil {
4812 return err
4813 }
4814 ucr.Type = &typeVar
4815 }
4816 }
4817 }
4818
4819 return nil
4820 }
4821
View as plain text