1 package devices
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/preview/iothub/mgmt/2019-03-22-preview/devices"
22
23
24 type CertificateBodyDescription struct {
25
26 Certificate *string `json:"certificate,omitempty"`
27 }
28
29
30 type CertificateDescription struct {
31 autorest.Response `json:"-"`
32 Properties *CertificateProperties `json:"properties,omitempty"`
33
34 ID *string `json:"id,omitempty"`
35
36 Name *string `json:"name,omitempty"`
37
38 Etag *string `json:"etag,omitempty"`
39
40 Type *string `json:"type,omitempty"`
41 }
42
43
44 func (cd CertificateDescription) MarshalJSON() ([]byte, error) {
45 objectMap := make(map[string]interface{})
46 if cd.Properties != nil {
47 objectMap["properties"] = cd.Properties
48 }
49 return json.Marshal(objectMap)
50 }
51
52
53 type CertificateListDescription struct {
54 autorest.Response `json:"-"`
55
56 Value *[]CertificateDescription `json:"value,omitempty"`
57 }
58
59
60 type CertificateProperties struct {
61
62 Subject *string `json:"subject,omitempty"`
63
64 Expiry *date.TimeRFC1123 `json:"expiry,omitempty"`
65
66 Thumbprint *string `json:"thumbprint,omitempty"`
67
68 IsVerified *bool `json:"isVerified,omitempty"`
69
70 Created *date.TimeRFC1123 `json:"created,omitempty"`
71
72 Updated *date.TimeRFC1123 `json:"updated,omitempty"`
73
74 Certificate *string `json:"certificate,omitempty"`
75 }
76
77
78 func (cp CertificateProperties) MarshalJSON() ([]byte, error) {
79 objectMap := make(map[string]interface{})
80 if cp.Certificate != nil {
81 objectMap["certificate"] = cp.Certificate
82 }
83 return json.Marshal(objectMap)
84 }
85
86
87
88 type CertificatePropertiesWithNonce struct {
89
90 Subject *string `json:"subject,omitempty"`
91
92 Expiry *date.TimeRFC1123 `json:"expiry,omitempty"`
93
94 Thumbprint *string `json:"thumbprint,omitempty"`
95
96 IsVerified *bool `json:"isVerified,omitempty"`
97
98 Created *date.TimeRFC1123 `json:"created,omitempty"`
99
100 Updated *date.TimeRFC1123 `json:"updated,omitempty"`
101
102 VerificationCode *string `json:"verificationCode,omitempty"`
103
104 Certificate *string `json:"certificate,omitempty"`
105 }
106
107
108 func (cpwn CertificatePropertiesWithNonce) MarshalJSON() ([]byte, error) {
109 objectMap := make(map[string]interface{})
110 return json.Marshal(objectMap)
111 }
112
113
114 type CertificateVerificationDescription struct {
115
116 Certificate *string `json:"certificate,omitempty"`
117 }
118
119
120 type CertificateWithNonceDescription struct {
121 autorest.Response `json:"-"`
122 Properties *CertificatePropertiesWithNonce `json:"properties,omitempty"`
123
124 ID *string `json:"id,omitempty"`
125
126 Name *string `json:"name,omitempty"`
127
128 Etag *string `json:"etag,omitempty"`
129
130 Type *string `json:"type,omitempty"`
131 }
132
133
134 func (cwnd CertificateWithNonceDescription) MarshalJSON() ([]byte, error) {
135 objectMap := make(map[string]interface{})
136 if cwnd.Properties != nil {
137 objectMap["properties"] = cwnd.Properties
138 }
139 return json.Marshal(objectMap)
140 }
141
142
143 type CloudToDeviceProperties struct {
144
145 MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
146
147 DefaultTTLAsIso8601 *string `json:"defaultTtlAsIso8601,omitempty"`
148 Feedback *FeedbackProperties `json:"feedback,omitempty"`
149 }
150
151
152 type EndpointHealthData struct {
153
154 EndpointID *string `json:"endpointId,omitempty"`
155
156 HealthStatus EndpointHealthStatus `json:"healthStatus,omitempty"`
157 }
158
159
160 type EndpointHealthDataListResult struct {
161 autorest.Response `json:"-"`
162
163 Value *[]EndpointHealthData `json:"value,omitempty"`
164
165 NextLink *string `json:"nextLink,omitempty"`
166 }
167
168
169 func (ehdlr EndpointHealthDataListResult) MarshalJSON() ([]byte, error) {
170 objectMap := make(map[string]interface{})
171 if ehdlr.Value != nil {
172 objectMap["value"] = ehdlr.Value
173 }
174 return json.Marshal(objectMap)
175 }
176
177
178 type EndpointHealthDataListResultIterator struct {
179 i int
180 page EndpointHealthDataListResultPage
181 }
182
183
184
185 func (iter *EndpointHealthDataListResultIterator) NextWithContext(ctx context.Context) (err error) {
186 if tracing.IsEnabled() {
187 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointHealthDataListResultIterator.NextWithContext")
188 defer func() {
189 sc := -1
190 if iter.Response().Response.Response != nil {
191 sc = iter.Response().Response.Response.StatusCode
192 }
193 tracing.EndSpan(ctx, sc, err)
194 }()
195 }
196 iter.i++
197 if iter.i < len(iter.page.Values()) {
198 return nil
199 }
200 err = iter.page.NextWithContext(ctx)
201 if err != nil {
202 iter.i--
203 return err
204 }
205 iter.i = 0
206 return nil
207 }
208
209
210
211
212 func (iter *EndpointHealthDataListResultIterator) Next() error {
213 return iter.NextWithContext(context.Background())
214 }
215
216
217 func (iter EndpointHealthDataListResultIterator) NotDone() bool {
218 return iter.page.NotDone() && iter.i < len(iter.page.Values())
219 }
220
221
222 func (iter EndpointHealthDataListResultIterator) Response() EndpointHealthDataListResult {
223 return iter.page.Response()
224 }
225
226
227
228 func (iter EndpointHealthDataListResultIterator) Value() EndpointHealthData {
229 if !iter.page.NotDone() {
230 return EndpointHealthData{}
231 }
232 return iter.page.Values()[iter.i]
233 }
234
235
236 func NewEndpointHealthDataListResultIterator(page EndpointHealthDataListResultPage) EndpointHealthDataListResultIterator {
237 return EndpointHealthDataListResultIterator{page: page}
238 }
239
240
241 func (ehdlr EndpointHealthDataListResult) IsEmpty() bool {
242 return ehdlr.Value == nil || len(*ehdlr.Value) == 0
243 }
244
245
246 func (ehdlr EndpointHealthDataListResult) hasNextLink() bool {
247 return ehdlr.NextLink != nil && len(*ehdlr.NextLink) != 0
248 }
249
250
251
252 func (ehdlr EndpointHealthDataListResult) endpointHealthDataListResultPreparer(ctx context.Context) (*http.Request, error) {
253 if !ehdlr.hasNextLink() {
254 return nil, nil
255 }
256 return autorest.Prepare((&http.Request{}).WithContext(ctx),
257 autorest.AsJSON(),
258 autorest.AsGet(),
259 autorest.WithBaseURL(to.String(ehdlr.NextLink)))
260 }
261
262
263 type EndpointHealthDataListResultPage struct {
264 fn func(context.Context, EndpointHealthDataListResult) (EndpointHealthDataListResult, error)
265 ehdlr EndpointHealthDataListResult
266 }
267
268
269
270 func (page *EndpointHealthDataListResultPage) NextWithContext(ctx context.Context) (err error) {
271 if tracing.IsEnabled() {
272 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointHealthDataListResultPage.NextWithContext")
273 defer func() {
274 sc := -1
275 if page.Response().Response.Response != nil {
276 sc = page.Response().Response.Response.StatusCode
277 }
278 tracing.EndSpan(ctx, sc, err)
279 }()
280 }
281 for {
282 next, err := page.fn(ctx, page.ehdlr)
283 if err != nil {
284 return err
285 }
286 page.ehdlr = next
287 if !next.hasNextLink() || !next.IsEmpty() {
288 break
289 }
290 }
291 return nil
292 }
293
294
295
296
297 func (page *EndpointHealthDataListResultPage) Next() error {
298 return page.NextWithContext(context.Background())
299 }
300
301
302 func (page EndpointHealthDataListResultPage) NotDone() bool {
303 return !page.ehdlr.IsEmpty()
304 }
305
306
307 func (page EndpointHealthDataListResultPage) Response() EndpointHealthDataListResult {
308 return page.ehdlr
309 }
310
311
312 func (page EndpointHealthDataListResultPage) Values() []EndpointHealthData {
313 if page.ehdlr.IsEmpty() {
314 return nil
315 }
316 return *page.ehdlr.Value
317 }
318
319
320 func NewEndpointHealthDataListResultPage(cur EndpointHealthDataListResult, getNextPage func(context.Context, EndpointHealthDataListResult) (EndpointHealthDataListResult, error)) EndpointHealthDataListResultPage {
321 return EndpointHealthDataListResultPage{
322 fn: getNextPage,
323 ehdlr: cur,
324 }
325 }
326
327
328
329 type EnrichmentProperties struct {
330
331 Key *string `json:"key,omitempty"`
332
333 Value *string `json:"value,omitempty"`
334
335 EndpointNames *[]string `json:"endpointNames,omitempty"`
336 }
337
338
339 type ErrorDetails struct {
340
341 Code *string `json:"code,omitempty"`
342
343 HTTPStatusCode *string `json:"httpStatusCode,omitempty"`
344
345 Message *string `json:"message,omitempty"`
346
347 Details *string `json:"details,omitempty"`
348 }
349
350
351 func (ed ErrorDetails) MarshalJSON() ([]byte, error) {
352 objectMap := make(map[string]interface{})
353 return json.Marshal(objectMap)
354 }
355
356
357 type EventHubConsumerGroupInfo struct {
358 autorest.Response `json:"-"`
359
360 Properties map[string]*string `json:"properties"`
361
362 ID *string `json:"id,omitempty"`
363
364 Name *string `json:"name,omitempty"`
365
366 Type *string `json:"type,omitempty"`
367
368 Etag *string `json:"etag,omitempty"`
369 }
370
371
372 func (ehcgi EventHubConsumerGroupInfo) MarshalJSON() ([]byte, error) {
373 objectMap := make(map[string]interface{})
374 if ehcgi.Properties != nil {
375 objectMap["properties"] = ehcgi.Properties
376 }
377 return json.Marshal(objectMap)
378 }
379
380
381
382 type EventHubConsumerGroupsListResult struct {
383 autorest.Response `json:"-"`
384
385 Value *[]EventHubConsumerGroupInfo `json:"value,omitempty"`
386
387 NextLink *string `json:"nextLink,omitempty"`
388 }
389
390
391 func (ehcglr EventHubConsumerGroupsListResult) MarshalJSON() ([]byte, error) {
392 objectMap := make(map[string]interface{})
393 if ehcglr.Value != nil {
394 objectMap["value"] = ehcglr.Value
395 }
396 return json.Marshal(objectMap)
397 }
398
399
400
401 type EventHubConsumerGroupsListResultIterator struct {
402 i int
403 page EventHubConsumerGroupsListResultPage
404 }
405
406
407
408 func (iter *EventHubConsumerGroupsListResultIterator) NextWithContext(ctx context.Context) (err error) {
409 if tracing.IsEnabled() {
410 ctx = tracing.StartSpan(ctx, fqdn+"/EventHubConsumerGroupsListResultIterator.NextWithContext")
411 defer func() {
412 sc := -1
413 if iter.Response().Response.Response != nil {
414 sc = iter.Response().Response.Response.StatusCode
415 }
416 tracing.EndSpan(ctx, sc, err)
417 }()
418 }
419 iter.i++
420 if iter.i < len(iter.page.Values()) {
421 return nil
422 }
423 err = iter.page.NextWithContext(ctx)
424 if err != nil {
425 iter.i--
426 return err
427 }
428 iter.i = 0
429 return nil
430 }
431
432
433
434
435 func (iter *EventHubConsumerGroupsListResultIterator) Next() error {
436 return iter.NextWithContext(context.Background())
437 }
438
439
440 func (iter EventHubConsumerGroupsListResultIterator) NotDone() bool {
441 return iter.page.NotDone() && iter.i < len(iter.page.Values())
442 }
443
444
445 func (iter EventHubConsumerGroupsListResultIterator) Response() EventHubConsumerGroupsListResult {
446 return iter.page.Response()
447 }
448
449
450
451 func (iter EventHubConsumerGroupsListResultIterator) Value() EventHubConsumerGroupInfo {
452 if !iter.page.NotDone() {
453 return EventHubConsumerGroupInfo{}
454 }
455 return iter.page.Values()[iter.i]
456 }
457
458
459 func NewEventHubConsumerGroupsListResultIterator(page EventHubConsumerGroupsListResultPage) EventHubConsumerGroupsListResultIterator {
460 return EventHubConsumerGroupsListResultIterator{page: page}
461 }
462
463
464 func (ehcglr EventHubConsumerGroupsListResult) IsEmpty() bool {
465 return ehcglr.Value == nil || len(*ehcglr.Value) == 0
466 }
467
468
469 func (ehcglr EventHubConsumerGroupsListResult) hasNextLink() bool {
470 return ehcglr.NextLink != nil && len(*ehcglr.NextLink) != 0
471 }
472
473
474
475 func (ehcglr EventHubConsumerGroupsListResult) eventHubConsumerGroupsListResultPreparer(ctx context.Context) (*http.Request, error) {
476 if !ehcglr.hasNextLink() {
477 return nil, nil
478 }
479 return autorest.Prepare((&http.Request{}).WithContext(ctx),
480 autorest.AsJSON(),
481 autorest.AsGet(),
482 autorest.WithBaseURL(to.String(ehcglr.NextLink)))
483 }
484
485
486 type EventHubConsumerGroupsListResultPage struct {
487 fn func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)
488 ehcglr EventHubConsumerGroupsListResult
489 }
490
491
492
493 func (page *EventHubConsumerGroupsListResultPage) NextWithContext(ctx context.Context) (err error) {
494 if tracing.IsEnabled() {
495 ctx = tracing.StartSpan(ctx, fqdn+"/EventHubConsumerGroupsListResultPage.NextWithContext")
496 defer func() {
497 sc := -1
498 if page.Response().Response.Response != nil {
499 sc = page.Response().Response.Response.StatusCode
500 }
501 tracing.EndSpan(ctx, sc, err)
502 }()
503 }
504 for {
505 next, err := page.fn(ctx, page.ehcglr)
506 if err != nil {
507 return err
508 }
509 page.ehcglr = next
510 if !next.hasNextLink() || !next.IsEmpty() {
511 break
512 }
513 }
514 return nil
515 }
516
517
518
519
520 func (page *EventHubConsumerGroupsListResultPage) Next() error {
521 return page.NextWithContext(context.Background())
522 }
523
524
525 func (page EventHubConsumerGroupsListResultPage) NotDone() bool {
526 return !page.ehcglr.IsEmpty()
527 }
528
529
530 func (page EventHubConsumerGroupsListResultPage) Response() EventHubConsumerGroupsListResult {
531 return page.ehcglr
532 }
533
534
535 func (page EventHubConsumerGroupsListResultPage) Values() []EventHubConsumerGroupInfo {
536 if page.ehcglr.IsEmpty() {
537 return nil
538 }
539 return *page.ehcglr.Value
540 }
541
542
543 func NewEventHubConsumerGroupsListResultPage(cur EventHubConsumerGroupsListResult, getNextPage func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)) EventHubConsumerGroupsListResultPage {
544 return EventHubConsumerGroupsListResultPage{
545 fn: getNextPage,
546 ehcglr: cur,
547 }
548 }
549
550
551 type EventHubProperties struct {
552
553 RetentionTimeInDays *int64 `json:"retentionTimeInDays,omitempty"`
554
555 PartitionCount *int32 `json:"partitionCount,omitempty"`
556
557 PartitionIds *[]string `json:"partitionIds,omitempty"`
558
559 Path *string `json:"path,omitempty"`
560
561 Endpoint *string `json:"endpoint,omitempty"`
562 }
563
564
565 func (ehp EventHubProperties) MarshalJSON() ([]byte, error) {
566 objectMap := make(map[string]interface{})
567 if ehp.RetentionTimeInDays != nil {
568 objectMap["retentionTimeInDays"] = ehp.RetentionTimeInDays
569 }
570 if ehp.PartitionCount != nil {
571 objectMap["partitionCount"] = ehp.PartitionCount
572 }
573 return json.Marshal(objectMap)
574 }
575
576
577 type ExportDevicesRequest struct {
578
579 ExportBlobContainerURI *string `json:"exportBlobContainerUri,omitempty"`
580
581 ExcludeKeys *bool `json:"excludeKeys,omitempty"`
582 }
583
584
585 type FailoverInput struct {
586
587 FailoverRegion *string `json:"failoverRegion,omitempty"`
588 }
589
590
591
592 type FallbackRouteProperties struct {
593
594 Name *string `json:"name,omitempty"`
595
596 Source *string `json:"source,omitempty"`
597
598 Condition *string `json:"condition,omitempty"`
599
600 EndpointNames *[]string `json:"endpointNames,omitempty"`
601
602 IsEnabled *bool `json:"isEnabled,omitempty"`
603 }
604
605
606 type FeedbackProperties struct {
607
608 LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"`
609
610 TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"`
611
612 MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
613 }
614
615
616 type ImportDevicesRequest struct {
617
618 InputBlobContainerURI *string `json:"inputBlobContainerUri,omitempty"`
619
620 OutputBlobContainerURI *string `json:"outputBlobContainerUri,omitempty"`
621 }
622
623
624 type IotHubCapacity struct {
625
626 Minimum *int64 `json:"minimum,omitempty"`
627
628 Maximum *int64 `json:"maximum,omitempty"`
629
630 Default *int64 `json:"default,omitempty"`
631
632 ScaleType IotHubScaleType `json:"scaleType,omitempty"`
633 }
634
635
636 func (ihc IotHubCapacity) MarshalJSON() ([]byte, error) {
637 objectMap := make(map[string]interface{})
638 return json.Marshal(objectMap)
639 }
640
641
642 type IotHubDescription struct {
643 autorest.Response `json:"-"`
644
645 Etag *string `json:"etag,omitempty"`
646
647 Properties *IotHubProperties `json:"properties,omitempty"`
648
649 Sku *IotHubSkuInfo `json:"sku,omitempty"`
650
651 ID *string `json:"id,omitempty"`
652
653 Name *string `json:"name,omitempty"`
654
655 Type *string `json:"type,omitempty"`
656
657 Location *string `json:"location,omitempty"`
658
659 Tags map[string]*string `json:"tags"`
660 }
661
662
663 func (ihd IotHubDescription) MarshalJSON() ([]byte, error) {
664 objectMap := make(map[string]interface{})
665 if ihd.Etag != nil {
666 objectMap["etag"] = ihd.Etag
667 }
668 if ihd.Properties != nil {
669 objectMap["properties"] = ihd.Properties
670 }
671 if ihd.Sku != nil {
672 objectMap["sku"] = ihd.Sku
673 }
674 if ihd.Location != nil {
675 objectMap["location"] = ihd.Location
676 }
677 if ihd.Tags != nil {
678 objectMap["tags"] = ihd.Tags
679 }
680 return json.Marshal(objectMap)
681 }
682
683
684 type IotHubDescriptionListResult struct {
685 autorest.Response `json:"-"`
686
687 Value *[]IotHubDescription `json:"value,omitempty"`
688
689 NextLink *string `json:"nextLink,omitempty"`
690 }
691
692
693 func (ihdlr IotHubDescriptionListResult) MarshalJSON() ([]byte, error) {
694 objectMap := make(map[string]interface{})
695 if ihdlr.Value != nil {
696 objectMap["value"] = ihdlr.Value
697 }
698 return json.Marshal(objectMap)
699 }
700
701
702 type IotHubDescriptionListResultIterator struct {
703 i int
704 page IotHubDescriptionListResultPage
705 }
706
707
708
709 func (iter *IotHubDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
710 if tracing.IsEnabled() {
711 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultIterator.NextWithContext")
712 defer func() {
713 sc := -1
714 if iter.Response().Response.Response != nil {
715 sc = iter.Response().Response.Response.StatusCode
716 }
717 tracing.EndSpan(ctx, sc, err)
718 }()
719 }
720 iter.i++
721 if iter.i < len(iter.page.Values()) {
722 return nil
723 }
724 err = iter.page.NextWithContext(ctx)
725 if err != nil {
726 iter.i--
727 return err
728 }
729 iter.i = 0
730 return nil
731 }
732
733
734
735
736 func (iter *IotHubDescriptionListResultIterator) Next() error {
737 return iter.NextWithContext(context.Background())
738 }
739
740
741 func (iter IotHubDescriptionListResultIterator) NotDone() bool {
742 return iter.page.NotDone() && iter.i < len(iter.page.Values())
743 }
744
745
746 func (iter IotHubDescriptionListResultIterator) Response() IotHubDescriptionListResult {
747 return iter.page.Response()
748 }
749
750
751
752 func (iter IotHubDescriptionListResultIterator) Value() IotHubDescription {
753 if !iter.page.NotDone() {
754 return IotHubDescription{}
755 }
756 return iter.page.Values()[iter.i]
757 }
758
759
760 func NewIotHubDescriptionListResultIterator(page IotHubDescriptionListResultPage) IotHubDescriptionListResultIterator {
761 return IotHubDescriptionListResultIterator{page: page}
762 }
763
764
765 func (ihdlr IotHubDescriptionListResult) IsEmpty() bool {
766 return ihdlr.Value == nil || len(*ihdlr.Value) == 0
767 }
768
769
770 func (ihdlr IotHubDescriptionListResult) hasNextLink() bool {
771 return ihdlr.NextLink != nil && len(*ihdlr.NextLink) != 0
772 }
773
774
775
776 func (ihdlr IotHubDescriptionListResult) iotHubDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
777 if !ihdlr.hasNextLink() {
778 return nil, nil
779 }
780 return autorest.Prepare((&http.Request{}).WithContext(ctx),
781 autorest.AsJSON(),
782 autorest.AsGet(),
783 autorest.WithBaseURL(to.String(ihdlr.NextLink)))
784 }
785
786
787 type IotHubDescriptionListResultPage struct {
788 fn func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)
789 ihdlr IotHubDescriptionListResult
790 }
791
792
793
794 func (page *IotHubDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
795 if tracing.IsEnabled() {
796 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultPage.NextWithContext")
797 defer func() {
798 sc := -1
799 if page.Response().Response.Response != nil {
800 sc = page.Response().Response.Response.StatusCode
801 }
802 tracing.EndSpan(ctx, sc, err)
803 }()
804 }
805 for {
806 next, err := page.fn(ctx, page.ihdlr)
807 if err != nil {
808 return err
809 }
810 page.ihdlr = next
811 if !next.hasNextLink() || !next.IsEmpty() {
812 break
813 }
814 }
815 return nil
816 }
817
818
819
820
821 func (page *IotHubDescriptionListResultPage) Next() error {
822 return page.NextWithContext(context.Background())
823 }
824
825
826 func (page IotHubDescriptionListResultPage) NotDone() bool {
827 return !page.ihdlr.IsEmpty()
828 }
829
830
831 func (page IotHubDescriptionListResultPage) Response() IotHubDescriptionListResult {
832 return page.ihdlr
833 }
834
835
836 func (page IotHubDescriptionListResultPage) Values() []IotHubDescription {
837 if page.ihdlr.IsEmpty() {
838 return nil
839 }
840 return *page.ihdlr.Value
841 }
842
843
844 func NewIotHubDescriptionListResultPage(cur IotHubDescriptionListResult, getNextPage func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)) IotHubDescriptionListResultPage {
845 return IotHubDescriptionListResultPage{
846 fn: getNextPage,
847 ihdlr: cur,
848 }
849 }
850
851
852 type IotHubLocationDescription struct {
853
854 Location *string `json:"location,omitempty"`
855
856 Role IotHubReplicaRoleType `json:"role,omitempty"`
857 }
858
859
860
861 type IotHubManualFailoverFuture struct {
862 azure.FutureAPI
863
864
865 Result func(IotHubClient) (autorest.Response, error)
866 }
867
868
869 func (future *IotHubManualFailoverFuture) UnmarshalJSON(body []byte) error {
870 var azFuture azure.Future
871 if err := json.Unmarshal(body, &azFuture); err != nil {
872 return err
873 }
874 future.FutureAPI = &azFuture
875 future.Result = future.result
876 return nil
877 }
878
879
880 func (future *IotHubManualFailoverFuture) result(client IotHubClient) (ar autorest.Response, err error) {
881 var done bool
882 done, err = future.DoneWithContext(context.Background(), client)
883 if err != nil {
884 err = autorest.NewErrorWithError(err, "devices.IotHubManualFailoverFuture", "Result", future.Response(), "Polling failure")
885 return
886 }
887 if !done {
888 ar.Response = future.Response()
889 err = azure.NewAsyncOpIncompleteError("devices.IotHubManualFailoverFuture")
890 return
891 }
892 ar.Response = future.Response()
893 return
894 }
895
896
897 type IotHubNameAvailabilityInfo struct {
898 autorest.Response `json:"-"`
899
900 NameAvailable *bool `json:"nameAvailable,omitempty"`
901
902 Reason IotHubNameUnavailabilityReason `json:"reason,omitempty"`
903
904 Message *string `json:"message,omitempty"`
905 }
906
907
908 func (ihnai IotHubNameAvailabilityInfo) MarshalJSON() ([]byte, error) {
909 objectMap := make(map[string]interface{})
910 if ihnai.Message != nil {
911 objectMap["message"] = ihnai.Message
912 }
913 return json.Marshal(objectMap)
914 }
915
916
917 type IotHubProperties struct {
918
919 AuthorizationPolicies *[]SharedAccessSignatureAuthorizationRule `json:"authorizationPolicies,omitempty"`
920
921 IPFilterRules *[]IPFilterRule `json:"ipFilterRules,omitempty"`
922
923 ProvisioningState *string `json:"provisioningState,omitempty"`
924
925 State *string `json:"state,omitempty"`
926
927 HostName *string `json:"hostName,omitempty"`
928
929 EventHubEndpoints map[string]*EventHubProperties `json:"eventHubEndpoints"`
930 Routing *RoutingProperties `json:"routing,omitempty"`
931
932 StorageEndpoints map[string]*StorageEndpointProperties `json:"storageEndpoints"`
933
934 MessagingEndpoints map[string]*MessagingEndpointProperties `json:"messagingEndpoints"`
935
936 EnableFileUploadNotifications *bool `json:"enableFileUploadNotifications,omitempty"`
937 CloudToDevice *CloudToDeviceProperties `json:"cloudToDevice,omitempty"`
938
939 Comments *string `json:"comments,omitempty"`
940
941 DeviceStreams *IotHubPropertiesDeviceStreams `json:"deviceStreams,omitempty"`
942
943 Features Capabilities `json:"features,omitempty"`
944
945 Locations *[]IotHubLocationDescription `json:"locations,omitempty"`
946 }
947
948
949 func (ihp IotHubProperties) MarshalJSON() ([]byte, error) {
950 objectMap := make(map[string]interface{})
951 if ihp.AuthorizationPolicies != nil {
952 objectMap["authorizationPolicies"] = ihp.AuthorizationPolicies
953 }
954 if ihp.IPFilterRules != nil {
955 objectMap["ipFilterRules"] = ihp.IPFilterRules
956 }
957 if ihp.EventHubEndpoints != nil {
958 objectMap["eventHubEndpoints"] = ihp.EventHubEndpoints
959 }
960 if ihp.Routing != nil {
961 objectMap["routing"] = ihp.Routing
962 }
963 if ihp.StorageEndpoints != nil {
964 objectMap["storageEndpoints"] = ihp.StorageEndpoints
965 }
966 if ihp.MessagingEndpoints != nil {
967 objectMap["messagingEndpoints"] = ihp.MessagingEndpoints
968 }
969 if ihp.EnableFileUploadNotifications != nil {
970 objectMap["enableFileUploadNotifications"] = ihp.EnableFileUploadNotifications
971 }
972 if ihp.CloudToDevice != nil {
973 objectMap["cloudToDevice"] = ihp.CloudToDevice
974 }
975 if ihp.Comments != nil {
976 objectMap["comments"] = ihp.Comments
977 }
978 if ihp.DeviceStreams != nil {
979 objectMap["deviceStreams"] = ihp.DeviceStreams
980 }
981 if ihp.Features != "" {
982 objectMap["features"] = ihp.Features
983 }
984 return json.Marshal(objectMap)
985 }
986
987
988 type IotHubPropertiesDeviceStreams struct {
989
990 StreamingEndpoints *[]string `json:"streamingEndpoints,omitempty"`
991 }
992
993
994 type IotHubQuotaMetricInfo struct {
995
996 Name *string `json:"name,omitempty"`
997
998 CurrentValue *int64 `json:"currentValue,omitempty"`
999
1000 MaxValue *int64 `json:"maxValue,omitempty"`
1001 }
1002
1003
1004 func (ihqmi IotHubQuotaMetricInfo) MarshalJSON() ([]byte, error) {
1005 objectMap := make(map[string]interface{})
1006 return json.Marshal(objectMap)
1007 }
1008
1009
1010
1011 type IotHubQuotaMetricInfoListResult struct {
1012 autorest.Response `json:"-"`
1013
1014 Value *[]IotHubQuotaMetricInfo `json:"value,omitempty"`
1015
1016 NextLink *string `json:"nextLink,omitempty"`
1017 }
1018
1019
1020 func (ihqmilr IotHubQuotaMetricInfoListResult) MarshalJSON() ([]byte, error) {
1021 objectMap := make(map[string]interface{})
1022 if ihqmilr.Value != nil {
1023 objectMap["value"] = ihqmilr.Value
1024 }
1025 return json.Marshal(objectMap)
1026 }
1027
1028
1029
1030 type IotHubQuotaMetricInfoListResultIterator struct {
1031 i int
1032 page IotHubQuotaMetricInfoListResultPage
1033 }
1034
1035
1036
1037 func (iter *IotHubQuotaMetricInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
1038 if tracing.IsEnabled() {
1039 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultIterator.NextWithContext")
1040 defer func() {
1041 sc := -1
1042 if iter.Response().Response.Response != nil {
1043 sc = iter.Response().Response.Response.StatusCode
1044 }
1045 tracing.EndSpan(ctx, sc, err)
1046 }()
1047 }
1048 iter.i++
1049 if iter.i < len(iter.page.Values()) {
1050 return nil
1051 }
1052 err = iter.page.NextWithContext(ctx)
1053 if err != nil {
1054 iter.i--
1055 return err
1056 }
1057 iter.i = 0
1058 return nil
1059 }
1060
1061
1062
1063
1064 func (iter *IotHubQuotaMetricInfoListResultIterator) Next() error {
1065 return iter.NextWithContext(context.Background())
1066 }
1067
1068
1069 func (iter IotHubQuotaMetricInfoListResultIterator) NotDone() bool {
1070 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1071 }
1072
1073
1074 func (iter IotHubQuotaMetricInfoListResultIterator) Response() IotHubQuotaMetricInfoListResult {
1075 return iter.page.Response()
1076 }
1077
1078
1079
1080 func (iter IotHubQuotaMetricInfoListResultIterator) Value() IotHubQuotaMetricInfo {
1081 if !iter.page.NotDone() {
1082 return IotHubQuotaMetricInfo{}
1083 }
1084 return iter.page.Values()[iter.i]
1085 }
1086
1087
1088 func NewIotHubQuotaMetricInfoListResultIterator(page IotHubQuotaMetricInfoListResultPage) IotHubQuotaMetricInfoListResultIterator {
1089 return IotHubQuotaMetricInfoListResultIterator{page: page}
1090 }
1091
1092
1093 func (ihqmilr IotHubQuotaMetricInfoListResult) IsEmpty() bool {
1094 return ihqmilr.Value == nil || len(*ihqmilr.Value) == 0
1095 }
1096
1097
1098 func (ihqmilr IotHubQuotaMetricInfoListResult) hasNextLink() bool {
1099 return ihqmilr.NextLink != nil && len(*ihqmilr.NextLink) != 0
1100 }
1101
1102
1103
1104 func (ihqmilr IotHubQuotaMetricInfoListResult) iotHubQuotaMetricInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
1105 if !ihqmilr.hasNextLink() {
1106 return nil, nil
1107 }
1108 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1109 autorest.AsJSON(),
1110 autorest.AsGet(),
1111 autorest.WithBaseURL(to.String(ihqmilr.NextLink)))
1112 }
1113
1114
1115 type IotHubQuotaMetricInfoListResultPage struct {
1116 fn func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)
1117 ihqmilr IotHubQuotaMetricInfoListResult
1118 }
1119
1120
1121
1122 func (page *IotHubQuotaMetricInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
1123 if tracing.IsEnabled() {
1124 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultPage.NextWithContext")
1125 defer func() {
1126 sc := -1
1127 if page.Response().Response.Response != nil {
1128 sc = page.Response().Response.Response.StatusCode
1129 }
1130 tracing.EndSpan(ctx, sc, err)
1131 }()
1132 }
1133 for {
1134 next, err := page.fn(ctx, page.ihqmilr)
1135 if err != nil {
1136 return err
1137 }
1138 page.ihqmilr = next
1139 if !next.hasNextLink() || !next.IsEmpty() {
1140 break
1141 }
1142 }
1143 return nil
1144 }
1145
1146
1147
1148
1149 func (page *IotHubQuotaMetricInfoListResultPage) Next() error {
1150 return page.NextWithContext(context.Background())
1151 }
1152
1153
1154 func (page IotHubQuotaMetricInfoListResultPage) NotDone() bool {
1155 return !page.ihqmilr.IsEmpty()
1156 }
1157
1158
1159 func (page IotHubQuotaMetricInfoListResultPage) Response() IotHubQuotaMetricInfoListResult {
1160 return page.ihqmilr
1161 }
1162
1163
1164 func (page IotHubQuotaMetricInfoListResultPage) Values() []IotHubQuotaMetricInfo {
1165 if page.ihqmilr.IsEmpty() {
1166 return nil
1167 }
1168 return *page.ihqmilr.Value
1169 }
1170
1171
1172 func NewIotHubQuotaMetricInfoListResultPage(cur IotHubQuotaMetricInfoListResult, getNextPage func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)) IotHubQuotaMetricInfoListResultPage {
1173 return IotHubQuotaMetricInfoListResultPage{
1174 fn: getNextPage,
1175 ihqmilr: cur,
1176 }
1177 }
1178
1179
1180
1181 type IotHubResourceCreateOrUpdateFuture struct {
1182 azure.FutureAPI
1183
1184
1185 Result func(IotHubResourceClient) (IotHubDescription, error)
1186 }
1187
1188
1189 func (future *IotHubResourceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1190 var azFuture azure.Future
1191 if err := json.Unmarshal(body, &azFuture); err != nil {
1192 return err
1193 }
1194 future.FutureAPI = &azFuture
1195 future.Result = future.result
1196 return nil
1197 }
1198
1199
1200 func (future *IotHubResourceCreateOrUpdateFuture) result(client IotHubResourceClient) (ihd IotHubDescription, err error) {
1201 var done bool
1202 done, err = future.DoneWithContext(context.Background(), client)
1203 if err != nil {
1204 err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1205 return
1206 }
1207 if !done {
1208 ihd.Response.Response = future.Response()
1209 err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceCreateOrUpdateFuture")
1210 return
1211 }
1212 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1213 if ihd.Response.Response, err = future.GetResult(sender); err == nil && ihd.Response.Response.StatusCode != http.StatusNoContent {
1214 ihd, err = client.CreateOrUpdateResponder(ihd.Response.Response)
1215 if err != nil {
1216 err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", ihd.Response.Response, "Failure responding to request")
1217 }
1218 }
1219 return
1220 }
1221
1222
1223
1224 type IotHubResourceDeleteFuture struct {
1225 azure.FutureAPI
1226
1227
1228 Result func(IotHubResourceClient) (SetObject, error)
1229 }
1230
1231
1232 func (future *IotHubResourceDeleteFuture) UnmarshalJSON(body []byte) error {
1233 var azFuture azure.Future
1234 if err := json.Unmarshal(body, &azFuture); err != nil {
1235 return err
1236 }
1237 future.FutureAPI = &azFuture
1238 future.Result = future.result
1239 return nil
1240 }
1241
1242
1243 func (future *IotHubResourceDeleteFuture) result(client IotHubResourceClient) (so SetObject, err error) {
1244 var done bool
1245 done, err = future.DoneWithContext(context.Background(), client)
1246 if err != nil {
1247 err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", future.Response(), "Polling failure")
1248 return
1249 }
1250 if !done {
1251 so.Response.Response = future.Response()
1252 err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceDeleteFuture")
1253 return
1254 }
1255 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1256 if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
1257 so, err = client.DeleteResponder(so.Response.Response)
1258 if err != nil {
1259 err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", so.Response.Response, "Failure responding to request")
1260 }
1261 }
1262 return
1263 }
1264
1265
1266
1267 type IotHubResourceUpdateFuture struct {
1268 azure.FutureAPI
1269
1270
1271 Result func(IotHubResourceClient) (IotHubDescription, error)
1272 }
1273
1274
1275 func (future *IotHubResourceUpdateFuture) UnmarshalJSON(body []byte) error {
1276 var azFuture azure.Future
1277 if err := json.Unmarshal(body, &azFuture); err != nil {
1278 return err
1279 }
1280 future.FutureAPI = &azFuture
1281 future.Result = future.result
1282 return nil
1283 }
1284
1285
1286 func (future *IotHubResourceUpdateFuture) result(client IotHubResourceClient) (ihd IotHubDescription, err error) {
1287 var done bool
1288 done, err = future.DoneWithContext(context.Background(), client)
1289 if err != nil {
1290 err = autorest.NewErrorWithError(err, "devices.IotHubResourceUpdateFuture", "Result", future.Response(), "Polling failure")
1291 return
1292 }
1293 if !done {
1294 ihd.Response.Response = future.Response()
1295 err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceUpdateFuture")
1296 return
1297 }
1298 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1299 if ihd.Response.Response, err = future.GetResult(sender); err == nil && ihd.Response.Response.StatusCode != http.StatusNoContent {
1300 ihd, err = client.UpdateResponder(ihd.Response.Response)
1301 if err != nil {
1302 err = autorest.NewErrorWithError(err, "devices.IotHubResourceUpdateFuture", "Result", ihd.Response.Response, "Failure responding to request")
1303 }
1304 }
1305 return
1306 }
1307
1308
1309 type IotHubSkuDescription struct {
1310
1311 ResourceType *string `json:"resourceType,omitempty"`
1312
1313 Sku *IotHubSkuInfo `json:"sku,omitempty"`
1314
1315 Capacity *IotHubCapacity `json:"capacity,omitempty"`
1316 }
1317
1318
1319 func (ihsd IotHubSkuDescription) MarshalJSON() ([]byte, error) {
1320 objectMap := make(map[string]interface{})
1321 if ihsd.Sku != nil {
1322 objectMap["sku"] = ihsd.Sku
1323 }
1324 if ihsd.Capacity != nil {
1325 objectMap["capacity"] = ihsd.Capacity
1326 }
1327 return json.Marshal(objectMap)
1328 }
1329
1330
1331
1332 type IotHubSkuDescriptionListResult struct {
1333 autorest.Response `json:"-"`
1334
1335 Value *[]IotHubSkuDescription `json:"value,omitempty"`
1336
1337 NextLink *string `json:"nextLink,omitempty"`
1338 }
1339
1340
1341 func (ihsdlr IotHubSkuDescriptionListResult) MarshalJSON() ([]byte, error) {
1342 objectMap := make(map[string]interface{})
1343 if ihsdlr.Value != nil {
1344 objectMap["value"] = ihsdlr.Value
1345 }
1346 return json.Marshal(objectMap)
1347 }
1348
1349
1350
1351 type IotHubSkuDescriptionListResultIterator struct {
1352 i int
1353 page IotHubSkuDescriptionListResultPage
1354 }
1355
1356
1357
1358 func (iter *IotHubSkuDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
1359 if tracing.IsEnabled() {
1360 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultIterator.NextWithContext")
1361 defer func() {
1362 sc := -1
1363 if iter.Response().Response.Response != nil {
1364 sc = iter.Response().Response.Response.StatusCode
1365 }
1366 tracing.EndSpan(ctx, sc, err)
1367 }()
1368 }
1369 iter.i++
1370 if iter.i < len(iter.page.Values()) {
1371 return nil
1372 }
1373 err = iter.page.NextWithContext(ctx)
1374 if err != nil {
1375 iter.i--
1376 return err
1377 }
1378 iter.i = 0
1379 return nil
1380 }
1381
1382
1383
1384
1385 func (iter *IotHubSkuDescriptionListResultIterator) Next() error {
1386 return iter.NextWithContext(context.Background())
1387 }
1388
1389
1390 func (iter IotHubSkuDescriptionListResultIterator) NotDone() bool {
1391 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1392 }
1393
1394
1395 func (iter IotHubSkuDescriptionListResultIterator) Response() IotHubSkuDescriptionListResult {
1396 return iter.page.Response()
1397 }
1398
1399
1400
1401 func (iter IotHubSkuDescriptionListResultIterator) Value() IotHubSkuDescription {
1402 if !iter.page.NotDone() {
1403 return IotHubSkuDescription{}
1404 }
1405 return iter.page.Values()[iter.i]
1406 }
1407
1408
1409 func NewIotHubSkuDescriptionListResultIterator(page IotHubSkuDescriptionListResultPage) IotHubSkuDescriptionListResultIterator {
1410 return IotHubSkuDescriptionListResultIterator{page: page}
1411 }
1412
1413
1414 func (ihsdlr IotHubSkuDescriptionListResult) IsEmpty() bool {
1415 return ihsdlr.Value == nil || len(*ihsdlr.Value) == 0
1416 }
1417
1418
1419 func (ihsdlr IotHubSkuDescriptionListResult) hasNextLink() bool {
1420 return ihsdlr.NextLink != nil && len(*ihsdlr.NextLink) != 0
1421 }
1422
1423
1424
1425 func (ihsdlr IotHubSkuDescriptionListResult) iotHubSkuDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
1426 if !ihsdlr.hasNextLink() {
1427 return nil, nil
1428 }
1429 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1430 autorest.AsJSON(),
1431 autorest.AsGet(),
1432 autorest.WithBaseURL(to.String(ihsdlr.NextLink)))
1433 }
1434
1435
1436 type IotHubSkuDescriptionListResultPage struct {
1437 fn func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)
1438 ihsdlr IotHubSkuDescriptionListResult
1439 }
1440
1441
1442
1443 func (page *IotHubSkuDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
1444 if tracing.IsEnabled() {
1445 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultPage.NextWithContext")
1446 defer func() {
1447 sc := -1
1448 if page.Response().Response.Response != nil {
1449 sc = page.Response().Response.Response.StatusCode
1450 }
1451 tracing.EndSpan(ctx, sc, err)
1452 }()
1453 }
1454 for {
1455 next, err := page.fn(ctx, page.ihsdlr)
1456 if err != nil {
1457 return err
1458 }
1459 page.ihsdlr = next
1460 if !next.hasNextLink() || !next.IsEmpty() {
1461 break
1462 }
1463 }
1464 return nil
1465 }
1466
1467
1468
1469
1470 func (page *IotHubSkuDescriptionListResultPage) Next() error {
1471 return page.NextWithContext(context.Background())
1472 }
1473
1474
1475 func (page IotHubSkuDescriptionListResultPage) NotDone() bool {
1476 return !page.ihsdlr.IsEmpty()
1477 }
1478
1479
1480 func (page IotHubSkuDescriptionListResultPage) Response() IotHubSkuDescriptionListResult {
1481 return page.ihsdlr
1482 }
1483
1484
1485 func (page IotHubSkuDescriptionListResultPage) Values() []IotHubSkuDescription {
1486 if page.ihsdlr.IsEmpty() {
1487 return nil
1488 }
1489 return *page.ihsdlr.Value
1490 }
1491
1492
1493 func NewIotHubSkuDescriptionListResultPage(cur IotHubSkuDescriptionListResult, getNextPage func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)) IotHubSkuDescriptionListResultPage {
1494 return IotHubSkuDescriptionListResultPage{
1495 fn: getNextPage,
1496 ihsdlr: cur,
1497 }
1498 }
1499
1500
1501 type IotHubSkuInfo struct {
1502
1503 Name IotHubSku `json:"name,omitempty"`
1504
1505 Tier IotHubSkuTier `json:"tier,omitempty"`
1506
1507 Capacity *int64 `json:"capacity,omitempty"`
1508 }
1509
1510
1511 func (ihsi IotHubSkuInfo) MarshalJSON() ([]byte, error) {
1512 objectMap := make(map[string]interface{})
1513 if ihsi.Name != "" {
1514 objectMap["name"] = ihsi.Name
1515 }
1516 if ihsi.Capacity != nil {
1517 objectMap["capacity"] = ihsi.Capacity
1518 }
1519 return json.Marshal(objectMap)
1520 }
1521
1522
1523 type IPFilterRule struct {
1524
1525 FilterName *string `json:"filterName,omitempty"`
1526
1527 Action IPFilterActionType `json:"action,omitempty"`
1528
1529 IPMask *string `json:"ipMask,omitempty"`
1530 }
1531
1532
1533 type JobResponse struct {
1534 autorest.Response `json:"-"`
1535
1536 JobID *string `json:"jobId,omitempty"`
1537
1538 StartTimeUtc *date.TimeRFC1123 `json:"startTimeUtc,omitempty"`
1539
1540 EndTimeUtc *date.TimeRFC1123 `json:"endTimeUtc,omitempty"`
1541
1542 Type JobType `json:"type,omitempty"`
1543
1544 Status JobStatus `json:"status,omitempty"`
1545
1546 FailureReason *string `json:"failureReason,omitempty"`
1547
1548 StatusMessage *string `json:"statusMessage,omitempty"`
1549
1550 ParentJobID *string `json:"parentJobId,omitempty"`
1551 }
1552
1553
1554 func (jr JobResponse) MarshalJSON() ([]byte, error) {
1555 objectMap := make(map[string]interface{})
1556 return json.Marshal(objectMap)
1557 }
1558
1559
1560 type JobResponseListResult struct {
1561 autorest.Response `json:"-"`
1562
1563 Value *[]JobResponse `json:"value,omitempty"`
1564
1565 NextLink *string `json:"nextLink,omitempty"`
1566 }
1567
1568
1569 func (jrlr JobResponseListResult) MarshalJSON() ([]byte, error) {
1570 objectMap := make(map[string]interface{})
1571 if jrlr.Value != nil {
1572 objectMap["value"] = jrlr.Value
1573 }
1574 return json.Marshal(objectMap)
1575 }
1576
1577
1578 type JobResponseListResultIterator struct {
1579 i int
1580 page JobResponseListResultPage
1581 }
1582
1583
1584
1585 func (iter *JobResponseListResultIterator) NextWithContext(ctx context.Context) (err error) {
1586 if tracing.IsEnabled() {
1587 ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultIterator.NextWithContext")
1588 defer func() {
1589 sc := -1
1590 if iter.Response().Response.Response != nil {
1591 sc = iter.Response().Response.Response.StatusCode
1592 }
1593 tracing.EndSpan(ctx, sc, err)
1594 }()
1595 }
1596 iter.i++
1597 if iter.i < len(iter.page.Values()) {
1598 return nil
1599 }
1600 err = iter.page.NextWithContext(ctx)
1601 if err != nil {
1602 iter.i--
1603 return err
1604 }
1605 iter.i = 0
1606 return nil
1607 }
1608
1609
1610
1611
1612 func (iter *JobResponseListResultIterator) Next() error {
1613 return iter.NextWithContext(context.Background())
1614 }
1615
1616
1617 func (iter JobResponseListResultIterator) NotDone() bool {
1618 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1619 }
1620
1621
1622 func (iter JobResponseListResultIterator) Response() JobResponseListResult {
1623 return iter.page.Response()
1624 }
1625
1626
1627
1628 func (iter JobResponseListResultIterator) Value() JobResponse {
1629 if !iter.page.NotDone() {
1630 return JobResponse{}
1631 }
1632 return iter.page.Values()[iter.i]
1633 }
1634
1635
1636 func NewJobResponseListResultIterator(page JobResponseListResultPage) JobResponseListResultIterator {
1637 return JobResponseListResultIterator{page: page}
1638 }
1639
1640
1641 func (jrlr JobResponseListResult) IsEmpty() bool {
1642 return jrlr.Value == nil || len(*jrlr.Value) == 0
1643 }
1644
1645
1646 func (jrlr JobResponseListResult) hasNextLink() bool {
1647 return jrlr.NextLink != nil && len(*jrlr.NextLink) != 0
1648 }
1649
1650
1651
1652 func (jrlr JobResponseListResult) jobResponseListResultPreparer(ctx context.Context) (*http.Request, error) {
1653 if !jrlr.hasNextLink() {
1654 return nil, nil
1655 }
1656 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1657 autorest.AsJSON(),
1658 autorest.AsGet(),
1659 autorest.WithBaseURL(to.String(jrlr.NextLink)))
1660 }
1661
1662
1663 type JobResponseListResultPage struct {
1664 fn func(context.Context, JobResponseListResult) (JobResponseListResult, error)
1665 jrlr JobResponseListResult
1666 }
1667
1668
1669
1670 func (page *JobResponseListResultPage) NextWithContext(ctx context.Context) (err error) {
1671 if tracing.IsEnabled() {
1672 ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultPage.NextWithContext")
1673 defer func() {
1674 sc := -1
1675 if page.Response().Response.Response != nil {
1676 sc = page.Response().Response.Response.StatusCode
1677 }
1678 tracing.EndSpan(ctx, sc, err)
1679 }()
1680 }
1681 for {
1682 next, err := page.fn(ctx, page.jrlr)
1683 if err != nil {
1684 return err
1685 }
1686 page.jrlr = next
1687 if !next.hasNextLink() || !next.IsEmpty() {
1688 break
1689 }
1690 }
1691 return nil
1692 }
1693
1694
1695
1696
1697 func (page *JobResponseListResultPage) Next() error {
1698 return page.NextWithContext(context.Background())
1699 }
1700
1701
1702 func (page JobResponseListResultPage) NotDone() bool {
1703 return !page.jrlr.IsEmpty()
1704 }
1705
1706
1707 func (page JobResponseListResultPage) Response() JobResponseListResult {
1708 return page.jrlr
1709 }
1710
1711
1712 func (page JobResponseListResultPage) Values() []JobResponse {
1713 if page.jrlr.IsEmpty() {
1714 return nil
1715 }
1716 return *page.jrlr.Value
1717 }
1718
1719
1720 func NewJobResponseListResultPage(cur JobResponseListResult, getNextPage func(context.Context, JobResponseListResult) (JobResponseListResult, error)) JobResponseListResultPage {
1721 return JobResponseListResultPage{
1722 fn: getNextPage,
1723 jrlr: cur,
1724 }
1725 }
1726
1727
1728 type MatchedRoute struct {
1729
1730 Properties *RouteProperties `json:"properties,omitempty"`
1731 }
1732
1733
1734 type MessagingEndpointProperties struct {
1735
1736 LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"`
1737
1738 TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"`
1739
1740 MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
1741 }
1742
1743
1744 type Name struct {
1745
1746 Value *string `json:"value,omitempty"`
1747
1748 LocalizedValue *string `json:"localizedValue,omitempty"`
1749 }
1750
1751
1752 type Operation struct {
1753
1754 Name *string `json:"name,omitempty"`
1755
1756 Display *OperationDisplay `json:"display,omitempty"`
1757 }
1758
1759
1760 func (o Operation) MarshalJSON() ([]byte, error) {
1761 objectMap := make(map[string]interface{})
1762 if o.Display != nil {
1763 objectMap["display"] = o.Display
1764 }
1765 return json.Marshal(objectMap)
1766 }
1767
1768
1769 type OperationDisplay struct {
1770
1771 Provider *string `json:"provider,omitempty"`
1772
1773 Resource *string `json:"resource,omitempty"`
1774
1775 Operation *string `json:"operation,omitempty"`
1776
1777 Description *string `json:"description,omitempty"`
1778 }
1779
1780
1781 func (o OperationDisplay) MarshalJSON() ([]byte, error) {
1782 objectMap := make(map[string]interface{})
1783 return json.Marshal(objectMap)
1784 }
1785
1786
1787 type OperationInputs struct {
1788
1789 Name *string `json:"name,omitempty"`
1790 }
1791
1792
1793
1794 type OperationListResult struct {
1795 autorest.Response `json:"-"`
1796
1797 Value *[]Operation `json:"value,omitempty"`
1798
1799 NextLink *string `json:"nextLink,omitempty"`
1800 }
1801
1802
1803 func (olr OperationListResult) MarshalJSON() ([]byte, error) {
1804 objectMap := make(map[string]interface{})
1805 return json.Marshal(objectMap)
1806 }
1807
1808
1809 type OperationListResultIterator struct {
1810 i int
1811 page OperationListResultPage
1812 }
1813
1814
1815
1816 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1817 if tracing.IsEnabled() {
1818 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
1819 defer func() {
1820 sc := -1
1821 if iter.Response().Response.Response != nil {
1822 sc = iter.Response().Response.Response.StatusCode
1823 }
1824 tracing.EndSpan(ctx, sc, err)
1825 }()
1826 }
1827 iter.i++
1828 if iter.i < len(iter.page.Values()) {
1829 return nil
1830 }
1831 err = iter.page.NextWithContext(ctx)
1832 if err != nil {
1833 iter.i--
1834 return err
1835 }
1836 iter.i = 0
1837 return nil
1838 }
1839
1840
1841
1842
1843 func (iter *OperationListResultIterator) Next() error {
1844 return iter.NextWithContext(context.Background())
1845 }
1846
1847
1848 func (iter OperationListResultIterator) NotDone() bool {
1849 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1850 }
1851
1852
1853 func (iter OperationListResultIterator) Response() OperationListResult {
1854 return iter.page.Response()
1855 }
1856
1857
1858
1859 func (iter OperationListResultIterator) Value() Operation {
1860 if !iter.page.NotDone() {
1861 return Operation{}
1862 }
1863 return iter.page.Values()[iter.i]
1864 }
1865
1866
1867 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
1868 return OperationListResultIterator{page: page}
1869 }
1870
1871
1872 func (olr OperationListResult) IsEmpty() bool {
1873 return olr.Value == nil || len(*olr.Value) == 0
1874 }
1875
1876
1877 func (olr OperationListResult) hasNextLink() bool {
1878 return olr.NextLink != nil && len(*olr.NextLink) != 0
1879 }
1880
1881
1882
1883 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
1884 if !olr.hasNextLink() {
1885 return nil, nil
1886 }
1887 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1888 autorest.AsJSON(),
1889 autorest.AsGet(),
1890 autorest.WithBaseURL(to.String(olr.NextLink)))
1891 }
1892
1893
1894 type OperationListResultPage struct {
1895 fn func(context.Context, OperationListResult) (OperationListResult, error)
1896 olr OperationListResult
1897 }
1898
1899
1900
1901 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1902 if tracing.IsEnabled() {
1903 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
1904 defer func() {
1905 sc := -1
1906 if page.Response().Response.Response != nil {
1907 sc = page.Response().Response.Response.StatusCode
1908 }
1909 tracing.EndSpan(ctx, sc, err)
1910 }()
1911 }
1912 for {
1913 next, err := page.fn(ctx, page.olr)
1914 if err != nil {
1915 return err
1916 }
1917 page.olr = next
1918 if !next.hasNextLink() || !next.IsEmpty() {
1919 break
1920 }
1921 }
1922 return nil
1923 }
1924
1925
1926
1927
1928 func (page *OperationListResultPage) Next() error {
1929 return page.NextWithContext(context.Background())
1930 }
1931
1932
1933 func (page OperationListResultPage) NotDone() bool {
1934 return !page.olr.IsEmpty()
1935 }
1936
1937
1938 func (page OperationListResultPage) Response() OperationListResult {
1939 return page.olr
1940 }
1941
1942
1943 func (page OperationListResultPage) Values() []Operation {
1944 if page.olr.IsEmpty() {
1945 return nil
1946 }
1947 return *page.olr.Value
1948 }
1949
1950
1951 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
1952 return OperationListResultPage{
1953 fn: getNextPage,
1954 olr: cur,
1955 }
1956 }
1957
1958
1959 type RegistryStatistics struct {
1960 autorest.Response `json:"-"`
1961
1962 TotalDeviceCount *int64 `json:"totalDeviceCount,omitempty"`
1963
1964 EnabledDeviceCount *int64 `json:"enabledDeviceCount,omitempty"`
1965
1966 DisabledDeviceCount *int64 `json:"disabledDeviceCount,omitempty"`
1967 }
1968
1969
1970 func (rs RegistryStatistics) MarshalJSON() ([]byte, error) {
1971 objectMap := make(map[string]interface{})
1972 return json.Marshal(objectMap)
1973 }
1974
1975
1976 type Resource struct {
1977
1978 ID *string `json:"id,omitempty"`
1979
1980 Name *string `json:"name,omitempty"`
1981
1982 Type *string `json:"type,omitempty"`
1983
1984 Location *string `json:"location,omitempty"`
1985
1986 Tags map[string]*string `json:"tags"`
1987 }
1988
1989
1990 func (r Resource) MarshalJSON() ([]byte, error) {
1991 objectMap := make(map[string]interface{})
1992 if r.Location != nil {
1993 objectMap["location"] = r.Location
1994 }
1995 if r.Tags != nil {
1996 objectMap["tags"] = r.Tags
1997 }
1998 return json.Marshal(objectMap)
1999 }
2000
2001
2002 type RouteCompilationError struct {
2003
2004 Message *string `json:"message,omitempty"`
2005
2006 Severity RouteErrorSeverity `json:"severity,omitempty"`
2007
2008 Location *RouteErrorRange `json:"location,omitempty"`
2009 }
2010
2011
2012 type RouteErrorPosition struct {
2013
2014 Line *int32 `json:"line,omitempty"`
2015
2016 Column *int32 `json:"column,omitempty"`
2017 }
2018
2019
2020 type RouteErrorRange struct {
2021
2022 Start *RouteErrorPosition `json:"start,omitempty"`
2023
2024 End *RouteErrorPosition `json:"end,omitempty"`
2025 }
2026
2027
2028 type RouteProperties struct {
2029
2030 Name *string `json:"name,omitempty"`
2031
2032 Source RoutingSource `json:"source,omitempty"`
2033
2034 Condition *string `json:"condition,omitempty"`
2035
2036 EndpointNames *[]string `json:"endpointNames,omitempty"`
2037
2038 IsEnabled *bool `json:"isEnabled,omitempty"`
2039 }
2040
2041
2042
2043
2044 type RoutingEndpoints struct {
2045
2046 ServiceBusQueues *[]RoutingServiceBusQueueEndpointProperties `json:"serviceBusQueues,omitempty"`
2047
2048 ServiceBusTopics *[]RoutingServiceBusTopicEndpointProperties `json:"serviceBusTopics,omitempty"`
2049
2050 EventHubs *[]RoutingEventHubProperties `json:"eventHubs,omitempty"`
2051
2052 StorageContainers *[]RoutingStorageContainerProperties `json:"storageContainers,omitempty"`
2053 }
2054
2055
2056 type RoutingEventHubProperties struct {
2057
2058 ConnectionString *string `json:"connectionString,omitempty"`
2059
2060 Name *string `json:"name,omitempty"`
2061
2062 SubscriptionID *string `json:"subscriptionId,omitempty"`
2063
2064 ResourceGroup *string `json:"resourceGroup,omitempty"`
2065 }
2066
2067
2068 type RoutingMessage struct {
2069
2070 Body *string `json:"body,omitempty"`
2071
2072 AppProperties map[string]*string `json:"appProperties"`
2073
2074 SystemProperties map[string]*string `json:"systemProperties"`
2075 }
2076
2077
2078 func (rm RoutingMessage) MarshalJSON() ([]byte, error) {
2079 objectMap := make(map[string]interface{})
2080 if rm.Body != nil {
2081 objectMap["body"] = rm.Body
2082 }
2083 if rm.AppProperties != nil {
2084 objectMap["appProperties"] = rm.AppProperties
2085 }
2086 if rm.SystemProperties != nil {
2087 objectMap["systemProperties"] = rm.SystemProperties
2088 }
2089 return json.Marshal(objectMap)
2090 }
2091
2092
2093
2094 type RoutingProperties struct {
2095 Endpoints *RoutingEndpoints `json:"endpoints,omitempty"`
2096
2097 Routes *[]RouteProperties `json:"routes,omitempty"`
2098
2099 FallbackRoute *FallbackRouteProperties `json:"fallbackRoute,omitempty"`
2100
2101 Enrichments *[]EnrichmentProperties `json:"enrichments,omitempty"`
2102 }
2103
2104
2105 type RoutingServiceBusQueueEndpointProperties struct {
2106
2107 ConnectionString *string `json:"connectionString,omitempty"`
2108
2109 Name *string `json:"name,omitempty"`
2110
2111 SubscriptionID *string `json:"subscriptionId,omitempty"`
2112
2113 ResourceGroup *string `json:"resourceGroup,omitempty"`
2114 }
2115
2116
2117 type RoutingServiceBusTopicEndpointProperties struct {
2118
2119 ConnectionString *string `json:"connectionString,omitempty"`
2120
2121 Name *string `json:"name,omitempty"`
2122
2123 SubscriptionID *string `json:"subscriptionId,omitempty"`
2124
2125 ResourceGroup *string `json:"resourceGroup,omitempty"`
2126 }
2127
2128
2129 type RoutingStorageContainerProperties struct {
2130
2131 ConnectionString *string `json:"connectionString,omitempty"`
2132
2133 Name *string `json:"name,omitempty"`
2134
2135 SubscriptionID *string `json:"subscriptionId,omitempty"`
2136
2137 ResourceGroup *string `json:"resourceGroup,omitempty"`
2138
2139 ContainerName *string `json:"containerName,omitempty"`
2140
2141 FileNameFormat *string `json:"fileNameFormat,omitempty"`
2142
2143 BatchFrequencyInSeconds *int32 `json:"batchFrequencyInSeconds,omitempty"`
2144
2145 MaxChunkSizeInBytes *int32 `json:"maxChunkSizeInBytes,omitempty"`
2146
2147 Encoding Encoding `json:"encoding,omitempty"`
2148 }
2149
2150
2151 type RoutingTwin struct {
2152
2153 Tags interface{} `json:"tags,omitempty"`
2154 Properties *RoutingTwinProperties `json:"properties,omitempty"`
2155 }
2156
2157
2158 type RoutingTwinProperties struct {
2159
2160 Desired interface{} `json:"desired,omitempty"`
2161
2162 Reported interface{} `json:"reported,omitempty"`
2163 }
2164
2165
2166 type SetObject struct {
2167 autorest.Response `json:"-"`
2168 Value interface{} `json:"value,omitempty"`
2169 }
2170
2171
2172 type SharedAccessSignatureAuthorizationRule struct {
2173 autorest.Response `json:"-"`
2174
2175 KeyName *string `json:"keyName,omitempty"`
2176
2177 PrimaryKey *string `json:"primaryKey,omitempty"`
2178
2179 SecondaryKey *string `json:"secondaryKey,omitempty"`
2180
2181 Rights AccessRights `json:"rights,omitempty"`
2182 }
2183
2184
2185 type SharedAccessSignatureAuthorizationRuleListResult struct {
2186 autorest.Response `json:"-"`
2187
2188 Value *[]SharedAccessSignatureAuthorizationRule `json:"value,omitempty"`
2189
2190 NextLink *string `json:"nextLink,omitempty"`
2191 }
2192
2193
2194 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) {
2195 objectMap := make(map[string]interface{})
2196 if sasarlr.Value != nil {
2197 objectMap["value"] = sasarlr.Value
2198 }
2199 return json.Marshal(objectMap)
2200 }
2201
2202
2203
2204 type SharedAccessSignatureAuthorizationRuleListResultIterator struct {
2205 i int
2206 page SharedAccessSignatureAuthorizationRuleListResultPage
2207 }
2208
2209
2210
2211 func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
2212 if tracing.IsEnabled() {
2213 ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultIterator.NextWithContext")
2214 defer func() {
2215 sc := -1
2216 if iter.Response().Response.Response != nil {
2217 sc = iter.Response().Response.Response.StatusCode
2218 }
2219 tracing.EndSpan(ctx, sc, err)
2220 }()
2221 }
2222 iter.i++
2223 if iter.i < len(iter.page.Values()) {
2224 return nil
2225 }
2226 err = iter.page.NextWithContext(ctx)
2227 if err != nil {
2228 iter.i--
2229 return err
2230 }
2231 iter.i = 0
2232 return nil
2233 }
2234
2235
2236
2237
2238 func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) Next() error {
2239 return iter.NextWithContext(context.Background())
2240 }
2241
2242
2243 func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) NotDone() bool {
2244 return iter.page.NotDone() && iter.i < len(iter.page.Values())
2245 }
2246
2247
2248 func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Response() SharedAccessSignatureAuthorizationRuleListResult {
2249 return iter.page.Response()
2250 }
2251
2252
2253
2254 func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Value() SharedAccessSignatureAuthorizationRule {
2255 if !iter.page.NotDone() {
2256 return SharedAccessSignatureAuthorizationRule{}
2257 }
2258 return iter.page.Values()[iter.i]
2259 }
2260
2261
2262 func NewSharedAccessSignatureAuthorizationRuleListResultIterator(page SharedAccessSignatureAuthorizationRuleListResultPage) SharedAccessSignatureAuthorizationRuleListResultIterator {
2263 return SharedAccessSignatureAuthorizationRuleListResultIterator{page: page}
2264 }
2265
2266
2267 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) IsEmpty() bool {
2268 return sasarlr.Value == nil || len(*sasarlr.Value) == 0
2269 }
2270
2271
2272 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) hasNextLink() bool {
2273 return sasarlr.NextLink != nil && len(*sasarlr.NextLink) != 0
2274 }
2275
2276
2277
2278 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) sharedAccessSignatureAuthorizationRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
2279 if !sasarlr.hasNextLink() {
2280 return nil, nil
2281 }
2282 return autorest.Prepare((&http.Request{}).WithContext(ctx),
2283 autorest.AsJSON(),
2284 autorest.AsGet(),
2285 autorest.WithBaseURL(to.String(sasarlr.NextLink)))
2286 }
2287
2288
2289
2290 type SharedAccessSignatureAuthorizationRuleListResultPage struct {
2291 fn func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)
2292 sasarlr SharedAccessSignatureAuthorizationRuleListResult
2293 }
2294
2295
2296
2297 func (page *SharedAccessSignatureAuthorizationRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
2298 if tracing.IsEnabled() {
2299 ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultPage.NextWithContext")
2300 defer func() {
2301 sc := -1
2302 if page.Response().Response.Response != nil {
2303 sc = page.Response().Response.Response.StatusCode
2304 }
2305 tracing.EndSpan(ctx, sc, err)
2306 }()
2307 }
2308 for {
2309 next, err := page.fn(ctx, page.sasarlr)
2310 if err != nil {
2311 return err
2312 }
2313 page.sasarlr = next
2314 if !next.hasNextLink() || !next.IsEmpty() {
2315 break
2316 }
2317 }
2318 return nil
2319 }
2320
2321
2322
2323
2324 func (page *SharedAccessSignatureAuthorizationRuleListResultPage) Next() error {
2325 return page.NextWithContext(context.Background())
2326 }
2327
2328
2329 func (page SharedAccessSignatureAuthorizationRuleListResultPage) NotDone() bool {
2330 return !page.sasarlr.IsEmpty()
2331 }
2332
2333
2334 func (page SharedAccessSignatureAuthorizationRuleListResultPage) Response() SharedAccessSignatureAuthorizationRuleListResult {
2335 return page.sasarlr
2336 }
2337
2338
2339 func (page SharedAccessSignatureAuthorizationRuleListResultPage) Values() []SharedAccessSignatureAuthorizationRule {
2340 if page.sasarlr.IsEmpty() {
2341 return nil
2342 }
2343 return *page.sasarlr.Value
2344 }
2345
2346
2347 func NewSharedAccessSignatureAuthorizationRuleListResultPage(cur SharedAccessSignatureAuthorizationRuleListResult, getNextPage func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)) SharedAccessSignatureAuthorizationRuleListResultPage {
2348 return SharedAccessSignatureAuthorizationRuleListResultPage{
2349 fn: getNextPage,
2350 sasarlr: cur,
2351 }
2352 }
2353
2354
2355 type StorageEndpointProperties struct {
2356
2357 SasTTLAsIso8601 *string `json:"sasTtlAsIso8601,omitempty"`
2358
2359 ConnectionString *string `json:"connectionString,omitempty"`
2360
2361 ContainerName *string `json:"containerName,omitempty"`
2362 }
2363
2364
2365
2366 type TagsResource struct {
2367
2368 Tags map[string]*string `json:"tags"`
2369 }
2370
2371
2372 func (tr TagsResource) MarshalJSON() ([]byte, error) {
2373 objectMap := make(map[string]interface{})
2374 if tr.Tags != nil {
2375 objectMap["tags"] = tr.Tags
2376 }
2377 return json.Marshal(objectMap)
2378 }
2379
2380
2381 type TestAllRoutesInput struct {
2382
2383 RoutingSource RoutingSource `json:"routingSource,omitempty"`
2384
2385 Message *RoutingMessage `json:"message,omitempty"`
2386
2387 Twin *RoutingTwin `json:"twin,omitempty"`
2388 }
2389
2390
2391 type TestAllRoutesResult struct {
2392 autorest.Response `json:"-"`
2393
2394 Routes *[]MatchedRoute `json:"routes,omitempty"`
2395 }
2396
2397
2398 type TestRouteInput struct {
2399
2400 Message *RoutingMessage `json:"message,omitempty"`
2401
2402 Route *RouteProperties `json:"route,omitempty"`
2403
2404 Twin *RoutingTwin `json:"twin,omitempty"`
2405 }
2406
2407
2408 type TestRouteResult struct {
2409 autorest.Response `json:"-"`
2410
2411 Result TestResultStatus `json:"result,omitempty"`
2412
2413 Details *TestRouteResultDetails `json:"details,omitempty"`
2414 }
2415
2416
2417 type TestRouteResultDetails struct {
2418
2419 CompilationErrors *[]RouteCompilationError `json:"compilationErrors,omitempty"`
2420 }
2421
2422
2423 type UserSubscriptionQuota struct {
2424
2425 ID *string `json:"id,omitempty"`
2426
2427 Type *string `json:"type,omitempty"`
2428
2429 Unit *string `json:"unit,omitempty"`
2430
2431 CurrentValue *int32 `json:"currentValue,omitempty"`
2432
2433 Limit *int32 `json:"limit,omitempty"`
2434
2435 Name *Name `json:"name,omitempty"`
2436 }
2437
2438
2439 type UserSubscriptionQuotaListResult struct {
2440 autorest.Response `json:"-"`
2441 Value *[]UserSubscriptionQuota `json:"value,omitempty"`
2442
2443 NextLink *string `json:"nextLink,omitempty"`
2444 }
2445
2446
2447 func (usqlr UserSubscriptionQuotaListResult) MarshalJSON() ([]byte, error) {
2448 objectMap := make(map[string]interface{})
2449 if usqlr.Value != nil {
2450 objectMap["value"] = usqlr.Value
2451 }
2452 return json.Marshal(objectMap)
2453 }
2454
View as plain text