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