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