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/2016-02-03/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 type FeedbackProperties struct {
281
282 LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"`
283
284 TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"`
285
286 MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
287 }
288
289
290 type ImportDevicesRequest struct {
291
292 InputBlobContainerURI *string `json:"InputBlobContainerUri,omitempty"`
293
294 OutputBlobContainerURI *string `json:"OutputBlobContainerUri,omitempty"`
295 }
296
297
298 type IotHubCapacity struct {
299
300 Minimum *int64 `json:"minimum,omitempty"`
301
302 Maximum *int64 `json:"maximum,omitempty"`
303
304 Default *int64 `json:"default,omitempty"`
305
306 ScaleType IotHubScaleType `json:"scaleType,omitempty"`
307 }
308
309
310 func (ihc IotHubCapacity) MarshalJSON() ([]byte, error) {
311 objectMap := make(map[string]interface{})
312 return json.Marshal(objectMap)
313 }
314
315
316 type IotHubDescription struct {
317 autorest.Response `json:"-"`
318
319 Subscriptionid *string `json:"subscriptionid,omitempty"`
320
321 Resourcegroup *string `json:"resourcegroup,omitempty"`
322
323 Etag *string `json:"etag,omitempty"`
324 Properties *IotHubProperties `json:"properties,omitempty"`
325 Sku *IotHubSkuInfo `json:"sku,omitempty"`
326
327 ID *string `json:"id,omitempty"`
328
329 Name *string `json:"name,omitempty"`
330
331 Type *string `json:"type,omitempty"`
332
333 Location *string `json:"location,omitempty"`
334
335 Tags map[string]*string `json:"tags"`
336 }
337
338
339 func (ihd IotHubDescription) MarshalJSON() ([]byte, error) {
340 objectMap := make(map[string]interface{})
341 if ihd.Subscriptionid != nil {
342 objectMap["subscriptionid"] = ihd.Subscriptionid
343 }
344 if ihd.Resourcegroup != nil {
345 objectMap["resourcegroup"] = ihd.Resourcegroup
346 }
347 if ihd.Etag != nil {
348 objectMap["etag"] = ihd.Etag
349 }
350 if ihd.Properties != nil {
351 objectMap["properties"] = ihd.Properties
352 }
353 if ihd.Sku != nil {
354 objectMap["sku"] = ihd.Sku
355 }
356 if ihd.Location != nil {
357 objectMap["location"] = ihd.Location
358 }
359 if ihd.Tags != nil {
360 objectMap["tags"] = ihd.Tags
361 }
362 return json.Marshal(objectMap)
363 }
364
365
366 type IotHubDescriptionListResult struct {
367 autorest.Response `json:"-"`
368
369 Value *[]IotHubDescription `json:"value,omitempty"`
370
371 NextLink *string `json:"nextLink,omitempty"`
372 }
373
374
375 func (ihdlr IotHubDescriptionListResult) MarshalJSON() ([]byte, error) {
376 objectMap := make(map[string]interface{})
377 if ihdlr.Value != nil {
378 objectMap["value"] = ihdlr.Value
379 }
380 return json.Marshal(objectMap)
381 }
382
383
384 type IotHubDescriptionListResultIterator struct {
385 i int
386 page IotHubDescriptionListResultPage
387 }
388
389
390
391 func (iter *IotHubDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
392 if tracing.IsEnabled() {
393 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultIterator.NextWithContext")
394 defer func() {
395 sc := -1
396 if iter.Response().Response.Response != nil {
397 sc = iter.Response().Response.Response.StatusCode
398 }
399 tracing.EndSpan(ctx, sc, err)
400 }()
401 }
402 iter.i++
403 if iter.i < len(iter.page.Values()) {
404 return nil
405 }
406 err = iter.page.NextWithContext(ctx)
407 if err != nil {
408 iter.i--
409 return err
410 }
411 iter.i = 0
412 return nil
413 }
414
415
416
417
418 func (iter *IotHubDescriptionListResultIterator) Next() error {
419 return iter.NextWithContext(context.Background())
420 }
421
422
423 func (iter IotHubDescriptionListResultIterator) NotDone() bool {
424 return iter.page.NotDone() && iter.i < len(iter.page.Values())
425 }
426
427
428 func (iter IotHubDescriptionListResultIterator) Response() IotHubDescriptionListResult {
429 return iter.page.Response()
430 }
431
432
433
434 func (iter IotHubDescriptionListResultIterator) Value() IotHubDescription {
435 if !iter.page.NotDone() {
436 return IotHubDescription{}
437 }
438 return iter.page.Values()[iter.i]
439 }
440
441
442 func NewIotHubDescriptionListResultIterator(page IotHubDescriptionListResultPage) IotHubDescriptionListResultIterator {
443 return IotHubDescriptionListResultIterator{page: page}
444 }
445
446
447 func (ihdlr IotHubDescriptionListResult) IsEmpty() bool {
448 return ihdlr.Value == nil || len(*ihdlr.Value) == 0
449 }
450
451
452 func (ihdlr IotHubDescriptionListResult) hasNextLink() bool {
453 return ihdlr.NextLink != nil && len(*ihdlr.NextLink) != 0
454 }
455
456
457
458 func (ihdlr IotHubDescriptionListResult) iotHubDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
459 if !ihdlr.hasNextLink() {
460 return nil, nil
461 }
462 return autorest.Prepare((&http.Request{}).WithContext(ctx),
463 autorest.AsJSON(),
464 autorest.AsGet(),
465 autorest.WithBaseURL(to.String(ihdlr.NextLink)))
466 }
467
468
469 type IotHubDescriptionListResultPage struct {
470 fn func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)
471 ihdlr IotHubDescriptionListResult
472 }
473
474
475
476 func (page *IotHubDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
477 if tracing.IsEnabled() {
478 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultPage.NextWithContext")
479 defer func() {
480 sc := -1
481 if page.Response().Response.Response != nil {
482 sc = page.Response().Response.Response.StatusCode
483 }
484 tracing.EndSpan(ctx, sc, err)
485 }()
486 }
487 for {
488 next, err := page.fn(ctx, page.ihdlr)
489 if err != nil {
490 return err
491 }
492 page.ihdlr = next
493 if !next.hasNextLink() || !next.IsEmpty() {
494 break
495 }
496 }
497 return nil
498 }
499
500
501
502
503 func (page *IotHubDescriptionListResultPage) Next() error {
504 return page.NextWithContext(context.Background())
505 }
506
507
508 func (page IotHubDescriptionListResultPage) NotDone() bool {
509 return !page.ihdlr.IsEmpty()
510 }
511
512
513 func (page IotHubDescriptionListResultPage) Response() IotHubDescriptionListResult {
514 return page.ihdlr
515 }
516
517
518 func (page IotHubDescriptionListResultPage) Values() []IotHubDescription {
519 if page.ihdlr.IsEmpty() {
520 return nil
521 }
522 return *page.ihdlr.Value
523 }
524
525
526 func NewIotHubDescriptionListResultPage(cur IotHubDescriptionListResult, getNextPage func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)) IotHubDescriptionListResultPage {
527 return IotHubDescriptionListResultPage{
528 fn: getNextPage,
529 ihdlr: cur,
530 }
531 }
532
533
534 type IotHubNameAvailabilityInfo struct {
535 autorest.Response `json:"-"`
536
537 NameAvailable *bool `json:"nameAvailable,omitempty"`
538
539 Reason IotHubNameUnavailabilityReason `json:"reason,omitempty"`
540
541 Message *string `json:"message,omitempty"`
542 }
543
544
545 func (ihnai IotHubNameAvailabilityInfo) MarshalJSON() ([]byte, error) {
546 objectMap := make(map[string]interface{})
547 if ihnai.Message != nil {
548 objectMap["message"] = ihnai.Message
549 }
550 return json.Marshal(objectMap)
551 }
552
553
554 type IotHubProperties struct {
555
556 AuthorizationPolicies *[]SharedAccessSignatureAuthorizationRule `json:"authorizationPolicies,omitempty"`
557
558 IPFilterRules *[]IPFilterRule `json:"ipFilterRules,omitempty"`
559
560 ProvisioningState *string `json:"provisioningState,omitempty"`
561
562 HostName *string `json:"hostName,omitempty"`
563
564 EventHubEndpoints map[string]*EventHubProperties `json:"eventHubEndpoints"`
565
566 StorageEndpoints map[string]*StorageEndpointProperties `json:"storageEndpoints"`
567
568 MessagingEndpoints map[string]*MessagingEndpointProperties `json:"messagingEndpoints"`
569
570 EnableFileUploadNotifications *bool `json:"enableFileUploadNotifications,omitempty"`
571 CloudToDevice *CloudToDeviceProperties `json:"cloudToDevice,omitempty"`
572
573 Comments *string `json:"comments,omitempty"`
574 OperationsMonitoringProperties *OperationsMonitoringProperties `json:"operationsMonitoringProperties,omitempty"`
575
576 Features Capabilities `json:"features,omitempty"`
577 }
578
579
580 func (ihp IotHubProperties) MarshalJSON() ([]byte, error) {
581 objectMap := make(map[string]interface{})
582 if ihp.AuthorizationPolicies != nil {
583 objectMap["authorizationPolicies"] = ihp.AuthorizationPolicies
584 }
585 if ihp.IPFilterRules != nil {
586 objectMap["ipFilterRules"] = ihp.IPFilterRules
587 }
588 if ihp.EventHubEndpoints != nil {
589 objectMap["eventHubEndpoints"] = ihp.EventHubEndpoints
590 }
591 if ihp.StorageEndpoints != nil {
592 objectMap["storageEndpoints"] = ihp.StorageEndpoints
593 }
594 if ihp.MessagingEndpoints != nil {
595 objectMap["messagingEndpoints"] = ihp.MessagingEndpoints
596 }
597 if ihp.EnableFileUploadNotifications != nil {
598 objectMap["enableFileUploadNotifications"] = ihp.EnableFileUploadNotifications
599 }
600 if ihp.CloudToDevice != nil {
601 objectMap["cloudToDevice"] = ihp.CloudToDevice
602 }
603 if ihp.Comments != nil {
604 objectMap["comments"] = ihp.Comments
605 }
606 if ihp.OperationsMonitoringProperties != nil {
607 objectMap["operationsMonitoringProperties"] = ihp.OperationsMonitoringProperties
608 }
609 if ihp.Features != "" {
610 objectMap["features"] = ihp.Features
611 }
612 return json.Marshal(objectMap)
613 }
614
615
616 type IotHubQuotaMetricInfo struct {
617
618 Name *string `json:"Name,omitempty"`
619
620 CurrentValue *int64 `json:"CurrentValue,omitempty"`
621
622 MaxValue *int64 `json:"MaxValue,omitempty"`
623 }
624
625
626 func (ihqmi IotHubQuotaMetricInfo) MarshalJSON() ([]byte, error) {
627 objectMap := make(map[string]interface{})
628 return json.Marshal(objectMap)
629 }
630
631
632
633 type IotHubQuotaMetricInfoListResult struct {
634 autorest.Response `json:"-"`
635
636 Value *[]IotHubQuotaMetricInfo `json:"value,omitempty"`
637
638 NextLink *string `json:"nextLink,omitempty"`
639 }
640
641
642 func (ihqmilr IotHubQuotaMetricInfoListResult) MarshalJSON() ([]byte, error) {
643 objectMap := make(map[string]interface{})
644 if ihqmilr.Value != nil {
645 objectMap["value"] = ihqmilr.Value
646 }
647 return json.Marshal(objectMap)
648 }
649
650
651
652 type IotHubQuotaMetricInfoListResultIterator struct {
653 i int
654 page IotHubQuotaMetricInfoListResultPage
655 }
656
657
658
659 func (iter *IotHubQuotaMetricInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
660 if tracing.IsEnabled() {
661 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultIterator.NextWithContext")
662 defer func() {
663 sc := -1
664 if iter.Response().Response.Response != nil {
665 sc = iter.Response().Response.Response.StatusCode
666 }
667 tracing.EndSpan(ctx, sc, err)
668 }()
669 }
670 iter.i++
671 if iter.i < len(iter.page.Values()) {
672 return nil
673 }
674 err = iter.page.NextWithContext(ctx)
675 if err != nil {
676 iter.i--
677 return err
678 }
679 iter.i = 0
680 return nil
681 }
682
683
684
685
686 func (iter *IotHubQuotaMetricInfoListResultIterator) Next() error {
687 return iter.NextWithContext(context.Background())
688 }
689
690
691 func (iter IotHubQuotaMetricInfoListResultIterator) NotDone() bool {
692 return iter.page.NotDone() && iter.i < len(iter.page.Values())
693 }
694
695
696 func (iter IotHubQuotaMetricInfoListResultIterator) Response() IotHubQuotaMetricInfoListResult {
697 return iter.page.Response()
698 }
699
700
701
702 func (iter IotHubQuotaMetricInfoListResultIterator) Value() IotHubQuotaMetricInfo {
703 if !iter.page.NotDone() {
704 return IotHubQuotaMetricInfo{}
705 }
706 return iter.page.Values()[iter.i]
707 }
708
709
710 func NewIotHubQuotaMetricInfoListResultIterator(page IotHubQuotaMetricInfoListResultPage) IotHubQuotaMetricInfoListResultIterator {
711 return IotHubQuotaMetricInfoListResultIterator{page: page}
712 }
713
714
715 func (ihqmilr IotHubQuotaMetricInfoListResult) IsEmpty() bool {
716 return ihqmilr.Value == nil || len(*ihqmilr.Value) == 0
717 }
718
719
720 func (ihqmilr IotHubQuotaMetricInfoListResult) hasNextLink() bool {
721 return ihqmilr.NextLink != nil && len(*ihqmilr.NextLink) != 0
722 }
723
724
725
726 func (ihqmilr IotHubQuotaMetricInfoListResult) iotHubQuotaMetricInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
727 if !ihqmilr.hasNextLink() {
728 return nil, nil
729 }
730 return autorest.Prepare((&http.Request{}).WithContext(ctx),
731 autorest.AsJSON(),
732 autorest.AsGet(),
733 autorest.WithBaseURL(to.String(ihqmilr.NextLink)))
734 }
735
736
737 type IotHubQuotaMetricInfoListResultPage struct {
738 fn func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)
739 ihqmilr IotHubQuotaMetricInfoListResult
740 }
741
742
743
744 func (page *IotHubQuotaMetricInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
745 if tracing.IsEnabled() {
746 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultPage.NextWithContext")
747 defer func() {
748 sc := -1
749 if page.Response().Response.Response != nil {
750 sc = page.Response().Response.Response.StatusCode
751 }
752 tracing.EndSpan(ctx, sc, err)
753 }()
754 }
755 for {
756 next, err := page.fn(ctx, page.ihqmilr)
757 if err != nil {
758 return err
759 }
760 page.ihqmilr = next
761 if !next.hasNextLink() || !next.IsEmpty() {
762 break
763 }
764 }
765 return nil
766 }
767
768
769
770
771 func (page *IotHubQuotaMetricInfoListResultPage) Next() error {
772 return page.NextWithContext(context.Background())
773 }
774
775
776 func (page IotHubQuotaMetricInfoListResultPage) NotDone() bool {
777 return !page.ihqmilr.IsEmpty()
778 }
779
780
781 func (page IotHubQuotaMetricInfoListResultPage) Response() IotHubQuotaMetricInfoListResult {
782 return page.ihqmilr
783 }
784
785
786 func (page IotHubQuotaMetricInfoListResultPage) Values() []IotHubQuotaMetricInfo {
787 if page.ihqmilr.IsEmpty() {
788 return nil
789 }
790 return *page.ihqmilr.Value
791 }
792
793
794 func NewIotHubQuotaMetricInfoListResultPage(cur IotHubQuotaMetricInfoListResult, getNextPage func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)) IotHubQuotaMetricInfoListResultPage {
795 return IotHubQuotaMetricInfoListResultPage{
796 fn: getNextPage,
797 ihqmilr: cur,
798 }
799 }
800
801
802
803 type IotHubResourceCreateOrUpdateFuture struct {
804 azure.FutureAPI
805
806
807 Result func(IotHubResourceClient) (IotHubDescription, error)
808 }
809
810
811 func (future *IotHubResourceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
812 var azFuture azure.Future
813 if err := json.Unmarshal(body, &azFuture); err != nil {
814 return err
815 }
816 future.FutureAPI = &azFuture
817 future.Result = future.result
818 return nil
819 }
820
821
822 func (future *IotHubResourceCreateOrUpdateFuture) result(client IotHubResourceClient) (ihd IotHubDescription, err error) {
823 var done bool
824 done, err = future.DoneWithContext(context.Background(), client)
825 if err != nil {
826 err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
827 return
828 }
829 if !done {
830 ihd.Response.Response = future.Response()
831 err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceCreateOrUpdateFuture")
832 return
833 }
834 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
835 if ihd.Response.Response, err = future.GetResult(sender); err == nil && ihd.Response.Response.StatusCode != http.StatusNoContent {
836 ihd, err = client.CreateOrUpdateResponder(ihd.Response.Response)
837 if err != nil {
838 err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", ihd.Response.Response, "Failure responding to request")
839 }
840 }
841 return
842 }
843
844
845
846 type IotHubResourceDeleteFuture struct {
847 azure.FutureAPI
848
849
850 Result func(IotHubResourceClient) (SetObject, error)
851 }
852
853
854 func (future *IotHubResourceDeleteFuture) UnmarshalJSON(body []byte) error {
855 var azFuture azure.Future
856 if err := json.Unmarshal(body, &azFuture); err != nil {
857 return err
858 }
859 future.FutureAPI = &azFuture
860 future.Result = future.result
861 return nil
862 }
863
864
865 func (future *IotHubResourceDeleteFuture) result(client IotHubResourceClient) (so SetObject, err error) {
866 var done bool
867 done, err = future.DoneWithContext(context.Background(), client)
868 if err != nil {
869 err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", future.Response(), "Polling failure")
870 return
871 }
872 if !done {
873 so.Response.Response = future.Response()
874 err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceDeleteFuture")
875 return
876 }
877 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
878 if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
879 so, err = client.DeleteResponder(so.Response.Response)
880 if err != nil {
881 err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", so.Response.Response, "Failure responding to request")
882 }
883 }
884 return
885 }
886
887
888 type IotHubSkuDescription struct {
889
890 ResourceType *string `json:"resourceType,omitempty"`
891 Sku *IotHubSkuInfo `json:"sku,omitempty"`
892 Capacity *IotHubCapacity `json:"capacity,omitempty"`
893 }
894
895
896 func (ihsd IotHubSkuDescription) MarshalJSON() ([]byte, error) {
897 objectMap := make(map[string]interface{})
898 if ihsd.Sku != nil {
899 objectMap["sku"] = ihsd.Sku
900 }
901 if ihsd.Capacity != nil {
902 objectMap["capacity"] = ihsd.Capacity
903 }
904 return json.Marshal(objectMap)
905 }
906
907
908
909 type IotHubSkuDescriptionListResult struct {
910 autorest.Response `json:"-"`
911
912 Value *[]IotHubSkuDescription `json:"value,omitempty"`
913
914 NextLink *string `json:"nextLink,omitempty"`
915 }
916
917
918 func (ihsdlr IotHubSkuDescriptionListResult) MarshalJSON() ([]byte, error) {
919 objectMap := make(map[string]interface{})
920 if ihsdlr.Value != nil {
921 objectMap["value"] = ihsdlr.Value
922 }
923 return json.Marshal(objectMap)
924 }
925
926
927
928 type IotHubSkuDescriptionListResultIterator struct {
929 i int
930 page IotHubSkuDescriptionListResultPage
931 }
932
933
934
935 func (iter *IotHubSkuDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
936 if tracing.IsEnabled() {
937 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultIterator.NextWithContext")
938 defer func() {
939 sc := -1
940 if iter.Response().Response.Response != nil {
941 sc = iter.Response().Response.Response.StatusCode
942 }
943 tracing.EndSpan(ctx, sc, err)
944 }()
945 }
946 iter.i++
947 if iter.i < len(iter.page.Values()) {
948 return nil
949 }
950 err = iter.page.NextWithContext(ctx)
951 if err != nil {
952 iter.i--
953 return err
954 }
955 iter.i = 0
956 return nil
957 }
958
959
960
961
962 func (iter *IotHubSkuDescriptionListResultIterator) Next() error {
963 return iter.NextWithContext(context.Background())
964 }
965
966
967 func (iter IotHubSkuDescriptionListResultIterator) NotDone() bool {
968 return iter.page.NotDone() && iter.i < len(iter.page.Values())
969 }
970
971
972 func (iter IotHubSkuDescriptionListResultIterator) Response() IotHubSkuDescriptionListResult {
973 return iter.page.Response()
974 }
975
976
977
978 func (iter IotHubSkuDescriptionListResultIterator) Value() IotHubSkuDescription {
979 if !iter.page.NotDone() {
980 return IotHubSkuDescription{}
981 }
982 return iter.page.Values()[iter.i]
983 }
984
985
986 func NewIotHubSkuDescriptionListResultIterator(page IotHubSkuDescriptionListResultPage) IotHubSkuDescriptionListResultIterator {
987 return IotHubSkuDescriptionListResultIterator{page: page}
988 }
989
990
991 func (ihsdlr IotHubSkuDescriptionListResult) IsEmpty() bool {
992 return ihsdlr.Value == nil || len(*ihsdlr.Value) == 0
993 }
994
995
996 func (ihsdlr IotHubSkuDescriptionListResult) hasNextLink() bool {
997 return ihsdlr.NextLink != nil && len(*ihsdlr.NextLink) != 0
998 }
999
1000
1001
1002 func (ihsdlr IotHubSkuDescriptionListResult) iotHubSkuDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
1003 if !ihsdlr.hasNextLink() {
1004 return nil, nil
1005 }
1006 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1007 autorest.AsJSON(),
1008 autorest.AsGet(),
1009 autorest.WithBaseURL(to.String(ihsdlr.NextLink)))
1010 }
1011
1012
1013 type IotHubSkuDescriptionListResultPage struct {
1014 fn func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)
1015 ihsdlr IotHubSkuDescriptionListResult
1016 }
1017
1018
1019
1020 func (page *IotHubSkuDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
1021 if tracing.IsEnabled() {
1022 ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultPage.NextWithContext")
1023 defer func() {
1024 sc := -1
1025 if page.Response().Response.Response != nil {
1026 sc = page.Response().Response.Response.StatusCode
1027 }
1028 tracing.EndSpan(ctx, sc, err)
1029 }()
1030 }
1031 for {
1032 next, err := page.fn(ctx, page.ihsdlr)
1033 if err != nil {
1034 return err
1035 }
1036 page.ihsdlr = next
1037 if !next.hasNextLink() || !next.IsEmpty() {
1038 break
1039 }
1040 }
1041 return nil
1042 }
1043
1044
1045
1046
1047 func (page *IotHubSkuDescriptionListResultPage) Next() error {
1048 return page.NextWithContext(context.Background())
1049 }
1050
1051
1052 func (page IotHubSkuDescriptionListResultPage) NotDone() bool {
1053 return !page.ihsdlr.IsEmpty()
1054 }
1055
1056
1057 func (page IotHubSkuDescriptionListResultPage) Response() IotHubSkuDescriptionListResult {
1058 return page.ihsdlr
1059 }
1060
1061
1062 func (page IotHubSkuDescriptionListResultPage) Values() []IotHubSkuDescription {
1063 if page.ihsdlr.IsEmpty() {
1064 return nil
1065 }
1066 return *page.ihsdlr.Value
1067 }
1068
1069
1070 func NewIotHubSkuDescriptionListResultPage(cur IotHubSkuDescriptionListResult, getNextPage func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)) IotHubSkuDescriptionListResultPage {
1071 return IotHubSkuDescriptionListResultPage{
1072 fn: getNextPage,
1073 ihsdlr: cur,
1074 }
1075 }
1076
1077
1078 type IotHubSkuInfo struct {
1079
1080 Name IotHubSku `json:"name,omitempty"`
1081
1082 Tier IotHubSkuTier `json:"tier,omitempty"`
1083
1084 Capacity *int64 `json:"capacity,omitempty"`
1085 }
1086
1087
1088 func (ihsi IotHubSkuInfo) MarshalJSON() ([]byte, error) {
1089 objectMap := make(map[string]interface{})
1090 if ihsi.Name != "" {
1091 objectMap["name"] = ihsi.Name
1092 }
1093 if ihsi.Capacity != nil {
1094 objectMap["capacity"] = ihsi.Capacity
1095 }
1096 return json.Marshal(objectMap)
1097 }
1098
1099
1100 type IPFilterRule struct {
1101
1102 FilterName *string `json:"filterName,omitempty"`
1103
1104 Action IPFilterActionType `json:"action,omitempty"`
1105
1106 IPMask *string `json:"ipMask,omitempty"`
1107 }
1108
1109
1110 type JobResponse struct {
1111 autorest.Response `json:"-"`
1112
1113 JobID *string `json:"jobId,omitempty"`
1114
1115 StartTimeUtc *date.TimeRFC1123 `json:"startTimeUtc,omitempty"`
1116
1117 EndTimeUtc *date.TimeRFC1123 `json:"endTimeUtc,omitempty"`
1118
1119 Type JobType `json:"type,omitempty"`
1120
1121 Status JobStatus `json:"status,omitempty"`
1122
1123 FailureReason *string `json:"failureReason,omitempty"`
1124
1125 StatusMessage *string `json:"statusMessage,omitempty"`
1126
1127 ParentJobID *string `json:"parentJobId,omitempty"`
1128 }
1129
1130
1131 func (jr JobResponse) MarshalJSON() ([]byte, error) {
1132 objectMap := make(map[string]interface{})
1133 return json.Marshal(objectMap)
1134 }
1135
1136
1137 type JobResponseListResult struct {
1138 autorest.Response `json:"-"`
1139
1140 Value *[]JobResponse `json:"value,omitempty"`
1141
1142 NextLink *string `json:"nextLink,omitempty"`
1143 }
1144
1145
1146 func (jrlr JobResponseListResult) MarshalJSON() ([]byte, error) {
1147 objectMap := make(map[string]interface{})
1148 if jrlr.Value != nil {
1149 objectMap["value"] = jrlr.Value
1150 }
1151 return json.Marshal(objectMap)
1152 }
1153
1154
1155 type JobResponseListResultIterator struct {
1156 i int
1157 page JobResponseListResultPage
1158 }
1159
1160
1161
1162 func (iter *JobResponseListResultIterator) NextWithContext(ctx context.Context) (err error) {
1163 if tracing.IsEnabled() {
1164 ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultIterator.NextWithContext")
1165 defer func() {
1166 sc := -1
1167 if iter.Response().Response.Response != nil {
1168 sc = iter.Response().Response.Response.StatusCode
1169 }
1170 tracing.EndSpan(ctx, sc, err)
1171 }()
1172 }
1173 iter.i++
1174 if iter.i < len(iter.page.Values()) {
1175 return nil
1176 }
1177 err = iter.page.NextWithContext(ctx)
1178 if err != nil {
1179 iter.i--
1180 return err
1181 }
1182 iter.i = 0
1183 return nil
1184 }
1185
1186
1187
1188
1189 func (iter *JobResponseListResultIterator) Next() error {
1190 return iter.NextWithContext(context.Background())
1191 }
1192
1193
1194 func (iter JobResponseListResultIterator) NotDone() bool {
1195 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1196 }
1197
1198
1199 func (iter JobResponseListResultIterator) Response() JobResponseListResult {
1200 return iter.page.Response()
1201 }
1202
1203
1204
1205 func (iter JobResponseListResultIterator) Value() JobResponse {
1206 if !iter.page.NotDone() {
1207 return JobResponse{}
1208 }
1209 return iter.page.Values()[iter.i]
1210 }
1211
1212
1213 func NewJobResponseListResultIterator(page JobResponseListResultPage) JobResponseListResultIterator {
1214 return JobResponseListResultIterator{page: page}
1215 }
1216
1217
1218 func (jrlr JobResponseListResult) IsEmpty() bool {
1219 return jrlr.Value == nil || len(*jrlr.Value) == 0
1220 }
1221
1222
1223 func (jrlr JobResponseListResult) hasNextLink() bool {
1224 return jrlr.NextLink != nil && len(*jrlr.NextLink) != 0
1225 }
1226
1227
1228
1229 func (jrlr JobResponseListResult) jobResponseListResultPreparer(ctx context.Context) (*http.Request, error) {
1230 if !jrlr.hasNextLink() {
1231 return nil, nil
1232 }
1233 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1234 autorest.AsJSON(),
1235 autorest.AsGet(),
1236 autorest.WithBaseURL(to.String(jrlr.NextLink)))
1237 }
1238
1239
1240 type JobResponseListResultPage struct {
1241 fn func(context.Context, JobResponseListResult) (JobResponseListResult, error)
1242 jrlr JobResponseListResult
1243 }
1244
1245
1246
1247 func (page *JobResponseListResultPage) NextWithContext(ctx context.Context) (err error) {
1248 if tracing.IsEnabled() {
1249 ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultPage.NextWithContext")
1250 defer func() {
1251 sc := -1
1252 if page.Response().Response.Response != nil {
1253 sc = page.Response().Response.Response.StatusCode
1254 }
1255 tracing.EndSpan(ctx, sc, err)
1256 }()
1257 }
1258 for {
1259 next, err := page.fn(ctx, page.jrlr)
1260 if err != nil {
1261 return err
1262 }
1263 page.jrlr = next
1264 if !next.hasNextLink() || !next.IsEmpty() {
1265 break
1266 }
1267 }
1268 return nil
1269 }
1270
1271
1272
1273
1274 func (page *JobResponseListResultPage) Next() error {
1275 return page.NextWithContext(context.Background())
1276 }
1277
1278
1279 func (page JobResponseListResultPage) NotDone() bool {
1280 return !page.jrlr.IsEmpty()
1281 }
1282
1283
1284 func (page JobResponseListResultPage) Response() JobResponseListResult {
1285 return page.jrlr
1286 }
1287
1288
1289 func (page JobResponseListResultPage) Values() []JobResponse {
1290 if page.jrlr.IsEmpty() {
1291 return nil
1292 }
1293 return *page.jrlr.Value
1294 }
1295
1296
1297 func NewJobResponseListResultPage(cur JobResponseListResult, getNextPage func(context.Context, JobResponseListResult) (JobResponseListResult, error)) JobResponseListResultPage {
1298 return JobResponseListResultPage{
1299 fn: getNextPage,
1300 jrlr: cur,
1301 }
1302 }
1303
1304
1305 type MessagingEndpointProperties struct {
1306
1307 LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"`
1308
1309 TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"`
1310
1311 MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
1312 }
1313
1314
1315 type OperationInputs struct {
1316
1317 Name *string `json:"Name,omitempty"`
1318 }
1319
1320
1321
1322
1323 type OperationsMonitoringProperties struct {
1324 Events map[string]*OperationMonitoringLevel `json:"events"`
1325 }
1326
1327
1328 func (omp OperationsMonitoringProperties) MarshalJSON() ([]byte, error) {
1329 objectMap := make(map[string]interface{})
1330 if omp.Events != nil {
1331 objectMap["events"] = omp.Events
1332 }
1333 return json.Marshal(objectMap)
1334 }
1335
1336
1337 type RegistryStatistics struct {
1338 autorest.Response `json:"-"`
1339
1340 TotalDeviceCount *int64 `json:"totalDeviceCount,omitempty"`
1341
1342 EnabledDeviceCount *int64 `json:"enabledDeviceCount,omitempty"`
1343
1344 DisabledDeviceCount *int64 `json:"disabledDeviceCount,omitempty"`
1345 }
1346
1347
1348 func (rs RegistryStatistics) MarshalJSON() ([]byte, error) {
1349 objectMap := make(map[string]interface{})
1350 return json.Marshal(objectMap)
1351 }
1352
1353
1354 type Resource struct {
1355
1356 ID *string `json:"id,omitempty"`
1357
1358 Name *string `json:"name,omitempty"`
1359
1360 Type *string `json:"type,omitempty"`
1361
1362 Location *string `json:"location,omitempty"`
1363
1364 Tags map[string]*string `json:"tags"`
1365 }
1366
1367
1368 func (r Resource) MarshalJSON() ([]byte, error) {
1369 objectMap := make(map[string]interface{})
1370 if r.Location != nil {
1371 objectMap["location"] = r.Location
1372 }
1373 if r.Tags != nil {
1374 objectMap["tags"] = r.Tags
1375 }
1376 return json.Marshal(objectMap)
1377 }
1378
1379
1380 type SetObject struct {
1381 autorest.Response `json:"-"`
1382 Value interface{} `json:"value,omitempty"`
1383 }
1384
1385
1386 type SharedAccessSignatureAuthorizationRule struct {
1387 autorest.Response `json:"-"`
1388
1389 KeyName *string `json:"keyName,omitempty"`
1390
1391 PrimaryKey *string `json:"primaryKey,omitempty"`
1392
1393 SecondaryKey *string `json:"secondaryKey,omitempty"`
1394
1395 Rights AccessRights `json:"rights,omitempty"`
1396 }
1397
1398
1399 type SharedAccessSignatureAuthorizationRuleListResult struct {
1400 autorest.Response `json:"-"`
1401
1402 Value *[]SharedAccessSignatureAuthorizationRule `json:"value,omitempty"`
1403
1404 NextLink *string `json:"nextLink,omitempty"`
1405 }
1406
1407
1408 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) {
1409 objectMap := make(map[string]interface{})
1410 if sasarlr.Value != nil {
1411 objectMap["value"] = sasarlr.Value
1412 }
1413 return json.Marshal(objectMap)
1414 }
1415
1416
1417
1418 type SharedAccessSignatureAuthorizationRuleListResultIterator struct {
1419 i int
1420 page SharedAccessSignatureAuthorizationRuleListResultPage
1421 }
1422
1423
1424
1425 func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
1426 if tracing.IsEnabled() {
1427 ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultIterator.NextWithContext")
1428 defer func() {
1429 sc := -1
1430 if iter.Response().Response.Response != nil {
1431 sc = iter.Response().Response.Response.StatusCode
1432 }
1433 tracing.EndSpan(ctx, sc, err)
1434 }()
1435 }
1436 iter.i++
1437 if iter.i < len(iter.page.Values()) {
1438 return nil
1439 }
1440 err = iter.page.NextWithContext(ctx)
1441 if err != nil {
1442 iter.i--
1443 return err
1444 }
1445 iter.i = 0
1446 return nil
1447 }
1448
1449
1450
1451
1452 func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) Next() error {
1453 return iter.NextWithContext(context.Background())
1454 }
1455
1456
1457 func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) NotDone() bool {
1458 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1459 }
1460
1461
1462 func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Response() SharedAccessSignatureAuthorizationRuleListResult {
1463 return iter.page.Response()
1464 }
1465
1466
1467
1468 func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Value() SharedAccessSignatureAuthorizationRule {
1469 if !iter.page.NotDone() {
1470 return SharedAccessSignatureAuthorizationRule{}
1471 }
1472 return iter.page.Values()[iter.i]
1473 }
1474
1475
1476 func NewSharedAccessSignatureAuthorizationRuleListResultIterator(page SharedAccessSignatureAuthorizationRuleListResultPage) SharedAccessSignatureAuthorizationRuleListResultIterator {
1477 return SharedAccessSignatureAuthorizationRuleListResultIterator{page: page}
1478 }
1479
1480
1481 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) IsEmpty() bool {
1482 return sasarlr.Value == nil || len(*sasarlr.Value) == 0
1483 }
1484
1485
1486 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) hasNextLink() bool {
1487 return sasarlr.NextLink != nil && len(*sasarlr.NextLink) != 0
1488 }
1489
1490
1491
1492 func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) sharedAccessSignatureAuthorizationRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
1493 if !sasarlr.hasNextLink() {
1494 return nil, nil
1495 }
1496 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1497 autorest.AsJSON(),
1498 autorest.AsGet(),
1499 autorest.WithBaseURL(to.String(sasarlr.NextLink)))
1500 }
1501
1502
1503
1504 type SharedAccessSignatureAuthorizationRuleListResultPage struct {
1505 fn func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)
1506 sasarlr SharedAccessSignatureAuthorizationRuleListResult
1507 }
1508
1509
1510
1511 func (page *SharedAccessSignatureAuthorizationRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
1512 if tracing.IsEnabled() {
1513 ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultPage.NextWithContext")
1514 defer func() {
1515 sc := -1
1516 if page.Response().Response.Response != nil {
1517 sc = page.Response().Response.Response.StatusCode
1518 }
1519 tracing.EndSpan(ctx, sc, err)
1520 }()
1521 }
1522 for {
1523 next, err := page.fn(ctx, page.sasarlr)
1524 if err != nil {
1525 return err
1526 }
1527 page.sasarlr = next
1528 if !next.hasNextLink() || !next.IsEmpty() {
1529 break
1530 }
1531 }
1532 return nil
1533 }
1534
1535
1536
1537
1538 func (page *SharedAccessSignatureAuthorizationRuleListResultPage) Next() error {
1539 return page.NextWithContext(context.Background())
1540 }
1541
1542
1543 func (page SharedAccessSignatureAuthorizationRuleListResultPage) NotDone() bool {
1544 return !page.sasarlr.IsEmpty()
1545 }
1546
1547
1548 func (page SharedAccessSignatureAuthorizationRuleListResultPage) Response() SharedAccessSignatureAuthorizationRuleListResult {
1549 return page.sasarlr
1550 }
1551
1552
1553 func (page SharedAccessSignatureAuthorizationRuleListResultPage) Values() []SharedAccessSignatureAuthorizationRule {
1554 if page.sasarlr.IsEmpty() {
1555 return nil
1556 }
1557 return *page.sasarlr.Value
1558 }
1559
1560
1561 func NewSharedAccessSignatureAuthorizationRuleListResultPage(cur SharedAccessSignatureAuthorizationRuleListResult, getNextPage func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)) SharedAccessSignatureAuthorizationRuleListResultPage {
1562 return SharedAccessSignatureAuthorizationRuleListResultPage{
1563 fn: getNextPage,
1564 sasarlr: cur,
1565 }
1566 }
1567
1568
1569 type StorageEndpointProperties struct {
1570
1571 SasTTLAsIso8601 *string `json:"sasTtlAsIso8601,omitempty"`
1572
1573 ConnectionString *string `json:"connectionString,omitempty"`
1574
1575 ContainerName *string `json:"containerName,omitempty"`
1576 }
1577
View as plain text