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