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