Skip to content

Commit

Permalink
azure-mgmt-iothub 0.5.0 (#2324)
Browse files Browse the repository at this point in the history
* Generated from 3bbd0c484bc34bd20352ebe200384d3b3d73c035 (#2319)

Add package-2018-01 to Go SDK build

* Generated from 84221cca19047cc8e97f40fe7a4ad464a4f2f82a (#2390)

Add package-2018-04

* Update version.py

* azure-mgmt-iothub 0.5.0

* Adapt IoTHub tests for new ApiVersion
  • Loading branch information
AutorestCI authored and lmazuel committed Apr 17, 2018
1 parent 00f4fdf commit 241e7c7
Show file tree
Hide file tree
Showing 96 changed files with 3,198 additions and 868 deletions.
37 changes: 37 additions & 0 deletions azure-mgmt-iothub/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,43 @@
Release History
===============

0.5.0 (2018-04-17)
++++++++++++++++++

**General Breaking changes**

This version uses a next-generation code generator that *might* introduce breaking changes.

- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments.
To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments.
- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.
While this is not a breaking change, the distinctions are important, and are documented here:
https://docs.python.org/3/library/enum.html#others
At a glance:

- "is" should not be used at all.
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered.

- New Long Running Operation:

- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
the response of the initial call will be returned without polling.
- `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`.
- `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away.

**Bugfixes**

- Compatibility of the sdist with wheel 0.31.0

**Features**

- Add new ApiVersion 2018-04-01


0.4.0 (2017-10-11)
++++++++++++++++++

Expand Down
6 changes: 3 additions & 3 deletions azure-mgmt-iothub/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure IoTHub Management Client Library.
Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6.
This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down Expand Up @@ -37,8 +37,8 @@ Usage
=====

For code examples, see `IoTHub Management
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-iothub.html>`__
on readthedocs.org.
<https://docs.microsoft.com/python/api/overview/azure/iot>`__
on docs.microsoft.com.


Provide Feedback
Expand Down
6 changes: 2 additions & 4 deletions azure-mgmt-iothub/azure/mgmt/iothub/iot_hub_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ def __init__(
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not isinstance(subscription_id, str):
raise TypeError("Parameter 'subscription_id' must be str.")
if not base_url:
base_url = 'https://management.azure.com'

super(IotHubClientConfiguration, self).__init__(base_url)

self.add_user_agent('iothubclient/{}'.format(VERSION))
self.add_user_agent('azure-mgmt-iothub/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
Expand Down Expand Up @@ -81,7 +79,7 @@ def __init__(
self._client = ServiceClient(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2017-07-01'
self.api_version = '2018-04-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
129 changes: 87 additions & 42 deletions azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,94 @@
# regenerated.
# --------------------------------------------------------------------------

from .certificate_verification_description import CertificateVerificationDescription
from .certificate_body_description import CertificateBodyDescription
from .certificate_properties import CertificateProperties
from .certificate_description import CertificateDescription
from .certificate_list_description import CertificateListDescription
from .certificate_properties_with_nonce import CertificatePropertiesWithNonce
from .certificate_with_nonce_description import CertificateWithNonceDescription
from .shared_access_signature_authorization_rule import SharedAccessSignatureAuthorizationRule
from .ip_filter_rule import IpFilterRule
from .event_hub_properties import EventHubProperties
from .routing_service_bus_queue_endpoint_properties import RoutingServiceBusQueueEndpointProperties
from .routing_service_bus_topic_endpoint_properties import RoutingServiceBusTopicEndpointProperties
from .routing_event_hub_properties import RoutingEventHubProperties
from .routing_storage_container_properties import RoutingStorageContainerProperties
from .routing_endpoints import RoutingEndpoints
from .route_properties import RouteProperties
from .fallback_route_properties import FallbackRouteProperties
from .routing_properties import RoutingProperties
from .storage_endpoint_properties import StorageEndpointProperties
from .messaging_endpoint_properties import MessagingEndpointProperties
from .feedback_properties import FeedbackProperties
from .cloud_to_device_properties import CloudToDeviceProperties
from .operations_monitoring_properties import OperationsMonitoringProperties
from .iot_hub_properties import IotHubProperties
from .iot_hub_sku_info import IotHubSkuInfo
from .iot_hub_description import IotHubDescription
from .resource import Resource
from .operation_display import OperationDisplay
from .operation import Operation
from .error_details import ErrorDetails, ErrorDetailsException
from .iot_hub_quota_metric_info import IotHubQuotaMetricInfo
from .registry_statistics import RegistryStatistics
from .job_response import JobResponse
from .iot_hub_capacity import IotHubCapacity
from .iot_hub_sku_description import IotHubSkuDescription
from .event_hub_consumer_group_info import EventHubConsumerGroupInfo
from .operation_inputs import OperationInputs
from .iot_hub_name_availability_info import IotHubNameAvailabilityInfo
from .export_devices_request import ExportDevicesRequest
from .import_devices_request import ImportDevicesRequest
try:
from .certificate_verification_description_py3 import CertificateVerificationDescription
from .certificate_body_description_py3 import CertificateBodyDescription
from .certificate_properties_py3 import CertificateProperties
from .certificate_description_py3 import CertificateDescription
from .certificate_list_description_py3 import CertificateListDescription
from .certificate_properties_with_nonce_py3 import CertificatePropertiesWithNonce
from .certificate_with_nonce_description_py3 import CertificateWithNonceDescription
from .shared_access_signature_authorization_rule_py3 import SharedAccessSignatureAuthorizationRule
from .ip_filter_rule_py3 import IpFilterRule
from .event_hub_properties_py3 import EventHubProperties
from .routing_service_bus_queue_endpoint_properties_py3 import RoutingServiceBusQueueEndpointProperties
from .routing_service_bus_topic_endpoint_properties_py3 import RoutingServiceBusTopicEndpointProperties
from .routing_event_hub_properties_py3 import RoutingEventHubProperties
from .routing_storage_container_properties_py3 import RoutingStorageContainerProperties
from .routing_endpoints_py3 import RoutingEndpoints
from .route_properties_py3 import RouteProperties
from .fallback_route_properties_py3 import FallbackRouteProperties
from .routing_properties_py3 import RoutingProperties
from .storage_endpoint_properties_py3 import StorageEndpointProperties
from .messaging_endpoint_properties_py3 import MessagingEndpointProperties
from .feedback_properties_py3 import FeedbackProperties
from .cloud_to_device_properties_py3 import CloudToDeviceProperties
from .operations_monitoring_properties_py3 import OperationsMonitoringProperties
from .iot_hub_properties_py3 import IotHubProperties
from .iot_hub_sku_info_py3 import IotHubSkuInfo
from .iot_hub_description_py3 import IotHubDescription
from .resource_py3 import Resource
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .error_details_py3 import ErrorDetails, ErrorDetailsException
from .iot_hub_quota_metric_info_py3 import IotHubQuotaMetricInfo
from .registry_statistics_py3 import RegistryStatistics
from .job_response_py3 import JobResponse
from .iot_hub_capacity_py3 import IotHubCapacity
from .iot_hub_sku_description_py3 import IotHubSkuDescription
from .tags_resource_py3 import TagsResource
from .event_hub_consumer_group_info_py3 import EventHubConsumerGroupInfo
from .operation_inputs_py3 import OperationInputs
from .iot_hub_name_availability_info_py3 import IotHubNameAvailabilityInfo
from .export_devices_request_py3 import ExportDevicesRequest
from .import_devices_request_py3 import ImportDevicesRequest
except (SyntaxError, ImportError):
from .certificate_verification_description import CertificateVerificationDescription
from .certificate_body_description import CertificateBodyDescription
from .certificate_properties import CertificateProperties
from .certificate_description import CertificateDescription
from .certificate_list_description import CertificateListDescription
from .certificate_properties_with_nonce import CertificatePropertiesWithNonce
from .certificate_with_nonce_description import CertificateWithNonceDescription
from .shared_access_signature_authorization_rule import SharedAccessSignatureAuthorizationRule
from .ip_filter_rule import IpFilterRule
from .event_hub_properties import EventHubProperties
from .routing_service_bus_queue_endpoint_properties import RoutingServiceBusQueueEndpointProperties
from .routing_service_bus_topic_endpoint_properties import RoutingServiceBusTopicEndpointProperties
from .routing_event_hub_properties import RoutingEventHubProperties
from .routing_storage_container_properties import RoutingStorageContainerProperties
from .routing_endpoints import RoutingEndpoints
from .route_properties import RouteProperties
from .fallback_route_properties import FallbackRouteProperties
from .routing_properties import RoutingProperties
from .storage_endpoint_properties import StorageEndpointProperties
from .messaging_endpoint_properties import MessagingEndpointProperties
from .feedback_properties import FeedbackProperties
from .cloud_to_device_properties import CloudToDeviceProperties
from .operations_monitoring_properties import OperationsMonitoringProperties
from .iot_hub_properties import IotHubProperties
from .iot_hub_sku_info import IotHubSkuInfo
from .iot_hub_description import IotHubDescription
from .resource import Resource
from .operation_display import OperationDisplay
from .operation import Operation
from .error_details import ErrorDetails, ErrorDetailsException
from .iot_hub_quota_metric_info import IotHubQuotaMetricInfo
from .registry_statistics import RegistryStatistics
from .job_response import JobResponse
from .iot_hub_capacity import IotHubCapacity
from .iot_hub_sku_description import IotHubSkuDescription
from .tags_resource import TagsResource
from .event_hub_consumer_group_info import EventHubConsumerGroupInfo
from .operation_inputs import OperationInputs
from .iot_hub_name_availability_info import IotHubNameAvailabilityInfo
from .export_devices_request import ExportDevicesRequest
from .import_devices_request import ImportDevicesRequest
from .operation_paged import OperationPaged
from .iot_hub_description_paged import IotHubDescriptionPaged
from .iot_hub_sku_description_paged import IotHubSkuDescriptionPaged
from .str_paged import StrPaged
from .event_hub_consumer_group_info_paged import EventHubConsumerGroupInfoPaged
from .job_response_paged import JobResponsePaged
from .iot_hub_quota_metric_info_paged import IotHubQuotaMetricInfoPaged
from .shared_access_signature_authorization_rule_paged import SharedAccessSignatureAuthorizationRulePaged
Expand Down Expand Up @@ -106,6 +150,7 @@
'JobResponse',
'IotHubCapacity',
'IotHubSkuDescription',
'TagsResource',
'EventHubConsumerGroupInfo',
'OperationInputs',
'IotHubNameAvailabilityInfo',
Expand All @@ -114,7 +159,7 @@
'OperationPaged',
'IotHubDescriptionPaged',
'IotHubSkuDescriptionPaged',
'StrPaged',
'EventHubConsumerGroupInfoPaged',
'JobResponsePaged',
'IotHubQuotaMetricInfoPaged',
'SharedAccessSignatureAuthorizationRulePaged',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ class CertificateBodyDescription(Model):
'certificate': {'key': 'certificate', 'type': 'str'},
}

def __init__(self, certificate=None):
self.certificate = certificate
def __init__(self, **kwargs):
super(CertificateBodyDescription, self).__init__(**kwargs)
self.certificate = kwargs.get('certificate', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CertificateBodyDescription(Model):
"""The JSON-serialized X509 Certificate.
:param certificate: base-64 representation of the X509 leaf certificate
.cer file or just .pem file content.
:type certificate: str
"""

_attribute_map = {
'certificate': {'key': 'certificate', 'type': 'str'},
}

def __init__(self, *, certificate: str=None, **kwargs) -> None:
super(CertificateBodyDescription, self).__init__(**kwargs)
self.certificate = certificate
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class CertificateDescription(Model):
sending a request.
:param properties:
:type properties: :class:`CertificateProperties
<azure.mgmt.iothub.models.CertificateProperties>`
:type properties: ~azure.mgmt.iothub.models.CertificateProperties
:ivar id: The resource identifier.
:vartype id: str
:ivar name: The name of the certificate.
Expand All @@ -46,8 +45,9 @@ class CertificateDescription(Model):
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self, properties=None):
self.properties = properties
def __init__(self, **kwargs):
super(CertificateDescription, self).__init__(**kwargs)
self.properties = kwargs.get('properties', None)
self.id = None
self.name = None
self.etag = None
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CertificateDescription(Model):
"""The X509 Certificate.
Variables are only populated by the server, and will be ignored when
sending a request.
:param properties:
:type properties: ~azure.mgmt.iothub.models.CertificateProperties
:ivar id: The resource identifier.
:vartype id: str
:ivar name: The name of the certificate.
:vartype name: str
:ivar etag: The entity tag.
:vartype etag: str
:ivar type: The resource type.
:vartype type: str
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'etag': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
'properties': {'key': 'properties', 'type': 'CertificateProperties'},
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'etag': {'key': 'etag', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self, *, properties=None, **kwargs) -> None:
super(CertificateDescription, self).__init__(**kwargs)
self.properties = properties
self.id = None
self.name = None
self.etag = None
self.type = None
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class CertificateListDescription(Model):
"""The JSON-serialized array of Certificate objects.
:param value: The array of Certificate objects.
:type value: list of :class:`CertificateDescription
<azure.mgmt.iothub.models.CertificateDescription>`
:type value: list[~azure.mgmt.iothub.models.CertificateDescription]
"""

_attribute_map = {
'value': {'key': 'value', 'type': '[CertificateDescription]'},
}

def __init__(self, value=None):
self.value = value
def __init__(self, **kwargs):
super(CertificateListDescription, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
Loading

0 comments on commit 241e7c7

Please sign in to comment.