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