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