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