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/iothub/mgmt/2017-01-19/devices"
22
23
24 type CloudToDeviceProperties struct {
25
26 MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
27
28 DefaultTTLAsIso8601 *string `json:"defaultTtlAsIso8601,omitempty"`
29 Feedback *FeedbackProperties `json:"feedback,omitempty"`
30 }
31
32
33 type ErrorDetails struct {
34
35 Code *string `json:"Code,omitempty"`
36
37 HTTPStatusCode *string `json:"HttpStatusCode,omitempty"`
38
39 Message *string `json:"Message,omitempty"`
40
41 Details *string `json:"Details,omitempty"`
42 }
43
44
45 func (ed ErrorDetails) MarshalJSON() ([]byte, error) {
46 objectMap := make(map[string]interface{})
47 return json.Marshal(objectMap)
48 }
49
50
51 type EventHubConsumerGroupInfo struct {
52 autorest.Response `json:"-"`
53
54 Tags map[string]*string `json:"tags"`
55
56 ID *string `json:"id,omitempty"`
57
58 Name *string `json:"name,omitempty"`
59 }
60
61
62 func (ehcgi EventHubConsumerGroupInfo) MarshalJSON() ([]byte, error) {
63 objectMap := make(map[string]interface{})
64 if ehcgi.Tags != nil {
65 objectMap["tags"] = ehcgi.Tags
66 }
67 if ehcgi.ID != nil {
68 objectMap["id"] = ehcgi.ID
69 }
70 if ehcgi.Name != nil {
71 objectMap["name"] = ehcgi.Name
72 }
73 return json.Marshal(objectMap)
74 }
75
76
77
78 type EventHubConsumerGroupsListResult struct {
79 autorest.Response `json:"-"`
80
81 Value *[]string `json:"value,omitempty"`
82
83 NextLink *string `json:"nextLink,omitempty"`
84 }
85
86
87 func (ehcglr EventHubConsumerGroupsListResult) MarshalJSON() ([]byte, error) {
88 objectMap := make(map[string]interface{})
89 if ehcglr.Value != nil {
90 objectMap["value"] = ehcglr.Value
91 }
92 return json.Marshal(objectMap)
93 }
94
95
96 type EventHubConsumerGroupsListResultIterator struct {
97 i int
98 page EventHubConsumerGroupsListResultPage
99 }
100
101
102
103 func (iter *EventHubConsumerGroupsListResultIterator) NextWithContext(ctx context.Context) (err error) {
104 if tracing.IsEnabled() {
105 ctx = tracing.StartSpan(ctx, fqdn+"/EventHubConsumerGroupsListResultIterator.NextWithContext")
106 defer func() {
107 sc := -1
108 if iter.Response().Response.Response != nil {
109 sc = iter.Response().Response.Response.StatusCode
110 }
111 tracing.EndSpan(ctx, sc, err)
112 }()
113 }
114 iter.i++
115 if iter.i < len(iter.page.Values()) {
116 return nil
117 }
118 err = iter.page.NextWithContext(ctx)
119 if err != nil {
120 iter.i--
121 return err
122 }
123 iter.i = 0
124 return nil
125 }
126
127
128
129
130 func (iter *EventHubConsumerGroupsListResultIterator) Next() error {
131 return iter.NextWithContext(context.Background())
132 }
133
134
135 func (iter EventHubConsumerGroupsListResultIterator) NotDone() bool {
136 return iter.page.NotDone() && iter.i < len(iter.page.Values())
137 }
138
139
140 func (iter EventHubConsumerGroupsListResultIterator) Response() EventHubConsumerGroupsListResult {
141 return iter.page.Response()
142 }
143
144
145
146 func (iter EventHubConsumerGroupsListResultIterator) Value() string {
147 if !iter.page.NotDone() {
148 return ""
149 }
150 return iter.page.Values()[iter.i]
151 }
152
153
154 func NewEventHubConsumerGroupsListResultIterator(page EventHubConsumerGroupsListResultPage) EventHubConsumerGroupsListResultIterator {
155 return EventHubConsumerGroupsListResultIterator{page: page}
156 }
157
158
159 func (ehcglr EventHubConsumerGroupsListResult) IsEmpty() bool {
160 return ehcglr.Value == nil || len(*ehcglr.Value) == 0
161 }
162
163
164 func (ehcglr EventHubConsumerGroupsListResult) hasNextLink() bool {
165 return ehcglr.NextLink != nil && len(*ehcglr.NextLink) != 0
166 }
167
168
169
170 func (ehcglr EventHubConsumerGroupsListResult) eventHubConsumerGroupsListResultPreparer(ctx context.Context) (*http.Request, error) {
171 if !ehcglr.hasNextLink() {
172 return nil, nil
173 }
174 return autorest.Prepare((&http.Request{}).WithContext(ctx),
175 autorest.AsJSON(),
176 autorest.AsGet(),
177 autorest.WithBaseURL(to.String(ehcglr.NextLink)))
178 }
179
180
181 type EventHubConsumerGroupsListResultPage struct {
182 fn func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)
183 ehcglr EventHubConsumerGroupsListResult
184 }
185
186
187
188 func (page *EventHubConsumerGroupsListResultPage) NextWithContext(ctx context.Context) (err error) {
189 if tracing.IsEnabled() {
190 ctx = tracing.StartSpan(ctx, fqdn+"/EventHubConsumerGroupsListResultPage.NextWithContext")
191 defer func() {
192 sc := -1
193 if page.Response().Response.Response != nil {
194 sc = page.Response().Response.Response.StatusCode
195 }
196 tracing.EndSpan(ctx, sc, err)
197 }()
198 }
199 for {
200 next, err := page.fn(ctx, page.ehcglr)
201 if err != nil {
202 return err
203 }
204 page.ehcglr = next
205 if !next.hasNextLink() || !next.IsEmpty() {
206 break
207 }
208 }
209 return nil
210 }
211
212
213
214
215 func (page *EventHubConsumerGroupsListResultPage) Next() error {
216 return page.NextWithContext(context.Background())
217 }
218
219
220 func (page EventHubConsumerGroupsListResultPage) NotDone() bool {
221 return !page.ehcglr.IsEmpty()
222 }
223
224
225 func (page EventHubConsumerGroupsListResultPage) Response() EventHubConsumerGroupsListResult {
226 return page.ehcglr
227 }
228
229
230 func (page EventHubConsumerGroupsListResultPage) Values() []string {
231 if page.ehcglr.IsEmpty() {
232 return nil
233 }
234 return *page.ehcglr.Value
235 }
236
237
238 func NewEventHubConsumerGroupsListResultPage(cur EventHubConsumerGroupsListResult, getNextPage func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)) EventHubConsumerGroupsListResultPage {
239 return EventHubConsumerGroupsListResultPage{
240 fn: getNextPage,
241 ehcglr: cur,
242 }
243 }
244
245
246 type EventHubProperties struct {
247
248 RetentionTimeInDays *int64 `json:"retentionTimeInDays,omitempty"`
249
250 PartitionCount *int32 `json:"partitionCount,omitempty"`
251
252 PartitionIds *[]string `json:"partitionIds,omitempty"`
253
254 Path *string `json:"path,omitempty"`
255
256 Endpoint *string `json:"endpoint,omitempty"`
257 }
258
259
260 func (ehp EventHubProperties) MarshalJSON() ([]byte, error) {
261 objectMap := make(map[string]interface{})
262 if ehp.RetentionTimeInDays != nil {
263 objectMap["retentionTimeInDays"] = ehp.RetentionTimeInDays
264 }
265 if ehp.PartitionCount != nil {
266 objectMap["partitionCount"] = ehp.PartitionCount
267 }
268 return json.Marshal(objectMap)
269 }
270
271
272 type ExportDevicesRequest struct {
273
274 ExportBlobContainerURI *string `json:"ExportBlobContainerUri,omitempty"`
275
276 ExcludeKeys *bool `json:"ExcludeKeys,omitempty"`
277 }
278
279
280
281 type FallbackRouteProperties struct {
282
283 Source *string `json:"source,omitempty"`
284
285 Condition *string `json:"condition,omitempty"`
286
287 EndpointNames *[]string `json:"endpointNames,omitempty"`
288
289 IsEnabled *bool `json:"isEnabled,omitempty"`
290 }
291
292
293 type FeedbackProperties struct {
294
295 LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"`
296
297 TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"`
298
299 MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
300 }
301
302
303 type ImportDevicesRequest struct {
304
305 InputBlobContainerURI *string `json:"InputBlobContainerUri,omitempty"`
306
307 OutputBlobContainerURI *string `json:"OutputBlobContainerUri,omitempty"`
308 }
309
310
311 type IotHubCapacity struct {
312
313 Minimum *int64 `json:"minimum,omitempty"`
314
315 Maximum *int64 `json:"maximum,omitempty"`
316
317 Default *int64 `json:"default,omitempty"`
318
319 ScaleType IotHubScaleType `json:"scaleType,omitempty"`
320 }
321
322
323 func (ihc IotHubCapacity) MarshalJSON() ([]byte, error) {
324 objectMap := make(map[string]interface{})
325 return json.Marshal(objectMap)
326 }
327
328
329 type IotHubDescription struct {
330 autorest.Response `json:"-"`
331
332 Subscriptionid *string `json:"subscriptionid,omitempty"`
333
334 Resourcegroup *string `json:"resourcegroup,omitempty"`
335
336 Etag *string `json:"etag,omitempty"`
337 Properties *IotHubProperties `json:"properties,omitempty"`
338 Sku *IotHubSkuInfo `json:"sku,omitempty"`
339
340 ID *string `json:"id,omitempty"`
341
342 Name *string `json:"name,omitempty"`
343
344 Type *string `json:"type,omitempty"`
345
346 Location *string `json:"location,omitempty"`
347
348 Tags map[string]*string `json:"tags"`
349 }
350
351
352 func (ihd IotHubDescription) MarshalJSON() ([]byte, error) {
353 objectMap := make(map[string]interface{})
354 if ihd.Subscriptionid != nil {
355 objectMap["subscriptionid"] = ihd.Subscriptionid
356 }
357 if ihd.Resourcegroup != nil {
358 objectMap["resourcegroup"] = ihd.Resourcegroup
359 }
360 if ihd.Etag != nil {
361 objectMap["etag"] = ihd.Etag
362 }
363 if ihd.Properties != nil {
364 objectMap["properties"] = ihd.Properties
365 }
366 if ihd.Sku != nil {
367 objectMap["sku"] = ihd.Sku
368 }
369 if ihd.Location != nil {
370 objectMap["location"] = ihd.Location
371 }
372 if ihd.Tags != nil {
373 objectMap["tags"] = ihd.Tags
374 }
375 return json.Marshal(objectMap)
376 }
377
378
379 type IotHubDescriptionListResult struct {
380 autorest.Response `json:"-"`
381
382 Value *[]IotHubDescription `json:"value,omitempty"`
383
384 NextLink *string `json:"nextLink,omitempty"`
385 }
386
387
388 func (ihdlr IotHubDescriptionListResult) MarshalJSON() ([]byte, error) {
389 objectMap := make(map[string]interface{})
390 if ihdlr.Value != nil {
391 objectMap["value"] = ihdlr.Value
392 }
393 return json.Marshal(objectMap)
394 }
395
396
397 type IotHubDescriptionListResultIterator struct {
398 i int
399 page IotHubDescriptionListResultPage
400 }
401
402
403
404 func (iter *IotHubDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
405 if tracing.IsEnabled() {
406 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultIterator.NextWithContext")
407 defer func() {
408 sc := -1
409 if iter.Response().Response.Response != nil {
410 sc = iter.Response().Response.Response.StatusCode
411 }
412 tracing.EndSpan(ctx, sc, err)
413 }()
414 }
415 iter.i++
416 if iter.i < len(iter.page.Values()) {
417 return nil
418 }
419 err = iter.page.NextWithContext(ctx)
420 if err != nil {
421 iter.i--
422 return err
423 }
424 iter.i = 0
425 return nil
426 }
427
428
429
430
431 func (iter *IotHubDescriptionListResultIterator) Next() error {
432 return iter.NextWithContext(context.Background())
433 }
434
435
436 func (iter IotHubDescriptionListResultIterator) NotDone() bool {
437 return iter.page.NotDone() && iter.i < len(iter.page.Values())
438 }
439
440
441 func (iter IotHubDescriptionListResultIterator) Response() IotHubDescriptionListResult {
442 return iter.page.Response()
443 }
444
445
446
447 func (iter IotHubDescriptionListResultIterator) Value() IotHubDescription {
448 if !iter.page.NotDone() {
449 return IotHubDescription{}
450 }
451 return iter.page.Values()[iter.i]
452 }
453
454
455 func NewIotHubDescriptionListResultIterator(page IotHubDescriptionListResultPage) IotHubDescriptionListResultIterator {
456 return IotHubDescriptionListResultIterator{page: page}
457 }
458
459
460 func (ihdlr IotHubDescriptionListResult) IsEmpty() bool {
461 return ihdlr.Value == nil || len(*ihdlr.Value) == 0
462 }
463
464
465 func (ihdlr IotHubDescriptionListResult) hasNextLink() bool {
466 return ihdlr.NextLink != nil && len(*ihdlr.NextLink) != 0
467 }
468
469
470
471 func (ihdlr IotHubDescriptionListResult) iotHubDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
472 if !ihdlr.hasNextLink() {
473 return nil, nil
474 }
475 return autorest.Prepare((&http.Request{}).WithContext(ctx),
476 autorest.AsJSON(),
477 autorest.AsGet(),
478 autorest.WithBaseURL(to.String(ihdlr.NextLink)))
479 }
480
481
482 type IotHubDescriptionListResultPage struct {
483 fn func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)
484 ihdlr IotHubDescriptionListResult
485 }
486
487
488
489 func (page *IotHubDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
490 if tracing.IsEnabled() {
491 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultPage.NextWithContext")
492 defer func() {
493 sc := -1
494 if page.Response().Response.Response != nil {
495 sc = page.Response().Response.Response.StatusCode
496 }
497 tracing.EndSpan(ctx, sc, err)
498 }()
499 }
500 for {
501 next, err := page.fn(ctx, page.ihdlr)
502 if err != nil {
503 return err
504 }
505 page.ihdlr = next
506 if !next.hasNextLink() || !next.IsEmpty() {
507 break
508 }
509 }
510 return nil
511 }
512
513
514
515
516 func (page *IotHubDescriptionListResultPage) Next() error {
517 return page.NextWithContext(context.Background())
518 }
519
520
521 func (page IotHubDescriptionListResultPage) NotDone() bool {
522 return !page.ihdlr.IsEmpty()
523 }
524
525
526 func (page IotHubDescriptionListResultPage) Response() IotHubDescriptionListResult {
527 return page.ihdlr
528 }
529
530
531 func (page IotHubDescriptionListResultPage) Values() []IotHubDescription {
532 if page.ihdlr.IsEmpty() {
533 return nil
534 }
535 return *page.ihdlr.Value
536 }
537
538
539 func NewIotHubDescriptionListResultPage(cur IotHubDescriptionListResult, getNextPage func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)) IotHubDescriptionListResultPage {
540 return IotHubDescriptionListResultPage{
541 fn: getNextPage,
542 ihdlr: cur,
543 }
544 }
545
546
547 type IotHubNameAvailabilityInfo struct {
548 autorest.Response `json:"-"`
549
550 NameAvailable *bool `json:"nameAvailable,omitempty"`
551
552 Reason IotHubNameUnavailabilityReason `json:"reason,omitempty"`
553
554 Message *string `json:"message,omitempty"`
555 }
556
557
558 func (ihnai IotHubNameAvailabilityInfo) MarshalJSON() ([]byte, error) {
559 objectMap := make(map[string]interface{})
560 if ihnai.Message != nil {
561 objectMap["message"] = ihnai.Message
562 }
563 return json.Marshal(objectMap)
564 }
565
566
567 type IotHubProperties struct {
568
569 AuthorizationPolicies *[]SharedAccessSignatureAuthorizationRule `json:"authorizationPolicies,omitempty"`
570
571 IPFilterRules *[]IPFilterRule `json:"ipFilterRules,omitempty"`
572
573 ProvisioningState *string `json:"provisioningState,omitempty"`
574
575 HostName *string `json:"hostName,omitempty"`
576
577 EventHubEndpoints map[string]*EventHubProperties `json:"eventHubEndpoints"`
578 Routing *RoutingProperties `json:"routing,omitempty"`
579
580 StorageEndpoints map[string]*StorageEndpointProperties `json:"storageEndpoints"`
581
582 MessagingEndpoints map[string]*MessagingEndpointProperties `json:"messagingEndpoints"`
583
584 EnableFileUploadNotifications *bool `json:"enableFileUploadNotifications,omitempty"`
585 CloudToDevice *CloudToDeviceProperties `json:"cloudToDevice,omitempty"`
586
587 Comments *string `json:"comments,omitempty"`
588 OperationsMonitoringProperties *OperationsMonitoringProperties `json:"operationsMonitoringProperties,omitempty"`
589
590 Features Capabilities `json:"features,omitempty"`
591 }
592
593
594 func (ihp IotHubProperties) MarshalJSON() ([]byte, error) {
595 objectMap := make(map[string]interface{})
596 if ihp.AuthorizationPolicies != nil {
597 objectMap["authorizationPolicies"] = ihp.AuthorizationPolicies
598 }
599 if ihp.IPFilterRules != nil {
600 objectMap["ipFilterRules"] = ihp.IPFilterRules
601 }
602 if ihp.EventHubEndpoints != nil {
603 objectMap["eventHubEndpoints"] = ihp.EventHubEndpoints
604 }
605 if ihp.Routing != nil {
606 objectMap["routing"] = ihp.Routing
607 }
608 if ihp.StorageEndpoints != nil {
609 objectMap["storageEndpoints"] = ihp.StorageEndpoints
610 }
611 if ihp.MessagingEndpoints != nil {
612 objectMap["messagingEndpoints"] = ihp.MessagingEndpoints
613 }
614 if ihp.EnableFileUploadNotifications != nil {
615 objectMap["enableFileUploadNotifications"] = ihp.EnableFileUploadNotifications
616 }
617 if ihp.CloudToDevice != nil {
618 objectMap["cloudToDevice"] = ihp.CloudToDevice
619 }
620 if ihp.Comments != nil {
621 objectMap["comments"] = ihp.Comments
622 }
623 if ihp.OperationsMonitoringProperties != nil {
624 objectMap["operationsMonitoringProperties"] = ihp.OperationsMonitoringProperties
625 }
626 if ihp.Features != "" {
627 objectMap["features"] = ihp.Features
628 }
629 return json.Marshal(objectMap)
630 }
631
632
633 type IotHubQuotaMetricInfo struct {
634
635 Name *string `json:"Name,omitempty"`
636
637 CurrentValue *int64 `json:"CurrentValue,omitempty"`
638
639 MaxValue *int64 `json:"MaxValue,omitempty"`
640 }
641
642
643 func (ihqmi IotHubQuotaMetricInfo) MarshalJSON() ([]byte, error) {
644 objectMap := make(map[string]interface{})
645 return json.Marshal(objectMap)
646 }
647
648
649
650 type IotHubQuotaMetricInfoListResult struct {
651 autorest.Response `json:"-"`
652
653 Value *[]IotHubQuotaMetricInfo `json:"value,omitempty"`
654
655 NextLink *string `json:"nextLink,omitempty"`
656 }
657
658
659 func (ihqmilr IotHubQuotaMetricInfoListResult) MarshalJSON() ([]byte, error) {
660 objectMap := make(map[string]interface{})
661 if ihqmilr.Value != nil {
662 objectMap["value"] = ihqmilr.Value
663 }
664 return json.Marshal(objectMap)
665 }
666
667
668
669 type IotHubQuotaMetricInfoListResultIterator struct {
670 i int
671 page IotHubQuotaMetricInfoListResultPage
672 }
673
674
675
676 func (iter *IotHubQuotaMetricInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
677 if tracing.IsEnabled() {
678 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultIterator.NextWithContext")
679 defer func() {
680 sc := -1
681 if iter.Response().Response.Response != nil {
682 sc = iter.Response().Response.Response.StatusCode
683 }
684 tracing.EndSpan(ctx, sc, err)
685 }()
686 }
687 iter.i++
688 if iter.i < len(iter.page.Values()) {
689 return nil
690 }
691 err = iter.page.NextWithContext(ctx)
692 if err != nil {
693 iter.i--
694 return err
695 }
696 iter.i = 0
697 return nil
698 }
699
700
701
702
703 func (iter *IotHubQuotaMetricInfoListResultIterator) Next() error {
704 return iter.NextWithContext(context.Background())
705 }
706
707
708 func (iter IotHubQuotaMetricInfoListResultIterator) NotDone() bool {
709 return iter.page.NotDone() && iter.i < len(iter.page.Values())
710 }
711
712
713 func (iter IotHubQuotaMetricInfoListResultIterator) Response() IotHubQuotaMetricInfoListResult {
714 return iter.page.Response()
715 }
716
717
718
719 func (iter IotHubQuotaMetricInfoListResultIterator) Value() IotHubQuotaMetricInfo {
720 if !iter.page.NotDone() {
721 return IotHubQuotaMetricInfo{}
722 }
723 return iter.page.Values()[iter.i]
724 }
725
726
727 func NewIotHubQuotaMetricInfoListResultIterator(page IotHubQuotaMetricInfoListResultPage) IotHubQuotaMetricInfoListResultIterator {
728 return IotHubQuotaMetricInfoListResultIterator{page: page}
729 }
730
731
732 func (ihqmilr IotHubQuotaMetricInfoListResult) IsEmpty() bool {
733 return ihqmilr.Value == nil || len(*ihqmilr.Value) == 0
734 }
735
736
737 func (ihqmilr IotHubQuotaMetricInfoListResult) hasNextLink() bool {
738 return ihqmilr.NextLink != nil && len(*ihqmilr.NextLink) != 0
739 }
740
741
742
743 func (ihqmilr IotHubQuotaMetricInfoListResult) iotHubQuotaMetricInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
744 if !ihqmilr.hasNextLink() {
745 return nil, nil
746 }
747 return autorest.Prepare((&http.Request{}).WithContext(ctx),
748 autorest.AsJSON(),
749 autorest.AsGet(),
750 autorest.WithBaseURL(to.String(ihqmilr.NextLink)))
751 }
752
753
754 type IotHubQuotaMetricInfoListResultPage struct {
755 fn func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)
756 ihqmilr IotHubQuotaMetricInfoListResult
757 }
758
759
760
761 func (page *IotHubQuotaMetricInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
762 if tracing.IsEnabled() {
763 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultPage.NextWithContext")
764 defer func() {
765 sc := -1
766 if page.Response().Response.Response != nil {
767 sc = page.Response().Response.Response.StatusCode
768 }
769 tracing.EndSpan(ctx, sc, err)
770 }()
771 }
772 for {
773 next, err := page.fn(ctx, page.ihqmilr)
774 if err != nil {
775 return err
776 }
777 page.ihqmilr = next
778 if !next.hasNextLink() || !next.IsEmpty() {
779 break
780 }
781 }
782 return nil
783 }
784
785
786
787
788 func (page *IotHubQuotaMetricInfoListResultPage) Next() error {
789 return page.NextWithContext(context.Background())
790 }
791
792
793 func (page IotHubQuotaMetricInfoListResultPage) NotDone() bool {
794 return !page.ihqmilr.IsEmpty()
795 }
796
797
798 func (page IotHubQuotaMetricInfoListResultPage) Response() IotHubQuotaMetricInfoListResult {
799 return page.ihqmilr
800 }
801
802
803 func (page IotHubQuotaMetricInfoListResultPage) Values() []IotHubQuotaMetricInfo {
804 if page.ihqmilr.IsEmpty() {
805 return nil
806 }
807 return *page.ihqmilr.Value
808 }
809
810
811 func NewIotHubQuotaMetricInfoListResultPage(cur IotHubQuotaMetricInfoListResult, getNextPage func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)) IotHubQuotaMetricInfoListResultPage {
812 return IotHubQuotaMetricInfoListResultPage{
813 fn: getNextPage,
814 ihqmilr: cur,
815 }
816 }
817
818
819
820 type IotHubResourceCreateOrUpdateFuture struct {
821 azure.FutureAPI
822
823
824 Result func(IotHubResourceClient) (IotHubDescription, error)
825 }
826
827
828 func (future *IotHubResourceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
829 var azFuture azure.Future
830 if err := json.Unmarshal(body, &azFuture); err != nil {
831 return err
832 }
833 future.FutureAPI = &azFuture
834 future.Result = future.result
835 return nil
836 }
837
838
839 func (future *IotHubResourceCreateOrUpdateFuture) result(client IotHubResourceClient) (ihd IotHubDescription, err error) {
840 var done bool
841 done, err = future.DoneWithContext(context.Background(), client)
842 if err != nil {
843 err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
844 return
845 }
846 if !done {
847 ihd.Response.Response = future.Response()
848 err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceCreateOrUpdateFuture")
849 return
850 }
851 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
852 if ihd.Response.Response, err = future.GetResult(sender); err == nil && ihd.Response.Response.StatusCode != http.StatusNoContent {
853 ihd, err = client.CreateOrUpdateResponder(ihd.Response.Response)
854 if err != nil {
855 err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", ihd.Response.Response, "Failure responding to request")
856 }
857 }
858 return
859 }
860
861
862
863 type IotHubResourceDeleteFuture struct {
864 azure.FutureAPI
865
866
867 Result func(IotHubResourceClient) (SetObject, error)
868 }
869
870
871 func (future *IotHubResourceDeleteFuture) UnmarshalJSON(body []byte) error {
872 var azFuture azure.Future
873 if err := json.Unmarshal(body, &azFuture); err != nil {
874 return err
875 }
876 future.FutureAPI = &azFuture
877 future.Result = future.result
878 return nil
879 }
880
881
882 func (future *IotHubResourceDeleteFuture) result(client IotHubResourceClient) (so SetObject, err error) {
883 var done bool
884 done, err = future.DoneWithContext(context.Background(), client)
885 if err != nil {
886 err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", future.Response(), "Polling failure")
887 return
888 }
889 if !done {
890 so.Response.Response = future.Response()
891 err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceDeleteFuture")
892 return
893 }
894 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
895 if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
896 so, err = client.DeleteResponder(so.Response.Response)
897 if err != nil {
898 err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", so.Response.Response, "Failure responding to request")
899 }
900 }
901 return
902 }
903
904
905 type IotHubSkuDescription struct {
906
907 ResourceType *string `json:"resourceType,omitempty"`
908 Sku *IotHubSkuInfo `json:"sku,omitempty"`
909 Capacity *IotHubCapacity `json:"capacity,omitempty"`
910 }
911
912
913 func (ihsd IotHubSkuDescription) MarshalJSON() ([]byte, error) {
914 objectMap := make(map[string]interface{})
915 if ihsd.Sku != nil {
916 objectMap["sku"] = ihsd.Sku
917 }
918 if ihsd.Capacity != nil {
919 objectMap["capacity"] = ihsd.Capacity
920 }
921 return json.Marshal(objectMap)
922 }
923
924
925
926 type IotHubSkuDescriptionListResult struct {
927 autorest.Response `json:"-"`
928
929 Value *[]IotHubSkuDescription `json:"value,omitempty"`
930
931 NextLink *string `json:"nextLink,omitempty"`
932 }
933
934
935 func (ihsdlr IotHubSkuDescriptionListResult) MarshalJSON() ([]byte, error) {
936 objectMap := make(map[string]interface{})
937 if ihsdlr.Value != nil {
938 objectMap["value"] = ihsdlr.Value
939 }
940 return json.Marshal(objectMap)
941 }
942
943
944
945 type IotHubSkuDescriptionListResultIterator struct {
946 i int
947 page IotHubSkuDescriptionListResultPage
948 }
949
950
951
952 func (iter *IotHubSkuDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
953 if tracing.IsEnabled() {
954 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultIterator.NextWithContext")
955 defer func() {
956 sc := -1
957 if iter.Response().Response.Response != nil {
958 sc = iter.Response().Response.Response.StatusCode
959 }
960 tracing.EndSpan(ctx, sc, err)
961 }()
962 }
963 iter.i++
964 if iter.i < len(iter.page.Values()) {
965 return nil
966 }
967 err = iter.page.NextWithContext(ctx)
968 if err != nil {
969 iter.i--
970 return err
971 }
972 iter.i = 0
973 return nil
974 }
975
976
977
978
979 func (iter *IotHubSkuDescriptionListResultIterator) Next() error {
980 return iter.NextWithContext(context.Background())
981 }
982
983
984 func (iter IotHubSkuDescriptionListResultIterator) NotDone() bool {
985 return iter.page.NotDone() && iter.i < len(iter.page.Values())
986 }
987
988
989 func (iter IotHubSkuDescriptionListResultIterator) Response() IotHubSkuDescriptionListResult {
990 return iter.page.Response()
991 }
992
993
994
995 func (iter IotHubSkuDescriptionListResultIterator) Value() IotHubSkuDescription {
996 if !iter.page.NotDone() {
997 return IotHubSkuDescription{}
998 }
999 return iter.page.Values()[iter.i]
1000 }
1001
1002
1003 func NewIotHubSkuDescriptionListResultIterator(page IotHubSkuDescriptionListResultPage) IotHubSkuDescriptionListResultIterator {
1004 return IotHubSkuDescriptionListResultIterator{page: page}
1005 }
1006
1007
1008 func (ihsdlr IotHubSkuDescriptionListResult) IsEmpty() bool {
1009 return ihsdlr.Value == nil || len(*ihsdlr.Value) == 0
1010 }
1011
1012
1013 func (ihsdlr IotHubSkuDescriptionListResult) hasNextLink() bool {
1014 return ihsdlr.NextLink != nil && len(*ihsdlr.NextLink) != 0
1015 }
1016
1017
1018
1019 func (ihsdlr IotHubSkuDescriptionListResult) iotHubSkuDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
1020 if !ihsdlr.hasNextLink() {
1021 return nil, nil
1022 }
1023 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1024 autorest.AsJSON(),
1025 autorest.AsGet(),
1026 autorest.WithBaseURL(to.String(ihsdlr.NextLink)))
1027 }
1028
1029
1030 type IotHubSkuDescriptionListResultPage struct {
1031 fn func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)
1032 ihsdlr IotHubSkuDescriptionListResult
1033 }
1034
1035
1036
1037 func (page *IotHubSkuDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
1038 if tracing.IsEnabled() {
1039 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultPage.NextWithContext")
1040 defer func() {
1041 sc := -1
1042 if page.Response().Response.Response != nil {
1043 sc = page.Response().Response.Response.StatusCode
1044 }
1045 tracing.EndSpan(ctx, sc, err)
1046 }()
1047 }
1048 for {
1049 next, err := page.fn(ctx, page.ihsdlr)
1050 if err != nil {
1051 return err
1052 }
1053 page.ihsdlr = next
1054 if !next.hasNextLink() || !next.IsEmpty() {
1055 break
1056 }
1057 }
1058 return nil
1059 }
1060
1061
1062
1063
1064 func (page *IotHubSkuDescriptionListResultPage) Next() error {
1065 return page.NextWithContext(context.Background())
1066 }
1067
1068
1069 func (page IotHubSkuDescriptionListResultPage) NotDone() bool {
1070 return !page.ihsdlr.IsEmpty()
1071 }
1072
1073
1074 func (page IotHubSkuDescriptionListResultPage) Response() IotHubSkuDescriptionListResult {
1075 return page.ihsdlr
1076 }
1077
1078
1079 func (page IotHubSkuDescriptionListResultPage) Values() []IotHubSkuDescription {
1080 if page.ihsdlr.IsEmpty() {
1081 return nil
1082 }
1083 return *page.ihsdlr.Value
1084 }
1085
1086
1087 func NewIotHubSkuDescriptionListResultPage(cur IotHubSkuDescriptionListResult, getNextPage func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)) IotHubSkuDescriptionListResultPage {
1088 return IotHubSkuDescriptionListResultPage{
1089 fn: getNextPage,
1090 ihsdlr: cur,
1091 }
1092 }
1093
1094
1095 type IotHubSkuInfo struct {
1096
1097 Name IotHubSku `json:"name,omitempty"`
1098
1099 Tier IotHubSkuTier `json:"tier,omitempty"`
1100
1101 Capacity *int64 `json:"capacity,omitempty"`
1102 }
1103
1104
1105 func (ihsi IotHubSkuInfo) MarshalJSON() ([]byte, error) {
1106 objectMap := make(map[string]interface{})
1107 if ihsi.Name != "" {
1108 objectMap["name"] = ihsi.Name
1109 }
1110 if ihsi.Capacity != nil {
1111 objectMap["capacity"] = ihsi.Capacity
1112 }
1113 return json.Marshal(objectMap)
1114 }
1115
1116
1117 type IPFilterRule struct {
1118
1119 FilterName *string `json:"filterName,omitempty"`
1120
1121 Action IPFilterActionType `json:"action,omitempty"`
1122
1123 IPMask *string `json:"ipMask,omitempty"`
1124 }
1125
1126
1127 type JobResponse struct {
1128 autorest.Response `json:"-"`
1129
1130 JobID *string `json:"jobId,omitempty"`
1131
1132 StartTimeUtc *date.TimeRFC1123 `json:"startTimeUtc,omitempty"`
1133
1134 EndTimeUtc *date.TimeRFC1123 `json:"endTimeUtc,omitempty"`
1135
1136 Type JobType `json:"type,omitempty"`
1137
1138 Status JobStatus `json:"status,omitempty"`
1139
1140 FailureReason *string `json:"failureReason,omitempty"`
1141
1142 StatusMessage *string `json:"statusMessage,omitempty"`
1143
1144 ParentJobID *string `json:"parentJobId,omitempty"`
1145 }
1146
1147
1148 func (jr JobResponse) MarshalJSON() ([]byte, error) {
1149 objectMap := make(map[string]interface{})
1150 return json.Marshal(objectMap)
1151 }
1152
1153
1154 type JobResponseListResult struct {
1155 autorest.Response `json:"-"`
1156
1157 Value *[]JobResponse `json:"value,omitempty"`
1158
1159 NextLink *string `json:"nextLink,omitempty"`
1160 }
1161
1162
1163 func (jrlr JobResponseListResult) MarshalJSON() ([]byte, error) {
1164 objectMap := make(map[string]interface{})
1165 if jrlr.Value != nil {
1166 objectMap["value"] = jrlr.Value
1167 }
1168 return json.Marshal(objectMap)
1169 }
1170
1171
1172 type JobResponseListResultIterator struct {
1173 i int
1174 page JobResponseListResultPage
1175 }
1176
1177
1178
1179 func (iter *JobResponseListResultIterator) NextWithContext(ctx context.Context) (err error) {
1180 if tracing.IsEnabled() {
1181 ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultIterator.NextWithContext")
1182 defer func() {
1183 sc := -1
1184 if iter.Response().Response.Response != nil {
1185 sc = iter.Response().Response.Response.StatusCode
1186 }
1187 tracing.EndSpan(ctx, sc, err)
1188 }()
1189 }
1190 iter.i++
1191 if iter.i < len(iter.page.Values()) {
1192 return nil
1193 }
1194 err = iter.page.NextWithContext(ctx)
1195 if err != nil {
1196 iter.i--
1197 return err
1198 }
1199 iter.i = 0
1200 return nil
1201 }
1202
1203
1204
1205
1206 func (iter *JobResponseListResultIterator) Next() error {
1207 return iter.NextWithContext(context.Background())
1208 }
1209
1210
1211 func (iter JobResponseListResultIterator) NotDone() bool {
1212 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1213 }
1214
1215
1216 func (iter JobResponseListResultIterator) Response() JobResponseListResult {
1217 return iter.page.Response()
1218 }
1219
1220
1221
1222 func (iter JobResponseListResultIterator) Value() JobResponse {
1223 if !iter.page.NotDone() {
1224 return JobResponse{}
1225 }
1226 return iter.page.Values()[iter.i]
1227 }
1228
1229
1230 func NewJobResponseListResultIterator(page JobResponseListResultPage) JobResponseListResultIterator {
1231 return JobResponseListResultIterator{page: page}
1232 }
1233
1234
1235 func (jrlr JobResponseListResult) IsEmpty() bool {
1236 return jrlr.Value == nil || len(*jrlr.Value) == 0
1237 }
1238
1239
1240 func (jrlr JobResponseListResult) hasNextLink() bool {
1241 return jrlr.NextLink != nil && len(*jrlr.NextLink) != 0
1242 }
1243
1244
1245
1246 func (jrlr JobResponseListResult) jobResponseListResultPreparer(ctx context.Context) (*http.Request, error) {
1247 if !jrlr.hasNextLink() {
1248 return nil, nil
1249 }
1250 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1251 autorest.AsJSON(),
1252 autorest.AsGet(),
1253 autorest.WithBaseURL(to.String(jrlr.NextLink)))
1254 }
1255
1256
1257 type JobResponseListResultPage struct {
1258 fn func(context.Context, JobResponseListResult) (JobResponseListResult, error)
1259 jrlr JobResponseListResult
1260 }
1261
1262
1263
1264 func (page *JobResponseListResultPage) NextWithContext(ctx context.Context) (err error) {
1265 if tracing.IsEnabled() {
1266 ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultPage.NextWithContext")
1267 defer func() {
1268 sc := -1
1269 if page.Response().Response.Response != nil {
1270 sc = page.Response().Response.Response.StatusCode
1271 }
1272 tracing.EndSpan(ctx, sc, err)
1273 }()
1274 }
1275 for {
1276 next, err := page.fn(ctx, page.jrlr)
1277 if err != nil {
1278 return err
1279 }
1280 page.jrlr = next
1281 if !next.hasNextLink() || !next.IsEmpty() {
1282 break
1283 }
1284 }
1285 return nil
1286 }
1287
1288
1289
1290
1291 func (page *JobResponseListResultPage) Next() error {
1292 return page.NextWithContext(context.Background())
1293 }
1294
1295
1296 func (page JobResponseListResultPage) NotDone() bool {
1297 return !page.jrlr.IsEmpty()
1298 }
1299
1300
1301 func (page JobResponseListResultPage) Response() JobResponseListResult {
1302 return page.jrlr
1303 }
1304
1305
1306 func (page JobResponseListResultPage) Values() []JobResponse {
1307 if page.jrlr.IsEmpty() {
1308 return nil
1309 }
1310 return *page.jrlr.Value
1311 }
1312
1313
1314 func NewJobResponseListResultPage(cur JobResponseListResult, getNextPage func(context.Context, JobResponseListResult) (JobResponseListResult, error)) JobResponseListResultPage {
1315 return JobResponseListResultPage{
1316 fn: getNextPage,
1317 jrlr: cur,
1318 }
1319 }
1320
1321
1322 type MessagingEndpointProperties struct {
1323
1324 LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"`
1325
1326 TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"`
1327
1328 MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
1329 }
1330
1331
1332 type OperationInputs struct {
1333
1334 Name *string `json:"Name,omitempty"`
1335 }
1336
1337
1338
1339
1340
1341 type OperationsMonitoringProperties struct {
1342 Events map[string]*OperationMonitoringLevel `json:"events"`
1343 }
1344
1345
1346 func (omp OperationsMonitoringProperties) MarshalJSON() ([]byte, error) {
1347 objectMap := make(map[string]interface{})
1348 if omp.Events != nil {
1349 objectMap["events"] = omp.Events
1350 }
1351 return json.Marshal(objectMap)
1352 }
1353
1354
1355 type RegistryStatistics struct {
1356 autorest.Response `json:"-"`
1357
1358 TotalDeviceCount *int64 `json:"totalDeviceCount,omitempty"`
1359
1360 EnabledDeviceCount *int64 `json:"enabledDeviceCount,omitempty"`
1361
1362 DisabledDeviceCount *int64 `json:"disabledDeviceCount,omitempty"`
1363 }
1364
1365
1366 func (rs RegistryStatistics) MarshalJSON() ([]byte, error) {
1367 objectMap := make(map[string]interface{})
1368 return json.Marshal(objectMap)
1369 }
1370
1371
1372 type Resource struct {
1373
1374 ID *string `json:"id,omitempty"`
1375
1376 Name *string `json:"name,omitempty"`
1377
1378 Type *string `json:"type,omitempty"`
1379
1380 Location *string `json:"location,omitempty"`
1381
1382 Tags map[string]*string `json:"tags"`
1383 }
1384
1385
1386 func (r Resource) MarshalJSON() ([]byte, error) {
1387 objectMap := make(map[string]interface{})
1388 if r.Location != nil {
1389 objectMap["location"] = r.Location
1390 }
1391 if r.Tags != nil {
1392 objectMap["tags"] = r.Tags
1393 }
1394 return json.Marshal(objectMap)
1395 }
1396
1397
1398 type RouteProperties struct {
1399
1400 Name *string `json:"name,omitempty"`
1401
1402 Source RoutingSource `json:"source,omitempty"`
1403
1404 Condition *string `json:"condition,omitempty"`
1405
1406 EndpointNames *[]string `json:"endpointNames,omitempty"`
1407
1408 IsEnabled *bool `json:"isEnabled,omitempty"`
1409 }
1410
1411
1412
1413
1414 type RoutingEndpoints struct {
1415
1416 ServiceBusQueues *[]RoutingServiceBusQueueEndpointProperties `json:"serviceBusQueues,omitempty"`
1417
1418 ServiceBusTopics *[]RoutingServiceBusTopicEndpointProperties `json:"serviceBusTopics,omitempty"`
1419
1420 EventHubs *[]RoutingEventHubProperties `json:"eventHubs,omitempty"`
1421 }
1422
1423
1424 type RoutingEventHubProperties struct {
1425
1426 ConnectionString *string `json:"connectionString,omitempty"`
1427
1428 Name *string `json:"name,omitempty"`
1429
1430 SubscriptionID *string `json:"subscriptionId,omitempty"`
1431
1432 ResourceGroup *string `json:"resourceGroup,omitempty"`
1433 }
1434
1435
1436
1437 type RoutingProperties struct {
1438 Endpoints *RoutingEndpoints `json:"endpoints,omitempty"`
1439
1440 Routes *[]RouteProperties `json:"routes,omitempty"`
1441
1442 FallbackRoute *FallbackRouteProperties `json:"fallbackRoute,omitempty"`
1443 }
1444
1445
1446 type RoutingServiceBusQueueEndpointProperties struct {
1447
1448 ConnectionString *string `json:"connectionString,omitempty"`
1449
1450 Name *string `json:"name,omitempty"`
1451
1452 SubscriptionID *string `json:"subscriptionId,omitempty"`
1453
1454 ResourceGroup *string `json:"resourceGroup,omitempty"`
1455 }
1456
1457
1458 type RoutingServiceBusTopicEndpointProperties struct {
1459
1460 ConnectionString *string `json:"connectionString,omitempty"`
1461
1462 Name *string `json:"name,omitempty"`
1463
1464 SubscriptionID *string `json:"subscriptionId,omitempty"`
1465
1466 ResourceGroup *string `json:"resourceGroup,omitempty"`
1467 }
1468
1469
1470 type SetObject struct {
1471 autorest.Response `json:"-"`
1472 Value interface{} `json:"value,omitempty"`
1473 }
1474
1475
1476 type SharedAccessSignatureAuthorizationRule struct {
1477 autorest.Response `json:"-"`
1478
1479 KeyName *string `json:"keyName,omitempty"`
1480
1481 PrimaryKey *string `json:"primaryKey,omitempty"`
1482
1483 SecondaryKey *string `json:"secondaryKey,omitempty"`
1484
1485 Rights AccessRights `json:"rights,omitempty"`
1486 }
1487
1488
1489 type SharedAccessSignatureAuthorizationRuleListResult struct {
1490 autorest.Response `json:"-"`
1491
1492 Value *[]SharedAccessSignatureAuthorizationRule `json:"value,omitempty"`
1493
1494 NextLink *string `json:"nextLink,omitempty"`
1495 }
1496
1497
1498 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) {
1499 objectMap := make(map[string]interface{})
1500 if sasarlr.Value != nil {
1501 objectMap["value"] = sasarlr.Value
1502 }
1503 return json.Marshal(objectMap)
1504 }
1505
1506
1507
1508 type SharedAccessSignatureAuthorizationRuleListResultIterator struct {
1509 i int
1510 page SharedAccessSignatureAuthorizationRuleListResultPage
1511 }
1512
1513
1514
1515 func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
1516 if tracing.IsEnabled() {
1517 ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultIterator.NextWithContext")
1518 defer func() {
1519 sc := -1
1520 if iter.Response().Response.Response != nil {
1521 sc = iter.Response().Response.Response.StatusCode
1522 }
1523 tracing.EndSpan(ctx, sc, err)
1524 }()
1525 }
1526 iter.i++
1527 if iter.i < len(iter.page.Values()) {
1528 return nil
1529 }
1530 err = iter.page.NextWithContext(ctx)
1531 if err != nil {
1532 iter.i--
1533 return err
1534 }
1535 iter.i = 0
1536 return nil
1537 }
1538
1539
1540
1541
1542 func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) Next() error {
1543 return iter.NextWithContext(context.Background())
1544 }
1545
1546
1547 func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) NotDone() bool {
1548 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1549 }
1550
1551
1552 func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Response() SharedAccessSignatureAuthorizationRuleListResult {
1553 return iter.page.Response()
1554 }
1555
1556
1557
1558 func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Value() SharedAccessSignatureAuthorizationRule {
1559 if !iter.page.NotDone() {
1560 return SharedAccessSignatureAuthorizationRule{}
1561 }
1562 return iter.page.Values()[iter.i]
1563 }
1564
1565
1566 func NewSharedAccessSignatureAuthorizationRuleListResultIterator(page SharedAccessSignatureAuthorizationRuleListResultPage) SharedAccessSignatureAuthorizationRuleListResultIterator {
1567 return SharedAccessSignatureAuthorizationRuleListResultIterator{page: page}
1568 }
1569
1570
1571 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) IsEmpty() bool {
1572 return sasarlr.Value == nil || len(*sasarlr.Value) == 0
1573 }
1574
1575
1576 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) hasNextLink() bool {
1577 return sasarlr.NextLink != nil && len(*sasarlr.NextLink) != 0
1578 }
1579
1580
1581
1582 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) sharedAccessSignatureAuthorizationRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
1583 if !sasarlr.hasNextLink() {
1584 return nil, nil
1585 }
1586 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1587 autorest.AsJSON(),
1588 autorest.AsGet(),
1589 autorest.WithBaseURL(to.String(sasarlr.NextLink)))
1590 }
1591
1592
1593
1594 type SharedAccessSignatureAuthorizationRuleListResultPage struct {
1595 fn func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)
1596 sasarlr SharedAccessSignatureAuthorizationRuleListResult
1597 }
1598
1599
1600
1601 func (page *SharedAccessSignatureAuthorizationRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
1602 if tracing.IsEnabled() {
1603 ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultPage.NextWithContext")
1604 defer func() {
1605 sc := -1
1606 if page.Response().Response.Response != nil {
1607 sc = page.Response().Response.Response.StatusCode
1608 }
1609 tracing.EndSpan(ctx, sc, err)
1610 }()
1611 }
1612 for {
1613 next, err := page.fn(ctx, page.sasarlr)
1614 if err != nil {
1615 return err
1616 }
1617 page.sasarlr = next
1618 if !next.hasNextLink() || !next.IsEmpty() {
1619 break
1620 }
1621 }
1622 return nil
1623 }
1624
1625
1626
1627
1628 func (page *SharedAccessSignatureAuthorizationRuleListResultPage) Next() error {
1629 return page.NextWithContext(context.Background())
1630 }
1631
1632
1633 func (page SharedAccessSignatureAuthorizationRuleListResultPage) NotDone() bool {
1634 return !page.sasarlr.IsEmpty()
1635 }
1636
1637
1638 func (page SharedAccessSignatureAuthorizationRuleListResultPage) Response() SharedAccessSignatureAuthorizationRuleListResult {
1639 return page.sasarlr
1640 }
1641
1642
1643 func (page SharedAccessSignatureAuthorizationRuleListResultPage) Values() []SharedAccessSignatureAuthorizationRule {
1644 if page.sasarlr.IsEmpty() {
1645 return nil
1646 }
1647 return *page.sasarlr.Value
1648 }
1649
1650
1651 func NewSharedAccessSignatureAuthorizationRuleListResultPage(cur SharedAccessSignatureAuthorizationRuleListResult, getNextPage func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)) SharedAccessSignatureAuthorizationRuleListResultPage {
1652 return SharedAccessSignatureAuthorizationRuleListResultPage{
1653 fn: getNextPage,
1654 sasarlr: cur,
1655 }
1656 }
1657
1658
1659 type StorageEndpointProperties struct {
1660
1661 SasTTLAsIso8601 *string `json:"sasTtlAsIso8601,omitempty"`
1662
1663 ConnectionString *string `json:"connectionString,omitempty"`
1664
1665 ContainerName *string `json:"containerName,omitempty"`
1666 }
1667
View as plain text