1# coding=utf-8 2# -------------------------------------------------------------------------- 3# Copyright (c) Microsoft Corporation. All rights reserved. 4# Licensed under the MIT License. See License.txt in the project root for license information. 5# Code generated by Microsoft (R) AutoRest Code Generator. 6# Changes may cause incorrect behavior and will be lost if the code is regenerated. 7# -------------------------------------------------------------------------- 8 9import datetime 10from typing import Dict, List, Optional, Union 11 12from azure.core.exceptions import HttpResponseError 13import msrest.serialization 14 15from ._iot_hub_client_enums import * 16 17 18class CloudToDeviceProperties(msrest.serialization.Model): 19 """The IoT hub cloud-to-device messaging properties. 20 21 :param max_delivery_count: The max delivery count for cloud-to-device messages in the device 22 queue. See: 23 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. 24 :type max_delivery_count: int 25 :param default_ttl_as_iso8601: The default time to live for cloud-to-device messages in the 26 device queue. See: 27 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. 28 :type default_ttl_as_iso8601: ~datetime.timedelta 29 :param feedback: The properties of the feedback queue for cloud-to-device messages. 30 :type feedback: ~azure.mgmt.iothub.v2017_01_19.models.FeedbackProperties 31 """ 32 33 _validation = { 34 'max_delivery_count': {'maximum': 100, 'minimum': 1}, 35 } 36 37 _attribute_map = { 38 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, 39 'default_ttl_as_iso8601': {'key': 'defaultTtlAsIso8601', 'type': 'duration'}, 40 'feedback': {'key': 'feedback', 'type': 'FeedbackProperties'}, 41 } 42 43 def __init__( 44 self, 45 *, 46 max_delivery_count: Optional[int] = None, 47 default_ttl_as_iso8601: Optional[datetime.timedelta] = None, 48 feedback: Optional["FeedbackProperties"] = None, 49 **kwargs 50 ): 51 super(CloudToDeviceProperties, self).__init__(**kwargs) 52 self.max_delivery_count = max_delivery_count 53 self.default_ttl_as_iso8601 = default_ttl_as_iso8601 54 self.feedback = feedback 55 56 57class ErrorDetails(msrest.serialization.Model): 58 """Error details. 59 60 Variables are only populated by the server, and will be ignored when sending a request. 61 62 :ivar code: The error code. 63 :vartype code: str 64 :ivar http_status_code: The HTTP status code. 65 :vartype http_status_code: str 66 :ivar message: The error message. 67 :vartype message: str 68 :ivar details: The error details. 69 :vartype details: str 70 """ 71 72 _validation = { 73 'code': {'readonly': True}, 74 'http_status_code': {'readonly': True}, 75 'message': {'readonly': True}, 76 'details': {'readonly': True}, 77 } 78 79 _attribute_map = { 80 'code': {'key': 'Code', 'type': 'str'}, 81 'http_status_code': {'key': 'HttpStatusCode', 'type': 'str'}, 82 'message': {'key': 'Message', 'type': 'str'}, 83 'details': {'key': 'Details', 'type': 'str'}, 84 } 85 86 def __init__( 87 self, 88 **kwargs 89 ): 90 super(ErrorDetails, self).__init__(**kwargs) 91 self.code = None 92 self.http_status_code = None 93 self.message = None 94 self.details = None 95 96 97class EventHubConsumerGroupInfo(msrest.serialization.Model): 98 """The properties of the EventHubConsumerGroupInfo object. 99 100 :param tags: A set of tags. The tags. 101 :type tags: dict[str, str] 102 :param id: The Event Hub-compatible consumer group identifier. 103 :type id: str 104 :param name: The Event Hub-compatible consumer group name. 105 :type name: str 106 """ 107 108 _attribute_map = { 109 'tags': {'key': 'tags', 'type': '{str}'}, 110 'id': {'key': 'id', 'type': 'str'}, 111 'name': {'key': 'name', 'type': 'str'}, 112 } 113 114 def __init__( 115 self, 116 *, 117 tags: Optional[Dict[str, str]] = None, 118 id: Optional[str] = None, 119 name: Optional[str] = None, 120 **kwargs 121 ): 122 super(EventHubConsumerGroupInfo, self).__init__(**kwargs) 123 self.tags = tags 124 self.id = id 125 self.name = name 126 127 128class EventHubConsumerGroupsListResult(msrest.serialization.Model): 129 """The JSON-serialized array of Event Hub-compatible consumer group names with a next link. 130 131 Variables are only populated by the server, and will be ignored when sending a request. 132 133 :param value: The array of Event Hub-compatible consumer group names. 134 :type value: list[str] 135 :ivar next_link: The next link. 136 :vartype next_link: str 137 """ 138 139 _validation = { 140 'next_link': {'readonly': True}, 141 } 142 143 _attribute_map = { 144 'value': {'key': 'value', 'type': '[str]'}, 145 'next_link': {'key': 'nextLink', 'type': 'str'}, 146 } 147 148 def __init__( 149 self, 150 *, 151 value: Optional[List[str]] = None, 152 **kwargs 153 ): 154 super(EventHubConsumerGroupsListResult, self).__init__(**kwargs) 155 self.value = value 156 self.next_link = None 157 158 159class EventHubProperties(msrest.serialization.Model): 160 """The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub. 161 162 Variables are only populated by the server, and will be ignored when sending a request. 163 164 :param retention_time_in_days: The retention time for device-to-cloud messages in days. See: 165 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. 166 :type retention_time_in_days: long 167 :param partition_count: The number of partitions for receiving device-to-cloud messages in the 168 Event Hub-compatible endpoint. See: 169 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. 170 :type partition_count: int 171 :ivar partition_ids: The partition ids in the Event Hub-compatible endpoint. 172 :vartype partition_ids: list[str] 173 :ivar path: The Event Hub-compatible name. 174 :vartype path: str 175 :ivar endpoint: The Event Hub-compatible endpoint. 176 :vartype endpoint: str 177 """ 178 179 _validation = { 180 'partition_ids': {'readonly': True}, 181 'path': {'readonly': True}, 182 'endpoint': {'readonly': True}, 183 } 184 185 _attribute_map = { 186 'retention_time_in_days': {'key': 'retentionTimeInDays', 'type': 'long'}, 187 'partition_count': {'key': 'partitionCount', 'type': 'int'}, 188 'partition_ids': {'key': 'partitionIds', 'type': '[str]'}, 189 'path': {'key': 'path', 'type': 'str'}, 190 'endpoint': {'key': 'endpoint', 'type': 'str'}, 191 } 192 193 def __init__( 194 self, 195 *, 196 retention_time_in_days: Optional[int] = None, 197 partition_count: Optional[int] = None, 198 **kwargs 199 ): 200 super(EventHubProperties, self).__init__(**kwargs) 201 self.retention_time_in_days = retention_time_in_days 202 self.partition_count = partition_count 203 self.partition_ids = None 204 self.path = None 205 self.endpoint = None 206 207 208class ExportDevicesRequest(msrest.serialization.Model): 209 """Use to provide parameters when requesting an export of all devices in the IoT hub. 210 211 All required parameters must be populated in order to send to Azure. 212 213 :param export_blob_container_uri: Required. The export blob container URI. 214 :type export_blob_container_uri: str 215 :param exclude_keys: Required. The value indicating whether keys should be excluded during 216 export. 217 :type exclude_keys: bool 218 """ 219 220 _validation = { 221 'export_blob_container_uri': {'required': True}, 222 'exclude_keys': {'required': True}, 223 } 224 225 _attribute_map = { 226 'export_blob_container_uri': {'key': 'ExportBlobContainerUri', 'type': 'str'}, 227 'exclude_keys': {'key': 'ExcludeKeys', 'type': 'bool'}, 228 } 229 230 def __init__( 231 self, 232 *, 233 export_blob_container_uri: str, 234 exclude_keys: bool, 235 **kwargs 236 ): 237 super(ExportDevicesRequest, self).__init__(**kwargs) 238 self.export_blob_container_uri = export_blob_container_uri 239 self.exclude_keys = exclude_keys 240 241 242class FallbackRouteProperties(msrest.serialization.Model): 243 """The properties related to the fallback route based on which the IoT hub routes messages to the fallback endpoint. 244 245 All required parameters must be populated in order to send to Azure. 246 247 :param source: Required. The source to which the routing rule is to be applied to. e.g. 248 DeviceMessages. Possible values include: "DeviceMessages", "TwinChangeEvents", 249 "DeviceLifecycleEvents", "DeviceJobLifecycleEvents". 250 :type source: str or ~azure.mgmt.iothub.v2017_01_19.models.RoutingSource 251 :param condition: The condition which is evaluated in order to apply the fallback route. If the 252 condition is not provided it will evaluate to true by default. For grammar, See: 253 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. 254 :type condition: str 255 :param endpoint_names: Required. The list of endpoints to which the messages that satisfy the 256 condition are routed to. Currently only 1 endpoint is allowed. 257 :type endpoint_names: list[str] 258 :param is_enabled: Required. Used to specify whether the fallback route is enabled or not. 259 :type is_enabled: bool 260 """ 261 262 _validation = { 263 'source': {'required': True}, 264 'endpoint_names': {'required': True, 'max_items': 1, 'min_items': 1}, 265 'is_enabled': {'required': True}, 266 } 267 268 _attribute_map = { 269 'source': {'key': 'source', 'type': 'str'}, 270 'condition': {'key': 'condition', 'type': 'str'}, 271 'endpoint_names': {'key': 'endpointNames', 'type': '[str]'}, 272 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 273 } 274 275 def __init__( 276 self, 277 *, 278 source: Union[str, "RoutingSource"], 279 endpoint_names: List[str], 280 is_enabled: bool, 281 condition: Optional[str] = None, 282 **kwargs 283 ): 284 super(FallbackRouteProperties, self).__init__(**kwargs) 285 self.source = source 286 self.condition = condition 287 self.endpoint_names = endpoint_names 288 self.is_enabled = is_enabled 289 290 291class FeedbackProperties(msrest.serialization.Model): 292 """The properties of the feedback queue for cloud-to-device messages. 293 294 :param lock_duration_as_iso8601: The lock duration for the feedback queue. See: 295 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. 296 :type lock_duration_as_iso8601: ~datetime.timedelta 297 :param ttl_as_iso8601: The period of time for which a message is available to consume before it 298 is expired by the IoT hub. See: 299 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. 300 :type ttl_as_iso8601: ~datetime.timedelta 301 :param max_delivery_count: The number of times the IoT hub attempts to deliver a message on the 302 feedback queue. See: 303 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. 304 :type max_delivery_count: int 305 """ 306 307 _validation = { 308 'max_delivery_count': {'maximum': 100, 'minimum': 1}, 309 } 310 311 _attribute_map = { 312 'lock_duration_as_iso8601': {'key': 'lockDurationAsIso8601', 'type': 'duration'}, 313 'ttl_as_iso8601': {'key': 'ttlAsIso8601', 'type': 'duration'}, 314 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, 315 } 316 317 def __init__( 318 self, 319 *, 320 lock_duration_as_iso8601: Optional[datetime.timedelta] = None, 321 ttl_as_iso8601: Optional[datetime.timedelta] = None, 322 max_delivery_count: Optional[int] = None, 323 **kwargs 324 ): 325 super(FeedbackProperties, self).__init__(**kwargs) 326 self.lock_duration_as_iso8601 = lock_duration_as_iso8601 327 self.ttl_as_iso8601 = ttl_as_iso8601 328 self.max_delivery_count = max_delivery_count 329 330 331class ImportDevicesRequest(msrest.serialization.Model): 332 """Use to provide parameters when requesting an import of all devices in the hub. 333 334 All required parameters must be populated in order to send to Azure. 335 336 :param input_blob_container_uri: Required. The input blob container URI. 337 :type input_blob_container_uri: str 338 :param output_blob_container_uri: Required. The output blob container URI. 339 :type output_blob_container_uri: str 340 """ 341 342 _validation = { 343 'input_blob_container_uri': {'required': True}, 344 'output_blob_container_uri': {'required': True}, 345 } 346 347 _attribute_map = { 348 'input_blob_container_uri': {'key': 'InputBlobContainerUri', 'type': 'str'}, 349 'output_blob_container_uri': {'key': 'OutputBlobContainerUri', 'type': 'str'}, 350 } 351 352 def __init__( 353 self, 354 *, 355 input_blob_container_uri: str, 356 output_blob_container_uri: str, 357 **kwargs 358 ): 359 super(ImportDevicesRequest, self).__init__(**kwargs) 360 self.input_blob_container_uri = input_blob_container_uri 361 self.output_blob_container_uri = output_blob_container_uri 362 363 364class IotHubCapacity(msrest.serialization.Model): 365 """IoT Hub capacity information. 366 367 Variables are only populated by the server, and will be ignored when sending a request. 368 369 :ivar minimum: The minimum number of units. 370 :vartype minimum: long 371 :ivar maximum: The maximum number of units. 372 :vartype maximum: long 373 :ivar default: The default number of units. 374 :vartype default: long 375 :ivar scale_type: The type of the scaling enabled. Possible values include: "Automatic", 376 "Manual", "None". 377 :vartype scale_type: str or ~azure.mgmt.iothub.v2017_01_19.models.IotHubScaleType 378 """ 379 380 _validation = { 381 'minimum': {'readonly': True, 'maximum': 1, 'minimum': 1}, 382 'maximum': {'readonly': True}, 383 'default': {'readonly': True}, 384 'scale_type': {'readonly': True}, 385 } 386 387 _attribute_map = { 388 'minimum': {'key': 'minimum', 'type': 'long'}, 389 'maximum': {'key': 'maximum', 'type': 'long'}, 390 'default': {'key': 'default', 'type': 'long'}, 391 'scale_type': {'key': 'scaleType', 'type': 'str'}, 392 } 393 394 def __init__( 395 self, 396 **kwargs 397 ): 398 super(IotHubCapacity, self).__init__(**kwargs) 399 self.minimum = None 400 self.maximum = None 401 self.default = None 402 self.scale_type = None 403 404 405class Resource(msrest.serialization.Model): 406 """The common properties of an Azure resource. 407 408 Variables are only populated by the server, and will be ignored when sending a request. 409 410 All required parameters must be populated in order to send to Azure. 411 412 :ivar id: The resource identifier. 413 :vartype id: str 414 :ivar name: The resource name. 415 :vartype name: str 416 :ivar type: The resource type. 417 :vartype type: str 418 :param location: Required. The resource location. 419 :type location: str 420 :param tags: A set of tags. The resource tags. 421 :type tags: dict[str, str] 422 """ 423 424 _validation = { 425 'id': {'readonly': True}, 426 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, 427 'type': {'readonly': True}, 428 'location': {'required': True}, 429 } 430 431 _attribute_map = { 432 'id': {'key': 'id', 'type': 'str'}, 433 'name': {'key': 'name', 'type': 'str'}, 434 'type': {'key': 'type', 'type': 'str'}, 435 'location': {'key': 'location', 'type': 'str'}, 436 'tags': {'key': 'tags', 'type': '{str}'}, 437 } 438 439 def __init__( 440 self, 441 *, 442 location: str, 443 tags: Optional[Dict[str, str]] = None, 444 **kwargs 445 ): 446 super(Resource, self).__init__(**kwargs) 447 self.id = None 448 self.name = None 449 self.type = None 450 self.location = location 451 self.tags = tags 452 453 454class IotHubDescription(Resource): 455 """The description of the IoT hub. 456 457 Variables are only populated by the server, and will be ignored when sending a request. 458 459 All required parameters must be populated in order to send to Azure. 460 461 :ivar id: The resource identifier. 462 :vartype id: str 463 :ivar name: The resource name. 464 :vartype name: str 465 :ivar type: The resource type. 466 :vartype type: str 467 :param location: Required. The resource location. 468 :type location: str 469 :param tags: A set of tags. The resource tags. 470 :type tags: dict[str, str] 471 :param subscriptionid: Required. The subscription identifier. 472 :type subscriptionid: str 473 :param resourcegroup: Required. The name of the resource group that contains the IoT hub. A 474 resource group name uniquely identifies the resource group within the subscription. 475 :type resourcegroup: str 476 :param etag: The Etag field is *not* required. If it is provided in the response body, it must 477 also be provided as a header per the normal ETag convention. 478 :type etag: str 479 :param properties: The properties of an IoT hub. 480 :type properties: ~azure.mgmt.iothub.v2017_01_19.models.IotHubProperties 481 :param sku: Required. Information about the SKU of the IoT hub. 482 :type sku: ~azure.mgmt.iothub.v2017_01_19.models.IotHubSkuInfo 483 """ 484 485 _validation = { 486 'id': {'readonly': True}, 487 'name': {'readonly': True, 'pattern': r'^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$'}, 488 'type': {'readonly': True}, 489 'location': {'required': True}, 490 'subscriptionid': {'required': True}, 491 'resourcegroup': {'required': True}, 492 'sku': {'required': True}, 493 } 494 495 _attribute_map = { 496 'id': {'key': 'id', 'type': 'str'}, 497 'name': {'key': 'name', 'type': 'str'}, 498 'type': {'key': 'type', 'type': 'str'}, 499 'location': {'key': 'location', 'type': 'str'}, 500 'tags': {'key': 'tags', 'type': '{str}'}, 501 'subscriptionid': {'key': 'subscriptionid', 'type': 'str'}, 502 'resourcegroup': {'key': 'resourcegroup', 'type': 'str'}, 503 'etag': {'key': 'etag', 'type': 'str'}, 504 'properties': {'key': 'properties', 'type': 'IotHubProperties'}, 505 'sku': {'key': 'sku', 'type': 'IotHubSkuInfo'}, 506 } 507 508 def __init__( 509 self, 510 *, 511 location: str, 512 subscriptionid: str, 513 resourcegroup: str, 514 sku: "IotHubSkuInfo", 515 tags: Optional[Dict[str, str]] = None, 516 etag: Optional[str] = None, 517 properties: Optional["IotHubProperties"] = None, 518 **kwargs 519 ): 520 super(IotHubDescription, self).__init__(location=location, tags=tags, **kwargs) 521 self.subscriptionid = subscriptionid 522 self.resourcegroup = resourcegroup 523 self.etag = etag 524 self.properties = properties 525 self.sku = sku 526 527 528class IotHubDescriptionListResult(msrest.serialization.Model): 529 """The JSON-serialized array of IotHubDescription objects with a next link. 530 531 Variables are only populated by the server, and will be ignored when sending a request. 532 533 :param value: The array of IotHubDescription objects. 534 :type value: list[~azure.mgmt.iothub.v2017_01_19.models.IotHubDescription] 535 :ivar next_link: The next link. 536 :vartype next_link: str 537 """ 538 539 _validation = { 540 'next_link': {'readonly': True}, 541 } 542 543 _attribute_map = { 544 'value': {'key': 'value', 'type': '[IotHubDescription]'}, 545 'next_link': {'key': 'nextLink', 'type': 'str'}, 546 } 547 548 def __init__( 549 self, 550 *, 551 value: Optional[List["IotHubDescription"]] = None, 552 **kwargs 553 ): 554 super(IotHubDescriptionListResult, self).__init__(**kwargs) 555 self.value = value 556 self.next_link = None 557 558 559class IotHubNameAvailabilityInfo(msrest.serialization.Model): 560 """The properties indicating whether a given IoT hub name is available. 561 562 Variables are only populated by the server, and will be ignored when sending a request. 563 564 :ivar name_available: The value which indicates whether the provided name is available. 565 :vartype name_available: bool 566 :ivar reason: The reason for unavailability. Possible values include: "Invalid", 567 "AlreadyExists". 568 :vartype reason: str or ~azure.mgmt.iothub.v2017_01_19.models.IotHubNameUnavailabilityReason 569 :param message: The detailed reason message. 570 :type message: str 571 """ 572 573 _validation = { 574 'name_available': {'readonly': True}, 575 'reason': {'readonly': True}, 576 } 577 578 _attribute_map = { 579 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, 580 'reason': {'key': 'reason', 'type': 'str'}, 581 'message': {'key': 'message', 'type': 'str'}, 582 } 583 584 def __init__( 585 self, 586 *, 587 message: Optional[str] = None, 588 **kwargs 589 ): 590 super(IotHubNameAvailabilityInfo, self).__init__(**kwargs) 591 self.name_available = None 592 self.reason = None 593 self.message = message 594 595 596class IotHubProperties(msrest.serialization.Model): 597 """The properties of an IoT hub. 598 599 Variables are only populated by the server, and will be ignored when sending a request. 600 601 :param authorization_policies: The shared access policies you can use to secure a connection to 602 the IoT hub. 603 :type authorization_policies: 604 list[~azure.mgmt.iothub.v2017_01_19.models.SharedAccessSignatureAuthorizationRule] 605 :param ip_filter_rules: The IP filter rules. 606 :type ip_filter_rules: list[~azure.mgmt.iothub.v2017_01_19.models.IpFilterRule] 607 :ivar provisioning_state: The provisioning state. 608 :vartype provisioning_state: str 609 :ivar host_name: The name of the host. 610 :vartype host_name: str 611 :param event_hub_endpoints: The Event Hub-compatible endpoint properties. The possible keys to 612 this dictionary are events and operationsMonitoringEvents. Both of these keys have to be 613 present in the dictionary while making create or update calls for the IoT hub. 614 :type event_hub_endpoints: dict[str, ~azure.mgmt.iothub.v2017_01_19.models.EventHubProperties] 615 :param routing: The routing related properties of the IoT hub. See: 616 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. 617 :type routing: ~azure.mgmt.iothub.v2017_01_19.models.RoutingProperties 618 :param storage_endpoints: The list of Azure Storage endpoints where you can upload files. 619 Currently you can configure only one Azure Storage account and that MUST have its key as 620 $default. Specifying more than one storage account causes an error to be thrown. Not specifying 621 a value for this property when the enableFileUploadNotifications property is set to True, 622 causes an error to be thrown. 623 :type storage_endpoints: dict[str, 624 ~azure.mgmt.iothub.v2017_01_19.models.StorageEndpointProperties] 625 :param messaging_endpoints: The messaging endpoint properties for the file upload notification 626 queue. 627 :type messaging_endpoints: dict[str, 628 ~azure.mgmt.iothub.v2017_01_19.models.MessagingEndpointProperties] 629 :param enable_file_upload_notifications: If True, file upload notifications are enabled. 630 :type enable_file_upload_notifications: bool 631 :param cloud_to_device: The IoT hub cloud-to-device messaging properties. 632 :type cloud_to_device: ~azure.mgmt.iothub.v2017_01_19.models.CloudToDeviceProperties 633 :param comments: Comments. 634 :type comments: str 635 :param operations_monitoring_properties: The operations monitoring properties for the IoT hub. 636 The possible keys to the dictionary are Connections, DeviceTelemetry, C2DCommands, 637 DeviceIdentityOperations, FileUploadOperations, Routes, D2CTwinOperations, C2DTwinOperations, 638 TwinQueries, JobsOperations, DirectMethods. 639 :type operations_monitoring_properties: 640 ~azure.mgmt.iothub.v2017_01_19.models.OperationsMonitoringProperties 641 :param features: The capabilities and features enabled for the IoT hub. Possible values 642 include: "None", "DeviceManagement". 643 :type features: str or ~azure.mgmt.iothub.v2017_01_19.models.Capabilities 644 """ 645 646 _validation = { 647 'provisioning_state': {'readonly': True}, 648 'host_name': {'readonly': True}, 649 } 650 651 _attribute_map = { 652 'authorization_policies': {'key': 'authorizationPolicies', 'type': '[SharedAccessSignatureAuthorizationRule]'}, 653 'ip_filter_rules': {'key': 'ipFilterRules', 'type': '[IpFilterRule]'}, 654 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 655 'host_name': {'key': 'hostName', 'type': 'str'}, 656 'event_hub_endpoints': {'key': 'eventHubEndpoints', 'type': '{EventHubProperties}'}, 657 'routing': {'key': 'routing', 'type': 'RoutingProperties'}, 658 'storage_endpoints': {'key': 'storageEndpoints', 'type': '{StorageEndpointProperties}'}, 659 'messaging_endpoints': {'key': 'messagingEndpoints', 'type': '{MessagingEndpointProperties}'}, 660 'enable_file_upload_notifications': {'key': 'enableFileUploadNotifications', 'type': 'bool'}, 661 'cloud_to_device': {'key': 'cloudToDevice', 'type': 'CloudToDeviceProperties'}, 662 'comments': {'key': 'comments', 'type': 'str'}, 663 'operations_monitoring_properties': {'key': 'operationsMonitoringProperties', 'type': 'OperationsMonitoringProperties'}, 664 'features': {'key': 'features', 'type': 'str'}, 665 } 666 667 def __init__( 668 self, 669 *, 670 authorization_policies: Optional[List["SharedAccessSignatureAuthorizationRule"]] = None, 671 ip_filter_rules: Optional[List["IpFilterRule"]] = None, 672 event_hub_endpoints: Optional[Dict[str, "EventHubProperties"]] = None, 673 routing: Optional["RoutingProperties"] = None, 674 storage_endpoints: Optional[Dict[str, "StorageEndpointProperties"]] = None, 675 messaging_endpoints: Optional[Dict[str, "MessagingEndpointProperties"]] = None, 676 enable_file_upload_notifications: Optional[bool] = None, 677 cloud_to_device: Optional["CloudToDeviceProperties"] = None, 678 comments: Optional[str] = None, 679 operations_monitoring_properties: Optional["OperationsMonitoringProperties"] = None, 680 features: Optional[Union[str, "Capabilities"]] = None, 681 **kwargs 682 ): 683 super(IotHubProperties, self).__init__(**kwargs) 684 self.authorization_policies = authorization_policies 685 self.ip_filter_rules = ip_filter_rules 686 self.provisioning_state = None 687 self.host_name = None 688 self.event_hub_endpoints = event_hub_endpoints 689 self.routing = routing 690 self.storage_endpoints = storage_endpoints 691 self.messaging_endpoints = messaging_endpoints 692 self.enable_file_upload_notifications = enable_file_upload_notifications 693 self.cloud_to_device = cloud_to_device 694 self.comments = comments 695 self.operations_monitoring_properties = operations_monitoring_properties 696 self.features = features 697 698 699class IotHubQuotaMetricInfo(msrest.serialization.Model): 700 """Quota metrics properties. 701 702 Variables are only populated by the server, and will be ignored when sending a request. 703 704 :ivar name: The name of the quota metric. 705 :vartype name: str 706 :ivar current_value: The current value for the quota metric. 707 :vartype current_value: long 708 :ivar max_value: The maximum value of the quota metric. 709 :vartype max_value: long 710 """ 711 712 _validation = { 713 'name': {'readonly': True}, 714 'current_value': {'readonly': True}, 715 'max_value': {'readonly': True}, 716 } 717 718 _attribute_map = { 719 'name': {'key': 'Name', 'type': 'str'}, 720 'current_value': {'key': 'CurrentValue', 'type': 'long'}, 721 'max_value': {'key': 'MaxValue', 'type': 'long'}, 722 } 723 724 def __init__( 725 self, 726 **kwargs 727 ): 728 super(IotHubQuotaMetricInfo, self).__init__(**kwargs) 729 self.name = None 730 self.current_value = None 731 self.max_value = None 732 733 734class IotHubQuotaMetricInfoListResult(msrest.serialization.Model): 735 """The JSON-serialized array of IotHubQuotaMetricInfo objects with a next link. 736 737 Variables are only populated by the server, and will be ignored when sending a request. 738 739 :param value: The array of quota metrics objects. 740 :type value: list[~azure.mgmt.iothub.v2017_01_19.models.IotHubQuotaMetricInfo] 741 :ivar next_link: The next link. 742 :vartype next_link: str 743 """ 744 745 _validation = { 746 'next_link': {'readonly': True}, 747 } 748 749 _attribute_map = { 750 'value': {'key': 'value', 'type': '[IotHubQuotaMetricInfo]'}, 751 'next_link': {'key': 'nextLink', 'type': 'str'}, 752 } 753 754 def __init__( 755 self, 756 *, 757 value: Optional[List["IotHubQuotaMetricInfo"]] = None, 758 **kwargs 759 ): 760 super(IotHubQuotaMetricInfoListResult, self).__init__(**kwargs) 761 self.value = value 762 self.next_link = None 763 764 765class IotHubSkuDescription(msrest.serialization.Model): 766 """SKU properties. 767 768 Variables are only populated by the server, and will be ignored when sending a request. 769 770 All required parameters must be populated in order to send to Azure. 771 772 :ivar resource_type: The type of the resource. 773 :vartype resource_type: str 774 :param sku: Required. Information about the SKU of the IoT hub. 775 :type sku: ~azure.mgmt.iothub.v2017_01_19.models.IotHubSkuInfo 776 :param capacity: Required. IoT Hub capacity information. 777 :type capacity: ~azure.mgmt.iothub.v2017_01_19.models.IotHubCapacity 778 """ 779 780 _validation = { 781 'resource_type': {'readonly': True}, 782 'sku': {'required': True}, 783 'capacity': {'required': True}, 784 } 785 786 _attribute_map = { 787 'resource_type': {'key': 'resourceType', 'type': 'str'}, 788 'sku': {'key': 'sku', 'type': 'IotHubSkuInfo'}, 789 'capacity': {'key': 'capacity', 'type': 'IotHubCapacity'}, 790 } 791 792 def __init__( 793 self, 794 *, 795 sku: "IotHubSkuInfo", 796 capacity: "IotHubCapacity", 797 **kwargs 798 ): 799 super(IotHubSkuDescription, self).__init__(**kwargs) 800 self.resource_type = None 801 self.sku = sku 802 self.capacity = capacity 803 804 805class IotHubSkuDescriptionListResult(msrest.serialization.Model): 806 """The JSON-serialized array of IotHubSkuDescription objects with a next link. 807 808 Variables are only populated by the server, and will be ignored when sending a request. 809 810 :param value: The array of IotHubSkuDescription. 811 :type value: list[~azure.mgmt.iothub.v2017_01_19.models.IotHubSkuDescription] 812 :ivar next_link: The next link. 813 :vartype next_link: str 814 """ 815 816 _validation = { 817 'next_link': {'readonly': True}, 818 } 819 820 _attribute_map = { 821 'value': {'key': 'value', 'type': '[IotHubSkuDescription]'}, 822 'next_link': {'key': 'nextLink', 'type': 'str'}, 823 } 824 825 def __init__( 826 self, 827 *, 828 value: Optional[List["IotHubSkuDescription"]] = None, 829 **kwargs 830 ): 831 super(IotHubSkuDescriptionListResult, self).__init__(**kwargs) 832 self.value = value 833 self.next_link = None 834 835 836class IotHubSkuInfo(msrest.serialization.Model): 837 """Information about the SKU of the IoT hub. 838 839 Variables are only populated by the server, and will be ignored when sending a request. 840 841 All required parameters must be populated in order to send to Azure. 842 843 :param name: Required. The name of the SKU. Possible values include: "F1", "S1", "S2", "S3". 844 :type name: str or ~azure.mgmt.iothub.v2017_01_19.models.IotHubSku 845 :ivar tier: The billing tier for the IoT hub. Possible values include: "Free", "Standard". 846 :vartype tier: str or ~azure.mgmt.iothub.v2017_01_19.models.IotHubSkuTier 847 :param capacity: Required. The number of provisioned IoT Hub units. See: 848 https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. 849 :type capacity: long 850 """ 851 852 _validation = { 853 'name': {'required': True}, 854 'tier': {'readonly': True}, 855 'capacity': {'required': True}, 856 } 857 858 _attribute_map = { 859 'name': {'key': 'name', 'type': 'str'}, 860 'tier': {'key': 'tier', 'type': 'str'}, 861 'capacity': {'key': 'capacity', 'type': 'long'}, 862 } 863 864 def __init__( 865 self, 866 *, 867 name: Union[str, "IotHubSku"], 868 capacity: int, 869 **kwargs 870 ): 871 super(IotHubSkuInfo, self).__init__(**kwargs) 872 self.name = name 873 self.tier = None 874 self.capacity = capacity 875 876 877class IpFilterRule(msrest.serialization.Model): 878 """The IP filter rules for the IoT hub. 879 880 All required parameters must be populated in order to send to Azure. 881 882 :param filter_name: Required. The name of the IP filter rule. 883 :type filter_name: str 884 :param action: Required. The desired action for requests captured by this rule. Possible values 885 include: "Accept", "Reject". 886 :type action: str or ~azure.mgmt.iothub.v2017_01_19.models.IpFilterActionType 887 :param ip_mask: Required. A string that contains the IP address range in CIDR notation for the 888 rule. 889 :type ip_mask: str 890 """ 891 892 _validation = { 893 'filter_name': {'required': True}, 894 'action': {'required': True}, 895 'ip_mask': {'required': True}, 896 } 897 898 _attribute_map = { 899 'filter_name': {'key': 'filterName', 'type': 'str'}, 900 'action': {'key': 'action', 'type': 'str'}, 901 'ip_mask': {'key': 'ipMask', 'type': 'str'}, 902 } 903 904 def __init__( 905 self, 906 *, 907 filter_name: str, 908 action: Union[str, "IpFilterActionType"], 909 ip_mask: str, 910 **kwargs 911 ): 912 super(IpFilterRule, self).__init__(**kwargs) 913 self.filter_name = filter_name 914 self.action = action 915 self.ip_mask = ip_mask 916 917 918class JobResponse(msrest.serialization.Model): 919 """The properties of the Job Response object. 920 921 Variables are only populated by the server, and will be ignored when sending a request. 922 923 :ivar job_id: The job identifier. 924 :vartype job_id: str 925 :ivar start_time_utc: The start time of the job. 926 :vartype start_time_utc: ~datetime.datetime 927 :ivar end_time_utc: The time the job stopped processing. 928 :vartype end_time_utc: ~datetime.datetime 929 :ivar type: The type of the job. Possible values include: "unknown", "export", "import", 930 "backup", "readDeviceProperties", "writeDeviceProperties", "updateDeviceConfiguration", 931 "rebootDevice", "factoryResetDevice", "firmwareUpdate". 932 :vartype type: str or ~azure.mgmt.iothub.v2017_01_19.models.JobType 933 :ivar status: The status of the job. Possible values include: "unknown", "enqueued", "running", 934 "completed", "failed", "cancelled". 935 :vartype status: str or ~azure.mgmt.iothub.v2017_01_19.models.JobStatus 936 :ivar failure_reason: If status == failed, this string containing the reason for the failure. 937 :vartype failure_reason: str 938 :ivar status_message: The status message for the job. 939 :vartype status_message: str 940 :ivar parent_job_id: The job identifier of the parent job, if any. 941 :vartype parent_job_id: str 942 """ 943 944 _validation = { 945 'job_id': {'readonly': True}, 946 'start_time_utc': {'readonly': True}, 947 'end_time_utc': {'readonly': True}, 948 'type': {'readonly': True}, 949 'status': {'readonly': True}, 950 'failure_reason': {'readonly': True}, 951 'status_message': {'readonly': True}, 952 'parent_job_id': {'readonly': True}, 953 } 954 955 _attribute_map = { 956 'job_id': {'key': 'jobId', 'type': 'str'}, 957 'start_time_utc': {'key': 'startTimeUtc', 'type': 'rfc-1123'}, 958 'end_time_utc': {'key': 'endTimeUtc', 'type': 'rfc-1123'}, 959 'type': {'key': 'type', 'type': 'str'}, 960 'status': {'key': 'status', 'type': 'str'}, 961 'failure_reason': {'key': 'failureReason', 'type': 'str'}, 962 'status_message': {'key': 'statusMessage', 'type': 'str'}, 963 'parent_job_id': {'key': 'parentJobId', 'type': 'str'}, 964 } 965 966 def __init__( 967 self, 968 **kwargs 969 ): 970 super(JobResponse, self).__init__(**kwargs) 971 self.job_id = None 972 self.start_time_utc = None 973 self.end_time_utc = None 974 self.type = None 975 self.status = None 976 self.failure_reason = None 977 self.status_message = None 978 self.parent_job_id = None 979 980 981class JobResponseListResult(msrest.serialization.Model): 982 """The JSON-serialized array of JobResponse objects with a next link. 983 984 Variables are only populated by the server, and will be ignored when sending a request. 985 986 :param value: The array of JobResponse objects. 987 :type value: list[~azure.mgmt.iothub.v2017_01_19.models.JobResponse] 988 :ivar next_link: The next link. 989 :vartype next_link: str 990 """ 991 992 _validation = { 993 'next_link': {'readonly': True}, 994 } 995 996 _attribute_map = { 997 'value': {'key': 'value', 'type': '[JobResponse]'}, 998 'next_link': {'key': 'nextLink', 'type': 'str'}, 999 } 1000 1001 def __init__( 1002 self, 1003 *, 1004 value: Optional[List["JobResponse"]] = None, 1005 **kwargs 1006 ): 1007 super(JobResponseListResult, self).__init__(**kwargs) 1008 self.value = value 1009 self.next_link = None 1010 1011 1012class MessagingEndpointProperties(msrest.serialization.Model): 1013 """The properties of the messaging endpoints used by this IoT hub. 1014 1015 :param lock_duration_as_iso8601: The lock duration. See: 1016 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. 1017 :type lock_duration_as_iso8601: ~datetime.timedelta 1018 :param ttl_as_iso8601: The period of time for which a message is available to consume before it 1019 is expired by the IoT hub. See: 1020 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. 1021 :type ttl_as_iso8601: ~datetime.timedelta 1022 :param max_delivery_count: The number of times the IoT hub attempts to deliver a message. See: 1023 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. 1024 :type max_delivery_count: int 1025 """ 1026 1027 _validation = { 1028 'max_delivery_count': {'maximum': 100, 'minimum': 1}, 1029 } 1030 1031 _attribute_map = { 1032 'lock_duration_as_iso8601': {'key': 'lockDurationAsIso8601', 'type': 'duration'}, 1033 'ttl_as_iso8601': {'key': 'ttlAsIso8601', 'type': 'duration'}, 1034 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int'}, 1035 } 1036 1037 def __init__( 1038 self, 1039 *, 1040 lock_duration_as_iso8601: Optional[datetime.timedelta] = None, 1041 ttl_as_iso8601: Optional[datetime.timedelta] = None, 1042 max_delivery_count: Optional[int] = None, 1043 **kwargs 1044 ): 1045 super(MessagingEndpointProperties, self).__init__(**kwargs) 1046 self.lock_duration_as_iso8601 = lock_duration_as_iso8601 1047 self.ttl_as_iso8601 = ttl_as_iso8601 1048 self.max_delivery_count = max_delivery_count 1049 1050 1051class OperationInputs(msrest.serialization.Model): 1052 """Input values. 1053 1054 All required parameters must be populated in order to send to Azure. 1055 1056 :param name: Required. The name of the IoT hub to check. 1057 :type name: str 1058 """ 1059 1060 _validation = { 1061 'name': {'required': True}, 1062 } 1063 1064 _attribute_map = { 1065 'name': {'key': 'Name', 'type': 'str'}, 1066 } 1067 1068 def __init__( 1069 self, 1070 *, 1071 name: str, 1072 **kwargs 1073 ): 1074 super(OperationInputs, self).__init__(**kwargs) 1075 self.name = name 1076 1077 1078class OperationsMonitoringProperties(msrest.serialization.Model): 1079 """The operations monitoring properties for the IoT hub. The possible keys to the dictionary are Connections, DeviceTelemetry, C2DCommands, DeviceIdentityOperations, FileUploadOperations, Routes, D2CTwinOperations, C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods. 1080 1081 :param events: Dictionary of :code:`<OperationMonitoringLevel>`. 1082 :type events: dict[str, str or ~azure.mgmt.iothub.v2017_01_19.models.OperationMonitoringLevel] 1083 """ 1084 1085 _attribute_map = { 1086 'events': {'key': 'events', 'type': '{str}'}, 1087 } 1088 1089 def __init__( 1090 self, 1091 *, 1092 events: Optional[Dict[str, Union[str, "OperationMonitoringLevel"]]] = None, 1093 **kwargs 1094 ): 1095 super(OperationsMonitoringProperties, self).__init__(**kwargs) 1096 self.events = events 1097 1098 1099class RegistryStatistics(msrest.serialization.Model): 1100 """Identity registry statistics. 1101 1102 Variables are only populated by the server, and will be ignored when sending a request. 1103 1104 :ivar total_device_count: The total count of devices in the identity registry. 1105 :vartype total_device_count: long 1106 :ivar enabled_device_count: The count of enabled devices in the identity registry. 1107 :vartype enabled_device_count: long 1108 :ivar disabled_device_count: The count of disabled devices in the identity registry. 1109 :vartype disabled_device_count: long 1110 """ 1111 1112 _validation = { 1113 'total_device_count': {'readonly': True}, 1114 'enabled_device_count': {'readonly': True}, 1115 'disabled_device_count': {'readonly': True}, 1116 } 1117 1118 _attribute_map = { 1119 'total_device_count': {'key': 'totalDeviceCount', 'type': 'long'}, 1120 'enabled_device_count': {'key': 'enabledDeviceCount', 'type': 'long'}, 1121 'disabled_device_count': {'key': 'disabledDeviceCount', 'type': 'long'}, 1122 } 1123 1124 def __init__( 1125 self, 1126 **kwargs 1127 ): 1128 super(RegistryStatistics, self).__init__(**kwargs) 1129 self.total_device_count = None 1130 self.enabled_device_count = None 1131 self.disabled_device_count = None 1132 1133 1134class RouteProperties(msrest.serialization.Model): 1135 """The properties of a routing rule that your IoT hub uses to route messages to endpoints. 1136 1137 All required parameters must be populated in order to send to Azure. 1138 1139 :param name: Required. The name of the route. The name can only include alphanumeric 1140 characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be 1141 unique. 1142 :type name: str 1143 :param source: Required. The source that the routing rule is to be applied to, such as 1144 DeviceMessages. Possible values include: "DeviceMessages", "TwinChangeEvents", 1145 "DeviceLifecycleEvents", "DeviceJobLifecycleEvents". 1146 :type source: str or ~azure.mgmt.iothub.v2017_01_19.models.RoutingSource 1147 :param condition: The condition that is evaluated to apply the routing rule. If no condition is 1148 provided, it evaluates to true by default. For grammar, See: 1149 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. 1150 :type condition: str 1151 :param endpoint_names: Required. The list of endpoints to which messages that satisfy the 1152 condition are routed. Currently only one endpoint is allowed. 1153 :type endpoint_names: list[str] 1154 :param is_enabled: Required. Used to specify whether a route is enabled. 1155 :type is_enabled: bool 1156 """ 1157 1158 _validation = { 1159 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, 1160 'source': {'required': True}, 1161 'endpoint_names': {'required': True, 'max_items': 1, 'min_items': 1}, 1162 'is_enabled': {'required': True}, 1163 } 1164 1165 _attribute_map = { 1166 'name': {'key': 'name', 'type': 'str'}, 1167 'source': {'key': 'source', 'type': 'str'}, 1168 'condition': {'key': 'condition', 'type': 'str'}, 1169 'endpoint_names': {'key': 'endpointNames', 'type': '[str]'}, 1170 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 1171 } 1172 1173 def __init__( 1174 self, 1175 *, 1176 name: str, 1177 source: Union[str, "RoutingSource"], 1178 endpoint_names: List[str], 1179 is_enabled: bool, 1180 condition: Optional[str] = None, 1181 **kwargs 1182 ): 1183 super(RouteProperties, self).__init__(**kwargs) 1184 self.name = name 1185 self.source = source 1186 self.condition = condition 1187 self.endpoint_names = endpoint_names 1188 self.is_enabled = is_enabled 1189 1190 1191class RoutingEndpoints(msrest.serialization.Model): 1192 """The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs. 1193 1194 :param service_bus_queues: The list of Service Bus queue endpoints that IoT hub routes the 1195 messages to, based on the routing rules. 1196 :type service_bus_queues: 1197 list[~azure.mgmt.iothub.v2017_01_19.models.RoutingServiceBusQueueEndpointProperties] 1198 :param service_bus_topics: The list of Service Bus topic endpoints that the IoT hub routes the 1199 messages to, based on the routing rules. 1200 :type service_bus_topics: 1201 list[~azure.mgmt.iothub.v2017_01_19.models.RoutingServiceBusTopicEndpointProperties] 1202 :param event_hubs: The list of Event Hubs endpoints that IoT hub routes messages to, based on 1203 the routing rules. This list does not include the built-in Event Hubs endpoint. 1204 :type event_hubs: list[~azure.mgmt.iothub.v2017_01_19.models.RoutingEventHubProperties] 1205 """ 1206 1207 _attribute_map = { 1208 'service_bus_queues': {'key': 'serviceBusQueues', 'type': '[RoutingServiceBusQueueEndpointProperties]'}, 1209 'service_bus_topics': {'key': 'serviceBusTopics', 'type': '[RoutingServiceBusTopicEndpointProperties]'}, 1210 'event_hubs': {'key': 'eventHubs', 'type': '[RoutingEventHubProperties]'}, 1211 } 1212 1213 def __init__( 1214 self, 1215 *, 1216 service_bus_queues: Optional[List["RoutingServiceBusQueueEndpointProperties"]] = None, 1217 service_bus_topics: Optional[List["RoutingServiceBusTopicEndpointProperties"]] = None, 1218 event_hubs: Optional[List["RoutingEventHubProperties"]] = None, 1219 **kwargs 1220 ): 1221 super(RoutingEndpoints, self).__init__(**kwargs) 1222 self.service_bus_queues = service_bus_queues 1223 self.service_bus_topics = service_bus_topics 1224 self.event_hubs = event_hubs 1225 1226 1227class RoutingEventHubProperties(msrest.serialization.Model): 1228 """The properties related to an event hub endpoint. 1229 1230 All required parameters must be populated in order to send to Azure. 1231 1232 :param connection_string: Required. The connection string of the event hub endpoint. 1233 :type connection_string: str 1234 :param name: Required. The name of the event hub endpoint. The name can only include 1235 alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 1236 characters. The following names are reserved; events, operationsMonitoringEvents, 1237 fileNotifications, $default. Endpoint names must be unique across endpoint types. 1238 :type name: str 1239 :param subscription_id: The subscription identifier of the event hub endpoint. 1240 :type subscription_id: str 1241 :param resource_group: The name of the resource group of the event hub endpoint. 1242 :type resource_group: str 1243 """ 1244 1245 _validation = { 1246 'connection_string': {'required': True}, 1247 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, 1248 } 1249 1250 _attribute_map = { 1251 'connection_string': {'key': 'connectionString', 'type': 'str'}, 1252 'name': {'key': 'name', 'type': 'str'}, 1253 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, 1254 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, 1255 } 1256 1257 def __init__( 1258 self, 1259 *, 1260 connection_string: str, 1261 name: str, 1262 subscription_id: Optional[str] = None, 1263 resource_group: Optional[str] = None, 1264 **kwargs 1265 ): 1266 super(RoutingEventHubProperties, self).__init__(**kwargs) 1267 self.connection_string = connection_string 1268 self.name = name 1269 self.subscription_id = subscription_id 1270 self.resource_group = resource_group 1271 1272 1273class RoutingProperties(msrest.serialization.Model): 1274 """The routing related properties of the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. 1275 1276 :param endpoints: The properties related to the custom endpoints to which your IoT hub routes 1277 messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all 1278 endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types 1279 for free hubs. 1280 :type endpoints: ~azure.mgmt.iothub.v2017_01_19.models.RoutingEndpoints 1281 :param routes: The list of user-provided routing rules that the IoT hub uses to route messages 1282 to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and 1283 a maximum of 5 routing rules are allowed for free hubs. 1284 :type routes: list[~azure.mgmt.iothub.v2017_01_19.models.RouteProperties] 1285 :param fallback_route: The properties of the route that is used as a fall-back route when none 1286 of the conditions specified in the 'routes' section are met. This is an optional parameter. 1287 When this property is not set, the messages which do not meet any of the conditions specified 1288 in the 'routes' section get routed to the built-in eventhub endpoint. 1289 :type fallback_route: ~azure.mgmt.iothub.v2017_01_19.models.FallbackRouteProperties 1290 """ 1291 1292 _attribute_map = { 1293 'endpoints': {'key': 'endpoints', 'type': 'RoutingEndpoints'}, 1294 'routes': {'key': 'routes', 'type': '[RouteProperties]'}, 1295 'fallback_route': {'key': 'fallbackRoute', 'type': 'FallbackRouteProperties'}, 1296 } 1297 1298 def __init__( 1299 self, 1300 *, 1301 endpoints: Optional["RoutingEndpoints"] = None, 1302 routes: Optional[List["RouteProperties"]] = None, 1303 fallback_route: Optional["FallbackRouteProperties"] = None, 1304 **kwargs 1305 ): 1306 super(RoutingProperties, self).__init__(**kwargs) 1307 self.endpoints = endpoints 1308 self.routes = routes 1309 self.fallback_route = fallback_route 1310 1311 1312class RoutingServiceBusQueueEndpointProperties(msrest.serialization.Model): 1313 """The properties related to service bus queue endpoint types. 1314 1315 All required parameters must be populated in order to send to Azure. 1316 1317 :param connection_string: Required. The connection string of the service bus queue endpoint. 1318 :type connection_string: str 1319 :param name: Required. The name of the service bus queue endpoint. The name can only include 1320 alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 1321 characters. The following names are reserved; events, operationsMonitoringEvents, 1322 fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need 1323 not be the same as the actual queue name. 1324 :type name: str 1325 :param subscription_id: The subscription identifier of the service bus queue endpoint. 1326 :type subscription_id: str 1327 :param resource_group: The name of the resource group of the service bus queue endpoint. 1328 :type resource_group: str 1329 """ 1330 1331 _validation = { 1332 'connection_string': {'required': True}, 1333 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, 1334 } 1335 1336 _attribute_map = { 1337 'connection_string': {'key': 'connectionString', 'type': 'str'}, 1338 'name': {'key': 'name', 'type': 'str'}, 1339 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, 1340 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, 1341 } 1342 1343 def __init__( 1344 self, 1345 *, 1346 connection_string: str, 1347 name: str, 1348 subscription_id: Optional[str] = None, 1349 resource_group: Optional[str] = None, 1350 **kwargs 1351 ): 1352 super(RoutingServiceBusQueueEndpointProperties, self).__init__(**kwargs) 1353 self.connection_string = connection_string 1354 self.name = name 1355 self.subscription_id = subscription_id 1356 self.resource_group = resource_group 1357 1358 1359class RoutingServiceBusTopicEndpointProperties(msrest.serialization.Model): 1360 """The properties related to service bus topic endpoint types. 1361 1362 All required parameters must be populated in order to send to Azure. 1363 1364 :param connection_string: Required. The connection string of the service bus topic endpoint. 1365 :type connection_string: str 1366 :param name: Required. The name of the service bus topic endpoint. The name can only include 1367 alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 1368 characters. The following names are reserved; events, operationsMonitoringEvents, 1369 fileNotifications, $default. Endpoint names must be unique across endpoint types. The name 1370 need not be the same as the actual topic name. 1371 :type name: str 1372 :param subscription_id: The subscription identifier of the service bus topic endpoint. 1373 :type subscription_id: str 1374 :param resource_group: The name of the resource group of the service bus topic endpoint. 1375 :type resource_group: str 1376 """ 1377 1378 _validation = { 1379 'connection_string': {'required': True}, 1380 'name': {'required': True, 'pattern': r'^[A-Za-z0-9-._]{1,64}$'}, 1381 } 1382 1383 _attribute_map = { 1384 'connection_string': {'key': 'connectionString', 'type': 'str'}, 1385 'name': {'key': 'name', 'type': 'str'}, 1386 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, 1387 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, 1388 } 1389 1390 def __init__( 1391 self, 1392 *, 1393 connection_string: str, 1394 name: str, 1395 subscription_id: Optional[str] = None, 1396 resource_group: Optional[str] = None, 1397 **kwargs 1398 ): 1399 super(RoutingServiceBusTopicEndpointProperties, self).__init__(**kwargs) 1400 self.connection_string = connection_string 1401 self.name = name 1402 self.subscription_id = subscription_id 1403 self.resource_group = resource_group 1404 1405 1406class SharedAccessSignatureAuthorizationRule(msrest.serialization.Model): 1407 """The properties of an IoT hub shared access policy. 1408 1409 All required parameters must be populated in order to send to Azure. 1410 1411 :param key_name: Required. The name of the shared access policy. 1412 :type key_name: str 1413 :param primary_key: The primary key. 1414 :type primary_key: str 1415 :param secondary_key: The secondary key. 1416 :type secondary_key: str 1417 :param rights: Required. The permissions assigned to the shared access policy. Possible values 1418 include: "RegistryRead", "RegistryWrite", "ServiceConnect", "DeviceConnect", "RegistryRead, 1419 RegistryWrite", "RegistryRead, ServiceConnect", "RegistryRead, DeviceConnect", "RegistryWrite, 1420 ServiceConnect", "RegistryWrite, DeviceConnect", "ServiceConnect, DeviceConnect", 1421 "RegistryRead, RegistryWrite, ServiceConnect", "RegistryRead, RegistryWrite, DeviceConnect", 1422 "RegistryRead, ServiceConnect, DeviceConnect", "RegistryWrite, ServiceConnect, DeviceConnect", 1423 "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect". 1424 :type rights: str or ~azure.mgmt.iothub.v2017_01_19.models.AccessRights 1425 """ 1426 1427 _validation = { 1428 'key_name': {'required': True}, 1429 'rights': {'required': True}, 1430 } 1431 1432 _attribute_map = { 1433 'key_name': {'key': 'keyName', 'type': 'str'}, 1434 'primary_key': {'key': 'primaryKey', 'type': 'str'}, 1435 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, 1436 'rights': {'key': 'rights', 'type': 'str'}, 1437 } 1438 1439 def __init__( 1440 self, 1441 *, 1442 key_name: str, 1443 rights: Union[str, "AccessRights"], 1444 primary_key: Optional[str] = None, 1445 secondary_key: Optional[str] = None, 1446 **kwargs 1447 ): 1448 super(SharedAccessSignatureAuthorizationRule, self).__init__(**kwargs) 1449 self.key_name = key_name 1450 self.primary_key = primary_key 1451 self.secondary_key = secondary_key 1452 self.rights = rights 1453 1454 1455class SharedAccessSignatureAuthorizationRuleListResult(msrest.serialization.Model): 1456 """The list of shared access policies with a next link. 1457 1458 Variables are only populated by the server, and will be ignored when sending a request. 1459 1460 :param value: The list of shared access policies. 1461 :type value: list[~azure.mgmt.iothub.v2017_01_19.models.SharedAccessSignatureAuthorizationRule] 1462 :ivar next_link: The next link. 1463 :vartype next_link: str 1464 """ 1465 1466 _validation = { 1467 'next_link': {'readonly': True}, 1468 } 1469 1470 _attribute_map = { 1471 'value': {'key': 'value', 'type': '[SharedAccessSignatureAuthorizationRule]'}, 1472 'next_link': {'key': 'nextLink', 'type': 'str'}, 1473 } 1474 1475 def __init__( 1476 self, 1477 *, 1478 value: Optional[List["SharedAccessSignatureAuthorizationRule"]] = None, 1479 **kwargs 1480 ): 1481 super(SharedAccessSignatureAuthorizationRuleListResult, self).__init__(**kwargs) 1482 self.value = value 1483 self.next_link = None 1484 1485 1486class StorageEndpointProperties(msrest.serialization.Model): 1487 """The properties of the Azure Storage endpoint for file upload. 1488 1489 All required parameters must be populated in order to send to Azure. 1490 1491 :param sas_ttl_as_iso8601: The period of time for which the SAS URI generated by IoT Hub for 1492 file upload is valid. See: 1493 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. 1494 :type sas_ttl_as_iso8601: ~datetime.timedelta 1495 :param connection_string: Required. The connection string for the Azure Storage account to 1496 which files are uploaded. 1497 :type connection_string: str 1498 :param container_name: Required. The name of the root container where you upload files. The 1499 container need not exist but should be creatable using the connectionString specified. 1500 :type container_name: str 1501 """ 1502 1503 _validation = { 1504 'connection_string': {'required': True}, 1505 'container_name': {'required': True}, 1506 } 1507 1508 _attribute_map = { 1509 'sas_ttl_as_iso8601': {'key': 'sasTtlAsIso8601', 'type': 'duration'}, 1510 'connection_string': {'key': 'connectionString', 'type': 'str'}, 1511 'container_name': {'key': 'containerName', 'type': 'str'}, 1512 } 1513 1514 def __init__( 1515 self, 1516 *, 1517 connection_string: str, 1518 container_name: str, 1519 sas_ttl_as_iso8601: Optional[datetime.timedelta] = None, 1520 **kwargs 1521 ): 1522 super(StorageEndpointProperties, self).__init__(**kwargs) 1523 self.sas_ttl_as_iso8601 = sas_ttl_as_iso8601 1524 self.connection_string = connection_string 1525 self.container_name = container_name 1526