From 27dc559baa3bddd0c53912d7f6d4967c6ed9edef Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 23 May 2018 05:00:04 +0000 Subject: [PATCH] Generated from 7168a53201579dfb220af64389495a2e83d6f5ef Add suppressions for linting errors. Approved by Gaurav --- .../mgmt/notificationhubs/models/__init__.py | 86 ++++-- .../notificationhubs/models/adm_credential.py | 9 +- .../models/adm_credential_py3.py | 36 +++ .../models/apns_credential.py | 19 +- .../models/apns_credential_py3.py | 59 ++++ .../models/baidu_credential.py | 9 +- .../models/baidu_credential_py3.py | 36 +++ .../models/check_availability_parameters.py | 23 +- .../check_availability_parameters_py3.py | 66 +++++ .../models/check_availability_result.py | 11 +- .../models/check_availability_result_py3.py | 56 ++++ .../check_name_availability_response.py | 37 --- .../notificationhubs/models/error_response.py | 46 +++ .../models/error_response_py3.py | 46 +++ .../notificationhubs/models/gcm_credential.py | 7 +- .../models/gcm_credential_py3.py | 32 +++ .../models/mpns_credential.py | 9 +- .../models/mpns_credential_py3.py | 36 +++ .../namespace_create_or_update_parameters.py | 48 ++-- ...mespace_create_or_update_parameters_py3.py | 118 ++++++++ .../models/namespace_patch_parameters.py | 11 +- .../models/namespace_patch_parameters_py3.py | 32 +++ .../models/namespace_resource.py | 48 ++-- .../models/namespace_resource_paged.py | 2 +- .../models/namespace_resource_py3.py | 117 ++++++++ ...ication_hub_create_or_update_parameters.py | 51 ++-- ...ion_hub_create_or_update_parameters_py3.py | 93 ++++++ .../models/notification_hub_resource.py | 51 ++-- .../models/notification_hub_resource_paged.py | 2 +- .../models/notification_hub_resource_py3.py | 92 ++++++ ...tification_hubs_management_client_enums.py | 6 +- ...ity_request_parameters.py => operation.py} | 27 +- .../models/operation_display.py | 46 +++ .../models/operation_display_py3.py | 46 +++ .../models/operation_paged.py | 27 ++ .../notificationhubs/models/operation_py3.py | 39 +++ .../models/pns_credentials_resource.py | 40 ++- .../models/pns_credentials_resource_py3.py | 77 +++++ .../models/policykey_resource.py | 5 +- .../models/policykey_resource_py3.py | 30 ++ .../mgmt/notificationhubs/models/resource.py | 14 +- .../models/resource_list_keys.py | 13 +- .../models/resource_list_keys_py3.py | 46 +++ .../notificationhubs/models/resource_py3.py | 57 ++++ ...zation_rule_create_or_update_parameters.py | 44 +-- ...on_rule_create_or_update_parameters_py3.py | 36 +++ ...d_access_authorization_rule_list_result.py | 34 +++ ...cess_authorization_rule_list_result_py3.py | 34 +++ ...ed_access_authorization_rule_properties.py | 57 +++- ...ccess_authorization_rule_properties_py3.py | 77 +++++ ...ared_access_authorization_rule_resource.py | 57 +++- ...ccess_authorization_rule_resource_paged.py | 2 +- ..._access_authorization_rule_resource_py3.py | 98 +++++++ .../azure/mgmt/notificationhubs/models/sku.py | 22 +- .../mgmt/notificationhubs/models/sku_py3.py | 51 ++++ .../notificationhubs/models/sub_resource.py | 5 +- .../models/sub_resource_py3.py | 28 ++ .../notificationhubs/models/wns_credential.py | 9 +- .../models/wns_credential_py3.py | 36 +++ .../notification_hubs_management_client.py | 25 +- .../notificationhubs/operations/__init__.py | 6 +- .../operations/hubs_operations.py | 106 ------- .../operations/name_operations.py | 102 ------- .../operations/namespaces_operations.py | 270 ++++++++++-------- .../notification_hubs_operations.py | 170 ++++++----- .../notificationhubs/operations/operations.py | 97 +++++++ .../azure/mgmt/notificationhubs/version.py | 2 +- 67 files changed, 2375 insertions(+), 754 deletions(-) create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/adm_credential_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/baidu_credential_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_parameters_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_result_py3.py delete mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_name_availability_response.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/gcm_credential_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_patch_parameters_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_create_or_update_parameters_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource_py3.py rename azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/{check_name_availability_request_parameters.py => operation.py} (52%) create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_display.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_display_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_paged.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/pns_credentials_resource_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_list_keys_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_create_or_update_parameters_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_list_result.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_list_result_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_properties_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sku_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sub_resource_py3.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/wns_credential_py3.py delete mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/hubs_operations.py delete mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/name_operations.py create mode 100644 azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/operations.py diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/__init__.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/__init__.py index e131516f02d1..fa659d0d218c 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/__init__.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/__init__.py @@ -9,30 +9,61 @@ # regenerated. # -------------------------------------------------------------------------- -from .check_name_availability_request_parameters import CheckNameAvailabilityRequestParameters -from .check_name_availability_response import CheckNameAvailabilityResponse -from .sku import Sku -from .check_availability_parameters import CheckAvailabilityParameters -from .check_availability_result import CheckAvailabilityResult -from .namespace_create_or_update_parameters import NamespaceCreateOrUpdateParameters -from .namespace_patch_parameters import NamespacePatchParameters -from .namespace_resource import NamespaceResource -from .shared_access_authorization_rule_properties import SharedAccessAuthorizationRuleProperties -from .shared_access_authorization_rule_create_or_update_parameters import SharedAccessAuthorizationRuleCreateOrUpdateParameters -from .shared_access_authorization_rule_resource import SharedAccessAuthorizationRuleResource -from .resource_list_keys import ResourceListKeys -from .policykey_resource import PolicykeyResource -from .apns_credential import ApnsCredential -from .wns_credential import WnsCredential -from .gcm_credential import GcmCredential -from .mpns_credential import MpnsCredential -from .adm_credential import AdmCredential -from .baidu_credential import BaiduCredential -from .notification_hub_create_or_update_parameters import NotificationHubCreateOrUpdateParameters -from .notification_hub_resource import NotificationHubResource -from .pns_credentials_resource import PnsCredentialsResource -from .resource import Resource -from .sub_resource import SubResource +try: + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .sku_py3 import Sku + from .check_availability_parameters_py3 import CheckAvailabilityParameters + from .check_availability_result_py3 import CheckAvailabilityResult + from .namespace_create_or_update_parameters_py3 import NamespaceCreateOrUpdateParameters + from .namespace_patch_parameters_py3 import NamespacePatchParameters + from .namespace_resource_py3 import NamespaceResource + from .shared_access_authorization_rule_properties_py3 import SharedAccessAuthorizationRuleProperties + from .shared_access_authorization_rule_create_or_update_parameters_py3 import SharedAccessAuthorizationRuleCreateOrUpdateParameters + from .shared_access_authorization_rule_resource_py3 import SharedAccessAuthorizationRuleResource + from .shared_access_authorization_rule_list_result_py3 import SharedAccessAuthorizationRuleListResult + from .resource_list_keys_py3 import ResourceListKeys + from .policykey_resource_py3 import PolicykeyResource + from .apns_credential_py3 import ApnsCredential + from .wns_credential_py3 import WnsCredential + from .gcm_credential_py3 import GcmCredential + from .mpns_credential_py3 import MpnsCredential + from .adm_credential_py3 import AdmCredential + from .baidu_credential_py3 import BaiduCredential + from .notification_hub_create_or_update_parameters_py3 import NotificationHubCreateOrUpdateParameters + from .notification_hub_resource_py3 import NotificationHubResource + from .pns_credentials_resource_py3 import PnsCredentialsResource + from .resource_py3 import Resource + from .sub_resource_py3 import SubResource +except (SyntaxError, ImportError): + from .operation_display import OperationDisplay + from .operation import Operation + from .error_response import ErrorResponse, ErrorResponseException + from .sku import Sku + from .check_availability_parameters import CheckAvailabilityParameters + from .check_availability_result import CheckAvailabilityResult + from .namespace_create_or_update_parameters import NamespaceCreateOrUpdateParameters + from .namespace_patch_parameters import NamespacePatchParameters + from .namespace_resource import NamespaceResource + from .shared_access_authorization_rule_properties import SharedAccessAuthorizationRuleProperties + from .shared_access_authorization_rule_create_or_update_parameters import SharedAccessAuthorizationRuleCreateOrUpdateParameters + from .shared_access_authorization_rule_resource import SharedAccessAuthorizationRuleResource + from .shared_access_authorization_rule_list_result import SharedAccessAuthorizationRuleListResult + from .resource_list_keys import ResourceListKeys + from .policykey_resource import PolicykeyResource + from .apns_credential import ApnsCredential + from .wns_credential import WnsCredential + from .gcm_credential import GcmCredential + from .mpns_credential import MpnsCredential + from .adm_credential import AdmCredential + from .baidu_credential import BaiduCredential + from .notification_hub_create_or_update_parameters import NotificationHubCreateOrUpdateParameters + from .notification_hub_resource import NotificationHubResource + from .pns_credentials_resource import PnsCredentialsResource + from .resource import Resource + from .sub_resource import SubResource +from .operation_paged import OperationPaged from .namespace_resource_paged import NamespaceResourcePaged from .shared_access_authorization_rule_resource_paged import SharedAccessAuthorizationRuleResourcePaged from .notification_hub_resource_paged import NotificationHubResourcePaged @@ -43,8 +74,9 @@ ) __all__ = [ - 'CheckNameAvailabilityRequestParameters', - 'CheckNameAvailabilityResponse', + 'OperationDisplay', + 'Operation', + 'ErrorResponse', 'ErrorResponseException', 'Sku', 'CheckAvailabilityParameters', 'CheckAvailabilityResult', @@ -54,6 +86,7 @@ 'SharedAccessAuthorizationRuleProperties', 'SharedAccessAuthorizationRuleCreateOrUpdateParameters', 'SharedAccessAuthorizationRuleResource', + 'SharedAccessAuthorizationRuleListResult', 'ResourceListKeys', 'PolicykeyResource', 'ApnsCredential', @@ -67,6 +100,7 @@ 'PnsCredentialsResource', 'Resource', 'SubResource', + 'OperationPaged', 'NamespaceResourcePaged', 'SharedAccessAuthorizationRuleResourcePaged', 'NotificationHubResourcePaged', diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/adm_credential.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/adm_credential.py index 3d06c0e26e9e..de14a2dff39b 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/adm_credential.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/adm_credential.py @@ -29,7 +29,8 @@ class AdmCredential(Model): 'auth_token_url': {'key': 'properties.authTokenUrl', 'type': 'str'}, } - def __init__(self, client_id=None, client_secret=None, auth_token_url=None): - self.client_id = client_id - self.client_secret = client_secret - self.auth_token_url = auth_token_url + def __init__(self, **kwargs): + super(AdmCredential, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) + self.auth_token_url = kwargs.get('auth_token_url', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/adm_credential_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/adm_credential_py3.py new file mode 100644 index 000000000000..eccb8b0f07ca --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/adm_credential_py3.py @@ -0,0 +1,36 @@ +# 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 AdmCredential(Model): + """Description of a NotificationHub AdmCredential. + + :param client_id: The client identifier. + :type client_id: str + :param client_secret: The credential secret access key. + :type client_secret: str + :param auth_token_url: The URL of the authorization token. + :type auth_token_url: str + """ + + _attribute_map = { + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'auth_token_url': {'key': 'properties.authTokenUrl', 'type': 'str'}, + } + + def __init__(self, *, client_id: str=None, client_secret: str=None, auth_token_url: str=None, **kwargs) -> None: + super(AdmCredential, self).__init__(**kwargs) + self.client_id = client_id + self.client_secret = client_secret + self.auth_token_url = auth_token_url diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential.py index 2832b2385635..823a6dd3ec2d 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential.py @@ -47,12 +47,13 @@ class ApnsCredential(Model): 'token': {'key': 'properties.token', 'type': 'str'}, } - def __init__(self, apns_certificate=None, certificate_key=None, endpoint=None, thumbprint=None, key_id=None, app_name=None, app_id=None, token=None): - self.apns_certificate = apns_certificate - self.certificate_key = certificate_key - self.endpoint = endpoint - self.thumbprint = thumbprint - self.key_id = key_id - self.app_name = app_name - self.app_id = app_id - self.token = token + def __init__(self, **kwargs): + super(ApnsCredential, self).__init__(**kwargs) + self.apns_certificate = kwargs.get('apns_certificate', None) + self.certificate_key = kwargs.get('certificate_key', None) + self.endpoint = kwargs.get('endpoint', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.key_id = kwargs.get('key_id', None) + self.app_name = kwargs.get('app_name', None) + self.app_id = kwargs.get('app_id', None) + self.token = kwargs.get('token', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential_py3.py new file mode 100644 index 000000000000..295a024f5eb2 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential_py3.py @@ -0,0 +1,59 @@ +# 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 ApnsCredential(Model): + """Description of a NotificationHub ApnsCredential. + + :param apns_certificate: The APNS certificate. + :type apns_certificate: str + :param certificate_key: The certificate key. + :type certificate_key: str + :param endpoint: The endpoint of this credential. + :type endpoint: str + :param thumbprint: The Apns certificate Thumbprint + :type thumbprint: str + :param key_id: A 10-character key identifier (kid) key, obtained from your + developer account + :type key_id: str + :param app_name: The name of the application + :type app_name: str + :param app_id: The issuer (iss) registered claim key, whose value is your + 10-character Team ID, obtained from your developer account + :type app_id: str + :param token: Provider Authentication Token, obtained through your + developer account + :type token: str + """ + + _attribute_map = { + 'apns_certificate': {'key': 'properties.apnsCertificate', 'type': 'str'}, + 'certificate_key': {'key': 'properties.certificateKey', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'key_id': {'key': 'properties.keyId', 'type': 'str'}, + 'app_name': {'key': 'properties.appName', 'type': 'str'}, + 'app_id': {'key': 'properties.appId', 'type': 'str'}, + 'token': {'key': 'properties.token', 'type': 'str'}, + } + + def __init__(self, *, apns_certificate: str=None, certificate_key: str=None, endpoint: str=None, thumbprint: str=None, key_id: str=None, app_name: str=None, app_id: str=None, token: str=None, **kwargs) -> None: + super(ApnsCredential, self).__init__(**kwargs) + self.apns_certificate = apns_certificate + self.certificate_key = certificate_key + self.endpoint = endpoint + self.thumbprint = thumbprint + self.key_id = key_id + self.app_name = app_name + self.app_id = app_id + self.token = token diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/baidu_credential.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/baidu_credential.py index 668631f8d4f2..e43621a5307b 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/baidu_credential.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/baidu_credential.py @@ -29,7 +29,8 @@ class BaiduCredential(Model): 'baidu_secret_key': {'key': 'properties.baiduSecretKey', 'type': 'str'}, } - def __init__(self, baidu_api_key=None, baidu_end_point=None, baidu_secret_key=None): - self.baidu_api_key = baidu_api_key - self.baidu_end_point = baidu_end_point - self.baidu_secret_key = baidu_secret_key + def __init__(self, **kwargs): + super(BaiduCredential, self).__init__(**kwargs) + self.baidu_api_key = kwargs.get('baidu_api_key', None) + self.baidu_end_point = kwargs.get('baidu_end_point', None) + self.baidu_secret_key = kwargs.get('baidu_secret_key', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/baidu_credential_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/baidu_credential_py3.py new file mode 100644 index 000000000000..97d634443cbb --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/baidu_credential_py3.py @@ -0,0 +1,36 @@ +# 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 BaiduCredential(Model): + """Description of a NotificationHub BaiduCredential. + + :param baidu_api_key: Baidu Api Key. + :type baidu_api_key: str + :param baidu_end_point: Baidu Endpoint. + :type baidu_end_point: str + :param baidu_secret_key: Baidu Secret Key + :type baidu_secret_key: str + """ + + _attribute_map = { + 'baidu_api_key': {'key': 'properties.baiduApiKey', 'type': 'str'}, + 'baidu_end_point': {'key': 'properties.baiduEndPoint', 'type': 'str'}, + 'baidu_secret_key': {'key': 'properties.baiduSecretKey', 'type': 'str'}, + } + + def __init__(self, *, baidu_api_key: str=None, baidu_end_point: str=None, baidu_secret_key: str=None, **kwargs) -> None: + super(BaiduCredential, self).__init__(**kwargs) + self.baidu_api_key = baidu_api_key + self.baidu_end_point = baidu_end_point + self.baidu_secret_key = baidu_secret_key diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_parameters.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_parameters.py index 2e1604aafba2..3ed36a8e0bf3 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_parameters.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_parameters.py @@ -19,18 +19,20 @@ class CheckAvailabilityParameters(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource Id :vartype id: str - :param name: Resource name + :param name: Required. Resource name :type name: str :ivar type: Resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku :param is_availiable: True if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. :type is_availiable: bool @@ -53,11 +55,12 @@ class CheckAvailabilityParameters(Model): 'is_availiable': {'key': 'isAvailiable', 'type': 'bool'}, } - def __init__(self, name, location, tags=None, sku=None, is_availiable=None): + def __init__(self, **kwargs): + super(CheckAvailabilityParameters, self).__init__(**kwargs) self.id = None - self.name = name + self.name = kwargs.get('name', None) self.type = None - self.location = location - self.tags = tags - self.sku = sku - self.is_availiable = is_availiable + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.is_availiable = kwargs.get('is_availiable', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_parameters_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_parameters_py3.py new file mode 100644 index 000000000000..9913fc3c1b0b --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_parameters_py3.py @@ -0,0 +1,66 @@ +# 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 CheckAvailabilityParameters(Model): + """Parameters supplied to the Check Name Availability for Namespace and + NotificationHubs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :param name: Required. Resource name + :type name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + :param is_availiable: True if the name is available and can be used to + create new Namespace/NotificationHub. Otherwise false. + :type is_availiable: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'is_availiable': {'key': 'isAvailiable', 'type': 'bool'}, + } + + def __init__(self, *, name: str, location: str, tags=None, sku=None, is_availiable: bool=None, **kwargs) -> None: + super(CheckAvailabilityParameters, self).__init__(**kwargs) + self.id = None + self.name = name + self.type = None + self.location = location + self.tags = tags + self.sku = sku + self.is_availiable = is_availiable diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_result.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_result.py index a759ce71f7bd..8ad9a11c440b 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_result.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_result.py @@ -27,9 +27,9 @@ class CheckAvailabilityResult(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku :param is_availiable: True if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. :type is_availiable: bool @@ -39,7 +39,6 @@ class CheckAvailabilityResult(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { @@ -52,6 +51,6 @@ class CheckAvailabilityResult(Resource): 'is_availiable': {'key': 'isAvailiable', 'type': 'bool'}, } - def __init__(self, location, tags=None, sku=None, is_availiable=None): - super(CheckAvailabilityResult, self).__init__(location=location, tags=tags, sku=sku) - self.is_availiable = is_availiable + def __init__(self, **kwargs): + super(CheckAvailabilityResult, self).__init__(**kwargs) + self.is_availiable = kwargs.get('is_availiable', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_result_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_result_py3.py new file mode 100644 index 000000000000..64e1ab2ad7de --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_availability_result_py3.py @@ -0,0 +1,56 @@ +# 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 .resource_py3 import Resource + + +class CheckAvailabilityResult(Resource): + """Description of a CheckAvailibility resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + :param is_availiable: True if the name is available and can be used to + create new Namespace/NotificationHub. Otherwise false. + :type is_availiable: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'is_availiable': {'key': 'isAvailiable', 'type': 'bool'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, is_availiable: bool=None, **kwargs) -> None: + super(CheckAvailabilityResult, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.is_availiable = is_availiable diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_name_availability_response.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_name_availability_response.py deleted file mode 100644 index 40cf42202048..000000000000 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_name_availability_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 CheckNameAvailabilityResponse(Model): - """CheckNameAvailabilityResponse. - - :param name_available: Checks if the namespace name is available - :type name_available: bool - :param reason: States the reason due to which the namespace name is not - available - :type reason: str - :param message: The messsage returned when checking for namespace name - availability - :type message: str - """ - - _attribute_map = { - 'name_available': {'key': 'NameAvailable', 'type': 'bool'}, - 'reason': {'key': 'Reason', 'type': 'str'}, - 'message': {'key': 'Message', 'type': 'str'}, - } - - def __init__(self, name_available=None, reason=None, message=None): - self.name_available = name_available - self.reason = reason - self.message = message diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response.py new file mode 100644 index 000000000000..6d7907d66fd4 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response.py @@ -0,0 +1,46 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error reponse indicates NotificationHubs service is not able to process the + incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response_py3.py new file mode 100644 index 000000000000..22530f8dc898 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response_py3.py @@ -0,0 +1,46 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error reponse indicates NotificationHubs service is not able to process the + incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/gcm_credential.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/gcm_credential.py index 83df4fe01316..e7567286c25d 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/gcm_credential.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/gcm_credential.py @@ -26,6 +26,7 @@ class GcmCredential(Model): 'google_api_key': {'key': 'properties.googleApiKey', 'type': 'str'}, } - def __init__(self, gcm_endpoint=None, google_api_key=None): - self.gcm_endpoint = gcm_endpoint - self.google_api_key = google_api_key + def __init__(self, **kwargs): + super(GcmCredential, self).__init__(**kwargs) + self.gcm_endpoint = kwargs.get('gcm_endpoint', None) + self.google_api_key = kwargs.get('google_api_key', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/gcm_credential_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/gcm_credential_py3.py new file mode 100644 index 000000000000..a9f09bfd7a58 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/gcm_credential_py3.py @@ -0,0 +1,32 @@ +# 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 GcmCredential(Model): + """Description of a NotificationHub GcmCredential. + + :param gcm_endpoint: The GCM endpoint. + :type gcm_endpoint: str + :param google_api_key: The Google API key. + :type google_api_key: str + """ + + _attribute_map = { + 'gcm_endpoint': {'key': 'properties.gcmEndpoint', 'type': 'str'}, + 'google_api_key': {'key': 'properties.googleApiKey', 'type': 'str'}, + } + + def __init__(self, *, gcm_endpoint: str=None, google_api_key: str=None, **kwargs) -> None: + super(GcmCredential, self).__init__(**kwargs) + self.gcm_endpoint = gcm_endpoint + self.google_api_key = google_api_key diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential.py index 133ac5287a5c..95ff2e76a3f5 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential.py @@ -29,7 +29,8 @@ class MpnsCredential(Model): 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, } - def __init__(self, mpns_certificate=None, certificate_key=None, thumbprint=None): - self.mpns_certificate = mpns_certificate - self.certificate_key = certificate_key - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(MpnsCredential, self).__init__(**kwargs) + self.mpns_certificate = kwargs.get('mpns_certificate', None) + self.certificate_key = kwargs.get('certificate_key', None) + self.thumbprint = kwargs.get('thumbprint', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential_py3.py new file mode 100644 index 000000000000..a1d2da085167 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential_py3.py @@ -0,0 +1,36 @@ +# 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 MpnsCredential(Model): + """Description of a NotificationHub MpnsCredential. + + :param mpns_certificate: The MPNS certificate. + :type mpns_certificate: str + :param certificate_key: The certificate key for this credential. + :type certificate_key: str + :param thumbprint: The Mpns certificate Thumbprint + :type thumbprint: str + """ + + _attribute_map = { + 'mpns_certificate': {'key': 'properties.mpnsCertificate', 'type': 'str'}, + 'certificate_key': {'key': 'properties.certificateKey', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__(self, *, mpns_certificate: str=None, certificate_key: str=None, thumbprint: str=None, **kwargs) -> None: + super(MpnsCredential, self).__init__(**kwargs) + self.mpns_certificate = mpns_certificate + self.certificate_key = certificate_key + self.thumbprint = thumbprint diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters.py index cbc9efd9298b..4e7ebeb7beb4 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters.py @@ -27,9 +27,9 @@ class NamespaceCreateOrUpdateParameters(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku :param namespace_create_or_update_parameters_name: The name of the namespace. :type namespace_create_or_update_parameters_name: str @@ -41,11 +41,15 @@ class NamespaceCreateOrUpdateParameters(Resource): USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe :type region: str + :ivar metric_id: Identifier for Azure Insights metrics + :vartype metric_id: str :param status: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting :type status: str :param created_at: The time the namespace was created. :type created_at: datetime + :param updated_at: The time the namespace was updated. + :type updated_at: datetime :param service_bus_endpoint: Endpoint you can use to perform NotificationHub operations. :type service_bus_endpoint: str @@ -58,17 +62,19 @@ class NamespaceCreateOrUpdateParameters(Resource): :type enabled: bool :param critical: Whether or not the namespace is set as Critical. :type critical: bool + :param data_center: Data center for the namespace + :type data_center: str :param namespace_type: The namespace type. Possible values include: 'Messaging', 'NotificationHub' - :type namespace_type: str or :class:`NamespaceType - ` + :type namespace_type: str or + ~azure.mgmt.notificationhubs.models.NamespaceType """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, + 'metric_id': {'readonly': True}, } _attribute_map = { @@ -81,26 +87,32 @@ class NamespaceCreateOrUpdateParameters(Resource): 'namespace_create_or_update_parameters_name': {'key': 'properties.name', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'region': {'key': 'properties.region', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, 'scale_unit': {'key': 'properties.scaleUnit', 'type': 'str'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'critical': {'key': 'properties.critical', 'type': 'bool'}, + 'data_center': {'key': 'properties.dataCenter', 'type': 'str'}, 'namespace_type': {'key': 'properties.namespaceType', 'type': 'NamespaceType'}, } - def __init__(self, location, tags=None, sku=None, namespace_create_or_update_parameters_name=None, provisioning_state=None, region=None, status=None, created_at=None, service_bus_endpoint=None, subscription_id=None, scale_unit=None, enabled=None, critical=None, namespace_type=None): - super(NamespaceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku) - self.namespace_create_or_update_parameters_name = namespace_create_or_update_parameters_name - self.provisioning_state = provisioning_state - self.region = region - self.status = status - self.created_at = created_at - self.service_bus_endpoint = service_bus_endpoint - self.subscription_id = subscription_id - self.scale_unit = scale_unit - self.enabled = enabled - self.critical = critical - self.namespace_type = namespace_type + def __init__(self, **kwargs): + super(NamespaceCreateOrUpdateParameters, self).__init__(**kwargs) + self.namespace_create_or_update_parameters_name = kwargs.get('namespace_create_or_update_parameters_name', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.region = kwargs.get('region', None) + self.metric_id = None + self.status = kwargs.get('status', None) + self.created_at = kwargs.get('created_at', None) + self.updated_at = kwargs.get('updated_at', None) + self.service_bus_endpoint = kwargs.get('service_bus_endpoint', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.scale_unit = kwargs.get('scale_unit', None) + self.enabled = kwargs.get('enabled', None) + self.critical = kwargs.get('critical', None) + self.data_center = kwargs.get('data_center', None) + self.namespace_type = kwargs.get('namespace_type', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..f851a4d3507d --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters_py3.py @@ -0,0 +1,118 @@ +# 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 .resource_py3 import Resource + + +class NamespaceCreateOrUpdateParameters(Resource): + """Parameters supplied to the CreateOrUpdate Namespace operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + :param namespace_create_or_update_parameters_name: The name of the + namespace. + :type namespace_create_or_update_parameters_name: str + :param provisioning_state: Provisioning state of the Namespace. + :type provisioning_state: str + :param region: Specifies the targeted region in which the namespace should + be created. It can be any of the following values: Australia EastAustralia + SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest + Europe + :type region: str + :ivar metric_id: Identifier for Azure Insights metrics + :vartype metric_id: str + :param status: Status of the namespace. It can be any of these values:1 = + Created/Active2 = Creating3 = Suspended4 = Deleting + :type status: str + :param created_at: The time the namespace was created. + :type created_at: datetime + :param updated_at: The time the namespace was updated. + :type updated_at: datetime + :param service_bus_endpoint: Endpoint you can use to perform + NotificationHub operations. + :type service_bus_endpoint: str + :param subscription_id: The Id of the Azure subscription associated with + the namespace. + :type subscription_id: str + :param scale_unit: ScaleUnit where the namespace gets created + :type scale_unit: str + :param enabled: Whether or not the namespace is currently enabled. + :type enabled: bool + :param critical: Whether or not the namespace is set as Critical. + :type critical: bool + :param data_center: Data center for the namespace + :type data_center: str + :param namespace_type: The namespace type. Possible values include: + 'Messaging', 'NotificationHub' + :type namespace_type: str or + ~azure.mgmt.notificationhubs.models.NamespaceType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'namespace_create_or_update_parameters_name': {'key': 'properties.name', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'region': {'key': 'properties.region', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'scale_unit': {'key': 'properties.scaleUnit', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'critical': {'key': 'properties.critical', 'type': 'bool'}, + 'data_center': {'key': 'properties.dataCenter', 'type': 'str'}, + 'namespace_type': {'key': 'properties.namespaceType', 'type': 'NamespaceType'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, namespace_create_or_update_parameters_name: str=None, provisioning_state: str=None, region: str=None, status: str=None, created_at=None, updated_at=None, service_bus_endpoint: str=None, subscription_id: str=None, scale_unit: str=None, enabled: bool=None, critical: bool=None, data_center: str=None, namespace_type=None, **kwargs) -> None: + super(NamespaceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.namespace_create_or_update_parameters_name = namespace_create_or_update_parameters_name + self.provisioning_state = provisioning_state + self.region = region + self.metric_id = None + self.status = status + self.created_at = created_at + self.updated_at = updated_at + self.service_bus_endpoint = service_bus_endpoint + self.subscription_id = subscription_id + self.scale_unit = scale_unit + self.enabled = enabled + self.critical = critical + self.data_center = data_center + self.namespace_type = namespace_type diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_patch_parameters.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_patch_parameters.py index 9a523c84ceed..f75f66bd3b55 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_patch_parameters.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_patch_parameters.py @@ -16,9 +16,9 @@ class NamespacePatchParameters(Model): """Parameters supplied to the Patch Namespace operation. :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku """ _attribute_map = { @@ -26,6 +26,7 @@ class NamespacePatchParameters(Model): 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, tags=None, sku=None): - self.tags = tags - self.sku = sku + def __init__(self, **kwargs): + super(NamespacePatchParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_patch_parameters_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_patch_parameters_py3.py new file mode 100644 index 000000000000..d7b1b8473e75 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_patch_parameters_py3.py @@ -0,0 +1,32 @@ +# 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 NamespacePatchParameters(Model): + """Parameters supplied to the Patch Namespace operation. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, tags=None, sku=None, **kwargs) -> None: + super(NamespacePatchParameters, self).__init__(**kwargs) + self.tags = tags + self.sku = sku diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource.py index 93eb3b0ee4e8..0014bd7600ec 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource.py @@ -27,9 +27,9 @@ class NamespaceResource(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku :param namespace_resource_name: The name of the namespace. :type namespace_resource_name: str :param provisioning_state: Provisioning state of the Namespace. @@ -40,11 +40,15 @@ class NamespaceResource(Resource): USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest Europe :type region: str + :ivar metric_id: Identifier for Azure Insights metrics + :vartype metric_id: str :param status: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting :type status: str :param created_at: The time the namespace was created. :type created_at: datetime + :param updated_at: The time the namespace was updated. + :type updated_at: datetime :param service_bus_endpoint: Endpoint you can use to perform NotificationHub operations. :type service_bus_endpoint: str @@ -57,17 +61,19 @@ class NamespaceResource(Resource): :type enabled: bool :param critical: Whether or not the namespace is set as Critical. :type critical: bool + :param data_center: Data center for the namespace + :type data_center: str :param namespace_type: The namespace type. Possible values include: 'Messaging', 'NotificationHub' - :type namespace_type: str or :class:`NamespaceType - ` + :type namespace_type: str or + ~azure.mgmt.notificationhubs.models.NamespaceType """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, + 'metric_id': {'readonly': True}, } _attribute_map = { @@ -80,26 +86,32 @@ class NamespaceResource(Resource): 'namespace_resource_name': {'key': 'properties.name', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'region': {'key': 'properties.region', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, 'scale_unit': {'key': 'properties.scaleUnit', 'type': 'str'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'critical': {'key': 'properties.critical', 'type': 'bool'}, + 'data_center': {'key': 'properties.dataCenter', 'type': 'str'}, 'namespace_type': {'key': 'properties.namespaceType', 'type': 'NamespaceType'}, } - def __init__(self, location, tags=None, sku=None, namespace_resource_name=None, provisioning_state=None, region=None, status=None, created_at=None, service_bus_endpoint=None, subscription_id=None, scale_unit=None, enabled=None, critical=None, namespace_type=None): - super(NamespaceResource, self).__init__(location=location, tags=tags, sku=sku) - self.namespace_resource_name = namespace_resource_name - self.provisioning_state = provisioning_state - self.region = region - self.status = status - self.created_at = created_at - self.service_bus_endpoint = service_bus_endpoint - self.subscription_id = subscription_id - self.scale_unit = scale_unit - self.enabled = enabled - self.critical = critical - self.namespace_type = namespace_type + def __init__(self, **kwargs): + super(NamespaceResource, self).__init__(**kwargs) + self.namespace_resource_name = kwargs.get('namespace_resource_name', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.region = kwargs.get('region', None) + self.metric_id = None + self.status = kwargs.get('status', None) + self.created_at = kwargs.get('created_at', None) + self.updated_at = kwargs.get('updated_at', None) + self.service_bus_endpoint = kwargs.get('service_bus_endpoint', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.scale_unit = kwargs.get('scale_unit', None) + self.enabled = kwargs.get('enabled', None) + self.critical = kwargs.get('critical', None) + self.data_center = kwargs.get('data_center', None) + self.namespace_type = kwargs.get('namespace_type', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource_paged.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource_paged.py index 0ded738bc09c..3cab77ffaf99 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource_paged.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource_paged.py @@ -14,7 +14,7 @@ class NamespaceResourcePaged(Paged): """ - A paging container for iterating over a list of NamespaceResource object + A paging container for iterating over a list of :class:`NamespaceResource ` object """ _attribute_map = { diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource_py3.py new file mode 100644 index 000000000000..bbd58e897f9e --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_resource_py3.py @@ -0,0 +1,117 @@ +# 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 .resource_py3 import Resource + + +class NamespaceResource(Resource): + """Description of a Namespace resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + :param namespace_resource_name: The name of the namespace. + :type namespace_resource_name: str + :param provisioning_state: Provisioning state of the Namespace. + :type provisioning_state: str + :param region: Specifies the targeted region in which the namespace should + be created. It can be any of the following values: Australia EastAustralia + SoutheastCentral USEast USEast US 2West USNorth Central USSouth Central + USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan WestNorth EuropeWest + Europe + :type region: str + :ivar metric_id: Identifier for Azure Insights metrics + :vartype metric_id: str + :param status: Status of the namespace. It can be any of these values:1 = + Created/Active2 = Creating3 = Suspended4 = Deleting + :type status: str + :param created_at: The time the namespace was created. + :type created_at: datetime + :param updated_at: The time the namespace was updated. + :type updated_at: datetime + :param service_bus_endpoint: Endpoint you can use to perform + NotificationHub operations. + :type service_bus_endpoint: str + :param subscription_id: The Id of the Azure subscription associated with + the namespace. + :type subscription_id: str + :param scale_unit: ScaleUnit where the namespace gets created + :type scale_unit: str + :param enabled: Whether or not the namespace is currently enabled. + :type enabled: bool + :param critical: Whether or not the namespace is set as Critical. + :type critical: bool + :param data_center: Data center for the namespace + :type data_center: str + :param namespace_type: The namespace type. Possible values include: + 'Messaging', 'NotificationHub' + :type namespace_type: str or + ~azure.mgmt.notificationhubs.models.NamespaceType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'namespace_resource_name': {'key': 'properties.name', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'region': {'key': 'properties.region', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'scale_unit': {'key': 'properties.scaleUnit', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'critical': {'key': 'properties.critical', 'type': 'bool'}, + 'data_center': {'key': 'properties.dataCenter', 'type': 'str'}, + 'namespace_type': {'key': 'properties.namespaceType', 'type': 'NamespaceType'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, namespace_resource_name: str=None, provisioning_state: str=None, region: str=None, status: str=None, created_at=None, updated_at=None, service_bus_endpoint: str=None, subscription_id: str=None, scale_unit: str=None, enabled: bool=None, critical: bool=None, data_center: str=None, namespace_type=None, **kwargs) -> None: + super(NamespaceResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.namespace_resource_name = namespace_resource_name + self.provisioning_state = provisioning_state + self.region = region + self.metric_id = None + self.status = status + self.created_at = created_at + self.updated_at = updated_at + self.service_bus_endpoint = service_bus_endpoint + self.subscription_id = subscription_id + self.scale_unit = scale_unit + self.enabled = enabled + self.critical = critical + self.data_center = data_center + self.namespace_type = namespace_type diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_create_or_update_parameters.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_create_or_update_parameters.py index 306984aa11b4..e82f1174d70a 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_create_or_update_parameters.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_create_or_update_parameters.py @@ -27,9 +27,9 @@ class NotificationHubCreateOrUpdateParameters(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku :param notification_hub_create_or_update_parameters_name: The NotificationHub name. :type notification_hub_create_or_update_parameters_name: str @@ -38,35 +38,28 @@ class NotificationHubCreateOrUpdateParameters(Resource): :type registration_ttl: str :param authorization_rules: The AuthorizationRules of the created NotificationHub - :type authorization_rules: list of - :class:`SharedAccessAuthorizationRuleProperties - ` + :type authorization_rules: + list[~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleProperties] :param apns_credential: The ApnsCredential of the created NotificationHub - :type apns_credential: :class:`ApnsCredential - ` + :type apns_credential: ~azure.mgmt.notificationhubs.models.ApnsCredential :param wns_credential: The WnsCredential of the created NotificationHub - :type wns_credential: :class:`WnsCredential - ` + :type wns_credential: ~azure.mgmt.notificationhubs.models.WnsCredential :param gcm_credential: The GcmCredential of the created NotificationHub - :type gcm_credential: :class:`GcmCredential - ` + :type gcm_credential: ~azure.mgmt.notificationhubs.models.GcmCredential :param mpns_credential: The MpnsCredential of the created NotificationHub - :type mpns_credential: :class:`MpnsCredential - ` + :type mpns_credential: ~azure.mgmt.notificationhubs.models.MpnsCredential :param adm_credential: The AdmCredential of the created NotificationHub - :type adm_credential: :class:`AdmCredential - ` + :type adm_credential: ~azure.mgmt.notificationhubs.models.AdmCredential :param baidu_credential: The BaiduCredential of the created NotificationHub - :type baidu_credential: :class:`BaiduCredential - ` + :type baidu_credential: + ~azure.mgmt.notificationhubs.models.BaiduCredential """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { @@ -87,14 +80,14 @@ class NotificationHubCreateOrUpdateParameters(Resource): 'baidu_credential': {'key': 'properties.baiduCredential', 'type': 'BaiduCredential'}, } - def __init__(self, location, tags=None, sku=None, notification_hub_create_or_update_parameters_name=None, registration_ttl=None, authorization_rules=None, apns_credential=None, wns_credential=None, gcm_credential=None, mpns_credential=None, adm_credential=None, baidu_credential=None): - super(NotificationHubCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku) - self.notification_hub_create_or_update_parameters_name = notification_hub_create_or_update_parameters_name - self.registration_ttl = registration_ttl - self.authorization_rules = authorization_rules - self.apns_credential = apns_credential - self.wns_credential = wns_credential - self.gcm_credential = gcm_credential - self.mpns_credential = mpns_credential - self.adm_credential = adm_credential - self.baidu_credential = baidu_credential + def __init__(self, **kwargs): + super(NotificationHubCreateOrUpdateParameters, self).__init__(**kwargs) + self.notification_hub_create_or_update_parameters_name = kwargs.get('notification_hub_create_or_update_parameters_name', None) + self.registration_ttl = kwargs.get('registration_ttl', None) + self.authorization_rules = kwargs.get('authorization_rules', None) + self.apns_credential = kwargs.get('apns_credential', None) + self.wns_credential = kwargs.get('wns_credential', None) + self.gcm_credential = kwargs.get('gcm_credential', None) + self.mpns_credential = kwargs.get('mpns_credential', None) + self.adm_credential = kwargs.get('adm_credential', None) + self.baidu_credential = kwargs.get('baidu_credential', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_create_or_update_parameters_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..7b97c00d588f --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_create_or_update_parameters_py3.py @@ -0,0 +1,93 @@ +# 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 .resource_py3 import Resource + + +class NotificationHubCreateOrUpdateParameters(Resource): + """Parameters supplied to the CreateOrUpdate NotificationHub operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + :param notification_hub_create_or_update_parameters_name: The + NotificationHub name. + :type notification_hub_create_or_update_parameters_name: str + :param registration_ttl: The RegistrationTtl of the created + NotificationHub + :type registration_ttl: str + :param authorization_rules: The AuthorizationRules of the created + NotificationHub + :type authorization_rules: + list[~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleProperties] + :param apns_credential: The ApnsCredential of the created NotificationHub + :type apns_credential: ~azure.mgmt.notificationhubs.models.ApnsCredential + :param wns_credential: The WnsCredential of the created NotificationHub + :type wns_credential: ~azure.mgmt.notificationhubs.models.WnsCredential + :param gcm_credential: The GcmCredential of the created NotificationHub + :type gcm_credential: ~azure.mgmt.notificationhubs.models.GcmCredential + :param mpns_credential: The MpnsCredential of the created NotificationHub + :type mpns_credential: ~azure.mgmt.notificationhubs.models.MpnsCredential + :param adm_credential: The AdmCredential of the created NotificationHub + :type adm_credential: ~azure.mgmt.notificationhubs.models.AdmCredential + :param baidu_credential: The BaiduCredential of the created + NotificationHub + :type baidu_credential: + ~azure.mgmt.notificationhubs.models.BaiduCredential + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'notification_hub_create_or_update_parameters_name': {'key': 'properties.name', 'type': 'str'}, + 'registration_ttl': {'key': 'properties.registrationTtl', 'type': 'str'}, + 'authorization_rules': {'key': 'properties.authorizationRules', 'type': '[SharedAccessAuthorizationRuleProperties]'}, + 'apns_credential': {'key': 'properties.apnsCredential', 'type': 'ApnsCredential'}, + 'wns_credential': {'key': 'properties.wnsCredential', 'type': 'WnsCredential'}, + 'gcm_credential': {'key': 'properties.gcmCredential', 'type': 'GcmCredential'}, + 'mpns_credential': {'key': 'properties.mpnsCredential', 'type': 'MpnsCredential'}, + 'adm_credential': {'key': 'properties.admCredential', 'type': 'AdmCredential'}, + 'baidu_credential': {'key': 'properties.baiduCredential', 'type': 'BaiduCredential'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, notification_hub_create_or_update_parameters_name: str=None, registration_ttl: str=None, authorization_rules=None, apns_credential=None, wns_credential=None, gcm_credential=None, mpns_credential=None, adm_credential=None, baidu_credential=None, **kwargs) -> None: + super(NotificationHubCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.notification_hub_create_or_update_parameters_name = notification_hub_create_or_update_parameters_name + self.registration_ttl = registration_ttl + self.authorization_rules = authorization_rules + self.apns_credential = apns_credential + self.wns_credential = wns_credential + self.gcm_credential = gcm_credential + self.mpns_credential = mpns_credential + self.adm_credential = adm_credential + self.baidu_credential = baidu_credential diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource.py index 233af3f8bce2..388cf54b763a 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource.py @@ -27,9 +27,9 @@ class NotificationHubResource(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku :param notification_hub_resource_name: The NotificationHub name. :type notification_hub_resource_name: str :param registration_ttl: The RegistrationTtl of the created @@ -37,35 +37,28 @@ class NotificationHubResource(Resource): :type registration_ttl: str :param authorization_rules: The AuthorizationRules of the created NotificationHub - :type authorization_rules: list of - :class:`SharedAccessAuthorizationRuleProperties - ` + :type authorization_rules: + list[~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleProperties] :param apns_credential: The ApnsCredential of the created NotificationHub - :type apns_credential: :class:`ApnsCredential - ` + :type apns_credential: ~azure.mgmt.notificationhubs.models.ApnsCredential :param wns_credential: The WnsCredential of the created NotificationHub - :type wns_credential: :class:`WnsCredential - ` + :type wns_credential: ~azure.mgmt.notificationhubs.models.WnsCredential :param gcm_credential: The GcmCredential of the created NotificationHub - :type gcm_credential: :class:`GcmCredential - ` + :type gcm_credential: ~azure.mgmt.notificationhubs.models.GcmCredential :param mpns_credential: The MpnsCredential of the created NotificationHub - :type mpns_credential: :class:`MpnsCredential - ` + :type mpns_credential: ~azure.mgmt.notificationhubs.models.MpnsCredential :param adm_credential: The AdmCredential of the created NotificationHub - :type adm_credential: :class:`AdmCredential - ` + :type adm_credential: ~azure.mgmt.notificationhubs.models.AdmCredential :param baidu_credential: The BaiduCredential of the created NotificationHub - :type baidu_credential: :class:`BaiduCredential - ` + :type baidu_credential: + ~azure.mgmt.notificationhubs.models.BaiduCredential """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { @@ -86,14 +79,14 @@ class NotificationHubResource(Resource): 'baidu_credential': {'key': 'properties.baiduCredential', 'type': 'BaiduCredential'}, } - def __init__(self, location, tags=None, sku=None, notification_hub_resource_name=None, registration_ttl=None, authorization_rules=None, apns_credential=None, wns_credential=None, gcm_credential=None, mpns_credential=None, adm_credential=None, baidu_credential=None): - super(NotificationHubResource, self).__init__(location=location, tags=tags, sku=sku) - self.notification_hub_resource_name = notification_hub_resource_name - self.registration_ttl = registration_ttl - self.authorization_rules = authorization_rules - self.apns_credential = apns_credential - self.wns_credential = wns_credential - self.gcm_credential = gcm_credential - self.mpns_credential = mpns_credential - self.adm_credential = adm_credential - self.baidu_credential = baidu_credential + def __init__(self, **kwargs): + super(NotificationHubResource, self).__init__(**kwargs) + self.notification_hub_resource_name = kwargs.get('notification_hub_resource_name', None) + self.registration_ttl = kwargs.get('registration_ttl', None) + self.authorization_rules = kwargs.get('authorization_rules', None) + self.apns_credential = kwargs.get('apns_credential', None) + self.wns_credential = kwargs.get('wns_credential', None) + self.gcm_credential = kwargs.get('gcm_credential', None) + self.mpns_credential = kwargs.get('mpns_credential', None) + self.adm_credential = kwargs.get('adm_credential', None) + self.baidu_credential = kwargs.get('baidu_credential', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource_paged.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource_paged.py index 819adbfbd274..8ed446880895 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource_paged.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource_paged.py @@ -14,7 +14,7 @@ class NotificationHubResourcePaged(Paged): """ - A paging container for iterating over a list of NotificationHubResource object + A paging container for iterating over a list of :class:`NotificationHubResource ` object """ _attribute_map = { diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource_py3.py new file mode 100644 index 000000000000..d59ebe406ca3 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_resource_py3.py @@ -0,0 +1,92 @@ +# 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 .resource_py3 import Resource + + +class NotificationHubResource(Resource): + """Description of a NotificationHub Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + :param notification_hub_resource_name: The NotificationHub name. + :type notification_hub_resource_name: str + :param registration_ttl: The RegistrationTtl of the created + NotificationHub + :type registration_ttl: str + :param authorization_rules: The AuthorizationRules of the created + NotificationHub + :type authorization_rules: + list[~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleProperties] + :param apns_credential: The ApnsCredential of the created NotificationHub + :type apns_credential: ~azure.mgmt.notificationhubs.models.ApnsCredential + :param wns_credential: The WnsCredential of the created NotificationHub + :type wns_credential: ~azure.mgmt.notificationhubs.models.WnsCredential + :param gcm_credential: The GcmCredential of the created NotificationHub + :type gcm_credential: ~azure.mgmt.notificationhubs.models.GcmCredential + :param mpns_credential: The MpnsCredential of the created NotificationHub + :type mpns_credential: ~azure.mgmt.notificationhubs.models.MpnsCredential + :param adm_credential: The AdmCredential of the created NotificationHub + :type adm_credential: ~azure.mgmt.notificationhubs.models.AdmCredential + :param baidu_credential: The BaiduCredential of the created + NotificationHub + :type baidu_credential: + ~azure.mgmt.notificationhubs.models.BaiduCredential + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'notification_hub_resource_name': {'key': 'properties.name', 'type': 'str'}, + 'registration_ttl': {'key': 'properties.registrationTtl', 'type': 'str'}, + 'authorization_rules': {'key': 'properties.authorizationRules', 'type': '[SharedAccessAuthorizationRuleProperties]'}, + 'apns_credential': {'key': 'properties.apnsCredential', 'type': 'ApnsCredential'}, + 'wns_credential': {'key': 'properties.wnsCredential', 'type': 'WnsCredential'}, + 'gcm_credential': {'key': 'properties.gcmCredential', 'type': 'GcmCredential'}, + 'mpns_credential': {'key': 'properties.mpnsCredential', 'type': 'MpnsCredential'}, + 'adm_credential': {'key': 'properties.admCredential', 'type': 'AdmCredential'}, + 'baidu_credential': {'key': 'properties.baiduCredential', 'type': 'BaiduCredential'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, notification_hub_resource_name: str=None, registration_ttl: str=None, authorization_rules=None, apns_credential=None, wns_credential=None, gcm_credential=None, mpns_credential=None, adm_credential=None, baidu_credential=None, **kwargs) -> None: + super(NotificationHubResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.notification_hub_resource_name = notification_hub_resource_name + self.registration_ttl = registration_ttl + self.authorization_rules = authorization_rules + self.apns_credential = apns_credential + self.wns_credential = wns_credential + self.gcm_credential = gcm_credential + self.mpns_credential = mpns_credential + self.adm_credential = adm_credential + self.baidu_credential = baidu_credential diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hubs_management_client_enums.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hubs_management_client_enums.py index 22f7e592f2a4..f97b28ab81f5 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hubs_management_client_enums.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hubs_management_client_enums.py @@ -12,20 +12,20 @@ from enum import Enum -class SkuName(Enum): +class SkuName(str, Enum): free = "Free" basic = "Basic" standard = "Standard" -class NamespaceType(Enum): +class NamespaceType(str, Enum): messaging = "Messaging" notification_hub = "NotificationHub" -class AccessRights(Enum): +class AccessRights(str, Enum): manage = "Manage" send = "Send" diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_name_availability_request_parameters.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation.py similarity index 52% rename from azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_name_availability_request_parameters.py rename to azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation.py index da9ddbfb0370..56c433b420ba 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/check_name_availability_request_parameters.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation.py @@ -12,29 +12,28 @@ from msrest.serialization import Model -class CheckNameAvailabilityRequestParameters(Model): - """Parameters supplied to the Check Name Availability for Namespace and - NotificationHubs. +class Operation(Model): + """A NotificationHubs REST API operation. Variables are only populated by the server, and will be ignored when sending a request. - :param name: Resource name - :type name: str - :ivar type: Resource type - :vartype type: str + :ivar name: Operation name: {provider}/{resource}/{operation} + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.notificationhubs.models.OperationDisplay """ _validation = { - 'name': {'required': True}, - 'type': {'readonly': True}, + 'name': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'type': {'key': 'Type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, name): - self.name = name - self.type = None + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_display.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_display.py new file mode 100644 index 000000000000..1a0166fb286b --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_display.py @@ -0,0 +1,46 @@ +# 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 OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.NotificationHubs + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_display_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_display_py3.py new file mode 100644 index 000000000000..cd9b2cf5306c --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_display_py3.py @@ -0,0 +1,46 @@ +# 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 OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.NotificationHubs + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_paged.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_paged.py new file mode 100644 index 000000000000..3a2eba438979 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_py3.py new file mode 100644 index 000000000000..be95b7117c54 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/operation_py3.py @@ -0,0 +1,39 @@ +# 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 Operation(Model): + """A NotificationHubs REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation} + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.notificationhubs.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/pns_credentials_resource.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/pns_credentials_resource.py index 0e369f63ab8f..9e4a6a1ec3ec 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/pns_credentials_resource.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/pns_credentials_resource.py @@ -27,35 +27,29 @@ class PnsCredentialsResource(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku :param apns_credential: The ApnsCredential of the created NotificationHub - :type apns_credential: :class:`ApnsCredential - ` + :type apns_credential: ~azure.mgmt.notificationhubs.models.ApnsCredential :param wns_credential: The WnsCredential of the created NotificationHub - :type wns_credential: :class:`WnsCredential - ` + :type wns_credential: ~azure.mgmt.notificationhubs.models.WnsCredential :param gcm_credential: The GcmCredential of the created NotificationHub - :type gcm_credential: :class:`GcmCredential - ` + :type gcm_credential: ~azure.mgmt.notificationhubs.models.GcmCredential :param mpns_credential: The MpnsCredential of the created NotificationHub - :type mpns_credential: :class:`MpnsCredential - ` + :type mpns_credential: ~azure.mgmt.notificationhubs.models.MpnsCredential :param adm_credential: The AdmCredential of the created NotificationHub - :type adm_credential: :class:`AdmCredential - ` + :type adm_credential: ~azure.mgmt.notificationhubs.models.AdmCredential :param baidu_credential: The BaiduCredential of the created NotificationHub - :type baidu_credential: :class:`BaiduCredential - ` + :type baidu_credential: + ~azure.mgmt.notificationhubs.models.BaiduCredential """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { @@ -73,11 +67,11 @@ class PnsCredentialsResource(Resource): 'baidu_credential': {'key': 'properties.baiduCredential', 'type': 'BaiduCredential'}, } - def __init__(self, location, tags=None, sku=None, apns_credential=None, wns_credential=None, gcm_credential=None, mpns_credential=None, adm_credential=None, baidu_credential=None): - super(PnsCredentialsResource, self).__init__(location=location, tags=tags, sku=sku) - self.apns_credential = apns_credential - self.wns_credential = wns_credential - self.gcm_credential = gcm_credential - self.mpns_credential = mpns_credential - self.adm_credential = adm_credential - self.baidu_credential = baidu_credential + def __init__(self, **kwargs): + super(PnsCredentialsResource, self).__init__(**kwargs) + self.apns_credential = kwargs.get('apns_credential', None) + self.wns_credential = kwargs.get('wns_credential', None) + self.gcm_credential = kwargs.get('gcm_credential', None) + self.mpns_credential = kwargs.get('mpns_credential', None) + self.adm_credential = kwargs.get('adm_credential', None) + self.baidu_credential = kwargs.get('baidu_credential', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/pns_credentials_resource_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/pns_credentials_resource_py3.py new file mode 100644 index 000000000000..b15189f06d4a --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/pns_credentials_resource_py3.py @@ -0,0 +1,77 @@ +# 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 .resource_py3 import Resource + + +class PnsCredentialsResource(Resource): + """Description of a NotificationHub PNS Credentials. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + :param apns_credential: The ApnsCredential of the created NotificationHub + :type apns_credential: ~azure.mgmt.notificationhubs.models.ApnsCredential + :param wns_credential: The WnsCredential of the created NotificationHub + :type wns_credential: ~azure.mgmt.notificationhubs.models.WnsCredential + :param gcm_credential: The GcmCredential of the created NotificationHub + :type gcm_credential: ~azure.mgmt.notificationhubs.models.GcmCredential + :param mpns_credential: The MpnsCredential of the created NotificationHub + :type mpns_credential: ~azure.mgmt.notificationhubs.models.MpnsCredential + :param adm_credential: The AdmCredential of the created NotificationHub + :type adm_credential: ~azure.mgmt.notificationhubs.models.AdmCredential + :param baidu_credential: The BaiduCredential of the created + NotificationHub + :type baidu_credential: + ~azure.mgmt.notificationhubs.models.BaiduCredential + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'apns_credential': {'key': 'properties.apnsCredential', 'type': 'ApnsCredential'}, + 'wns_credential': {'key': 'properties.wnsCredential', 'type': 'WnsCredential'}, + 'gcm_credential': {'key': 'properties.gcmCredential', 'type': 'GcmCredential'}, + 'mpns_credential': {'key': 'properties.mpnsCredential', 'type': 'MpnsCredential'}, + 'adm_credential': {'key': 'properties.admCredential', 'type': 'AdmCredential'}, + 'baidu_credential': {'key': 'properties.baiduCredential', 'type': 'BaiduCredential'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, apns_credential=None, wns_credential=None, gcm_credential=None, mpns_credential=None, adm_credential=None, baidu_credential=None, **kwargs) -> None: + super(PnsCredentialsResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.apns_credential = apns_credential + self.wns_credential = wns_credential + self.gcm_credential = gcm_credential + self.mpns_credential = mpns_credential + self.adm_credential = adm_credential + self.baidu_credential = baidu_credential diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource.py index d9b962aa9ecd..af72abe54bd8 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource.py @@ -25,5 +25,6 @@ class PolicykeyResource(Model): 'policy_key': {'key': 'policyKey', 'type': 'str'}, } - def __init__(self, policy_key=None): - self.policy_key = policy_key + def __init__(self, **kwargs): + super(PolicykeyResource, self).__init__(**kwargs) + self.policy_key = kwargs.get('policy_key', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource_py3.py new file mode 100644 index 000000000000..e9c003053af0 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource_py3.py @@ -0,0 +1,30 @@ +# 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 PolicykeyResource(Model): + """Namespace/NotificationHub Regenerate Keys. + + :param policy_key: Name of the key that has to be regenerated for the + Namespace/Notification Hub Authorization Rule. The value can be Primary + Key/Secondary Key. + :type policy_key: str + """ + + _attribute_map = { + 'policy_key': {'key': 'policyKey', 'type': 'str'}, + } + + def __init__(self, *, policy_key: str=None, **kwargs) -> None: + super(PolicykeyResource, self).__init__(**kwargs) + self.policy_key = policy_key diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource.py index 3bdc4969b50b..45dfdd515b7c 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource.py @@ -27,16 +27,15 @@ class Resource(Model): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { @@ -48,10 +47,11 @@ class Resource(Model): 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, location, tags=None, sku=None): + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags - self.sku = sku + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_list_keys.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_list_keys.py index 88e8c44886f9..9ef2a841ab02 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_list_keys.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_list_keys.py @@ -37,9 +37,10 @@ class ResourceListKeys(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, primary_connection_string=None, secondary_connection_string=None, primary_key=None, secondary_key=None, key_name=None): - self.primary_connection_string = primary_connection_string - self.secondary_connection_string = secondary_connection_string - self.primary_key = primary_key - self.secondary_key = secondary_key - self.key_name = key_name + def __init__(self, **kwargs): + super(ResourceListKeys, self).__init__(**kwargs) + self.primary_connection_string = kwargs.get('primary_connection_string', None) + self.secondary_connection_string = kwargs.get('secondary_connection_string', None) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_list_keys_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_list_keys_py3.py new file mode 100644 index 000000000000..dbdace0ac567 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_list_keys_py3.py @@ -0,0 +1,46 @@ +# 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 ResourceListKeys(Model): + """Namespace/NotificationHub Connection String. + + :param primary_connection_string: PrimaryConnectionString of the + AuthorizationRule. + :type primary_connection_string: str + :param secondary_connection_string: SecondaryConnectionString of the + created AuthorizationRule + :type secondary_connection_string: str + :param primary_key: PrimaryKey of the created AuthorizationRule. + :type primary_key: str + :param secondary_key: SecondaryKey of the created AuthorizationRule + :type secondary_key: str + :param key_name: KeyName of the created AuthorizationRule + :type key_name: str + """ + + _attribute_map = { + 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, + 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, primary_connection_string: str=None, secondary_connection_string: str=None, primary_key: str=None, secondary_key: str=None, key_name: str=None, **kwargs) -> None: + super(ResourceListKeys, self).__init__(**kwargs) + self.primary_connection_string = primary_connection_string + self.secondary_connection_string = secondary_connection_string + self.primary_key = primary_key + self.secondary_key = secondary_key + self.key_name = key_name diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_py3.py new file mode 100644 index 000000000000..7d5987763ec1 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/resource_py3.py @@ -0,0 +1,57 @@ +# 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 Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.sku = sku diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_create_or_update_parameters.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_create_or_update_parameters.py index e78d2d18e760..8c3afbcb2483 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_create_or_update_parameters.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_create_or_update_parameters.py @@ -9,50 +9,28 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from msrest.serialization import Model -class SharedAccessAuthorizationRuleCreateOrUpdateParameters(Resource): +class SharedAccessAuthorizationRuleCreateOrUpdateParameters(Model): """Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict - :param sku: The sku of the created namespace - :type sku: :class:`Sku ` - :param properties: Properties of the Namespace AuthorizationRules. - :type properties: :class:`SharedAccessAuthorizationRuleProperties - ` + All required parameters must be populated in order to send to Azure. + + :param properties: Required. Properties of the Namespace + AuthorizationRules. + :type properties: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleProperties """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, 'properties': {'required': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, 'properties': {'key': 'properties', 'type': 'SharedAccessAuthorizationRuleProperties'}, } - def __init__(self, location, properties, tags=None, sku=None): - super(SharedAccessAuthorizationRuleCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku) - self.properties = properties + def __init__(self, **kwargs): + super(SharedAccessAuthorizationRuleCreateOrUpdateParameters, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_create_or_update_parameters_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_create_or_update_parameters_py3.py new file mode 100644 index 000000000000..0d11ff3e2506 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_create_or_update_parameters_py3.py @@ -0,0 +1,36 @@ +# 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 SharedAccessAuthorizationRuleCreateOrUpdateParameters(Model): + """Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. + + All required parameters must be populated in order to send to Azure. + + :param properties: Required. Properties of the Namespace + AuthorizationRules. + :type properties: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleProperties + """ + + _validation = { + 'properties': {'required': True}, + } + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'SharedAccessAuthorizationRuleProperties'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(SharedAccessAuthorizationRuleCreateOrUpdateParameters, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_list_result.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_list_result.py new file mode 100644 index 000000000000..ccefda05d86a --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_list_result.py @@ -0,0 +1,34 @@ +# 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 SharedAccessAuthorizationRuleListResult(Model): + """The response of the List Namespace operation. + + :param value: Result of the List AuthorizationRules operation. + :type value: + list[~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResource] + :param next_link: Link to the next set of results. Not empty if Value + contains incomplete list of AuthorizationRules + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedAccessAuthorizationRuleResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SharedAccessAuthorizationRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_list_result_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_list_result_py3.py new file mode 100644 index 000000000000..986431f0b8c1 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_list_result_py3.py @@ -0,0 +1,34 @@ +# 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 SharedAccessAuthorizationRuleListResult(Model): + """The response of the List Namespace operation. + + :param value: Result of the List AuthorizationRules operation. + :type value: + list[~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResource] + :param next_link: Link to the next set of results. Not empty if Value + contains incomplete list of AuthorizationRules + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedAccessAuthorizationRuleResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(SharedAccessAuthorizationRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_properties.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_properties.py index bdde83a7c416..336a9b615e2e 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_properties.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_properties.py @@ -15,14 +15,63 @@ class SharedAccessAuthorizationRuleProperties(Model): """SharedAccessAuthorizationRule properties. + Variables are only populated by the server, and will be ignored when + sending a request. + :param rights: The rights associated with the rule. - :type rights: list of str or :class:`AccessRights - ` + :type rights: list[str or + ~azure.mgmt.notificationhubs.models.AccessRights] + :ivar primary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype primary_key: str + :ivar secondary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype secondary_key: str + :ivar key_name: A string that describes the authorization rule. + :vartype key_name: str + :ivar claim_type: A string that describes the claim type + :vartype claim_type: str + :ivar claim_value: A string that describes the claim value + :vartype claim_value: str + :ivar modified_time: The last modified time for this rule + :vartype modified_time: str + :ivar created_time: The created time for this rule + :vartype created_time: str + :ivar revision: The revision number for the rule + :vartype revision: int """ + _validation = { + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + 'key_name': {'readonly': True}, + 'claim_type': {'readonly': True}, + 'claim_value': {'readonly': True}, + 'modified_time': {'readonly': True}, + 'created_time': {'readonly': True}, + 'revision': {'readonly': True}, + } + _attribute_map = { 'rights': {'key': 'rights', 'type': '[AccessRights]'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'claim_type': {'key': 'claimType', 'type': 'str'}, + 'claim_value': {'key': 'claimValue', 'type': 'str'}, + 'modified_time': {'key': 'modifiedTime', 'type': 'str'}, + 'created_time': {'key': 'createdTime', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, } - def __init__(self, rights=None): - self.rights = rights + def __init__(self, **kwargs): + super(SharedAccessAuthorizationRuleProperties, self).__init__(**kwargs) + self.rights = kwargs.get('rights', None) + self.primary_key = None + self.secondary_key = None + self.key_name = None + self.claim_type = None + self.claim_value = None + self.modified_time = None + self.created_time = None + self.revision = None diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_properties_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_properties_py3.py new file mode 100644 index 000000000000..9b220d462436 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_properties_py3.py @@ -0,0 +1,77 @@ +# 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 SharedAccessAuthorizationRuleProperties(Model): + """SharedAccessAuthorizationRule properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param rights: The rights associated with the rule. + :type rights: list[str or + ~azure.mgmt.notificationhubs.models.AccessRights] + :ivar primary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype primary_key: str + :ivar secondary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype secondary_key: str + :ivar key_name: A string that describes the authorization rule. + :vartype key_name: str + :ivar claim_type: A string that describes the claim type + :vartype claim_type: str + :ivar claim_value: A string that describes the claim value + :vartype claim_value: str + :ivar modified_time: The last modified time for this rule + :vartype modified_time: str + :ivar created_time: The created time for this rule + :vartype created_time: str + :ivar revision: The revision number for the rule + :vartype revision: int + """ + + _validation = { + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + 'key_name': {'readonly': True}, + 'claim_type': {'readonly': True}, + 'claim_value': {'readonly': True}, + 'modified_time': {'readonly': True}, + 'created_time': {'readonly': True}, + 'revision': {'readonly': True}, + } + + _attribute_map = { + 'rights': {'key': 'rights', 'type': '[AccessRights]'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'claim_type': {'key': 'claimType', 'type': 'str'}, + 'claim_value': {'key': 'claimValue', 'type': 'str'}, + 'modified_time': {'key': 'modifiedTime', 'type': 'str'}, + 'created_time': {'key': 'createdTime', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, + } + + def __init__(self, *, rights=None, **kwargs) -> None: + super(SharedAccessAuthorizationRuleProperties, self).__init__(**kwargs) + self.rights = rights + self.primary_key = None + self.secondary_key = None + self.key_name = None + self.claim_type = None + self.claim_value = None + self.modified_time = None + self.created_time = None + self.revision = None diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource.py index ae02f11ffdd7..b7dbba779637 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource.py @@ -27,19 +27,44 @@ class SharedAccessAuthorizationRuleResource(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku :param rights: The rights associated with the rule. - :type rights: list of str or :class:`AccessRights - ` + :type rights: list[str or + ~azure.mgmt.notificationhubs.models.AccessRights] + :ivar primary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype primary_key: str + :ivar secondary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype secondary_key: str + :ivar key_name: A string that describes the authorization rule. + :vartype key_name: str + :ivar claim_type: A string that describes the claim type + :vartype claim_type: str + :ivar claim_value: A string that describes the claim value + :vartype claim_value: str + :ivar modified_time: The last modified time for this rule + :vartype modified_time: str + :ivar created_time: The created time for this rule + :vartype created_time: str + :ivar revision: The revision number for the rule + :vartype revision: int """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + 'key_name': {'readonly': True}, + 'claim_type': {'readonly': True}, + 'claim_value': {'readonly': True}, + 'modified_time': {'readonly': True}, + 'created_time': {'readonly': True}, + 'revision': {'readonly': True}, } _attribute_map = { @@ -50,8 +75,24 @@ class SharedAccessAuthorizationRuleResource(Resource): 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'rights': {'key': 'properties.rights', 'type': '[AccessRights]'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'claim_type': {'key': 'properties.claimType', 'type': 'str'}, + 'claim_value': {'key': 'properties.claimValue', 'type': 'str'}, + 'modified_time': {'key': 'properties.modifiedTime', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'int'}, } - def __init__(self, location, tags=None, sku=None, rights=None): - super(SharedAccessAuthorizationRuleResource, self).__init__(location=location, tags=tags, sku=sku) - self.rights = rights + def __init__(self, **kwargs): + super(SharedAccessAuthorizationRuleResource, self).__init__(**kwargs) + self.rights = kwargs.get('rights', None) + self.primary_key = None + self.secondary_key = None + self.key_name = None + self.claim_type = None + self.claim_value = None + self.modified_time = None + self.created_time = None + self.revision = None diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource_paged.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource_paged.py index fe48ca7f9450..76ef1c177995 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource_paged.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource_paged.py @@ -14,7 +14,7 @@ class SharedAccessAuthorizationRuleResourcePaged(Paged): """ - A paging container for iterating over a list of SharedAccessAuthorizationRuleResource object + A paging container for iterating over a list of :class:`SharedAccessAuthorizationRuleResource ` object """ _attribute_map = { diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource_py3.py new file mode 100644 index 000000000000..13fd38bed3f6 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/shared_access_authorization_rule_resource_py3.py @@ -0,0 +1,98 @@ +# 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 .resource_py3 import Resource + + +class SharedAccessAuthorizationRuleResource(Resource): + """Description of a Namespace AuthorizationRules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: The sku of the created namespace + :type sku: ~azure.mgmt.notificationhubs.models.Sku + :param rights: The rights associated with the rule. + :type rights: list[str or + ~azure.mgmt.notificationhubs.models.AccessRights] + :ivar primary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype primary_key: str + :ivar secondary_key: A base64-encoded 256-bit primary key for signing and + validating the SAS token. + :vartype secondary_key: str + :ivar key_name: A string that describes the authorization rule. + :vartype key_name: str + :ivar claim_type: A string that describes the claim type + :vartype claim_type: str + :ivar claim_value: A string that describes the claim value + :vartype claim_value: str + :ivar modified_time: The last modified time for this rule + :vartype modified_time: str + :ivar created_time: The created time for this rule + :vartype created_time: str + :ivar revision: The revision number for the rule + :vartype revision: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + 'key_name': {'readonly': True}, + 'claim_type': {'readonly': True}, + 'claim_value': {'readonly': True}, + 'modified_time': {'readonly': True}, + 'created_time': {'readonly': True}, + 'revision': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'rights': {'key': 'properties.rights', 'type': '[AccessRights]'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'claim_type': {'key': 'properties.claimType', 'type': 'str'}, + 'claim_value': {'key': 'properties.claimValue', 'type': 'str'}, + 'modified_time': {'key': 'properties.modifiedTime', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'int'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, rights=None, **kwargs) -> None: + super(SharedAccessAuthorizationRuleResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.rights = rights + self.primary_key = None + self.secondary_key = None + self.key_name = None + self.claim_type = None + self.claim_value = None + self.modified_time = None + self.created_time = None + self.revision = None diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sku.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sku.py index d3bb894af55f..028ddb22359b 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sku.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sku.py @@ -15,10 +15,11 @@ class Sku(Model): """The Sku description for a namespace. - :param name: Name of the notification hub sku. Possible values include: - 'Free', 'Basic', 'Standard' - :type name: str or :class:`SkuName - ` + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the notification hub sku. Possible values + include: 'Free', 'Basic', 'Standard' + :type name: str or ~azure.mgmt.notificationhubs.models.SkuName :param tier: The tier of particular sku :type tier: str :param size: The Sku size @@ -41,9 +42,10 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name, tier=None, size=None, family=None, capacity=None): - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sku_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sku_py3.py new file mode 100644 index 000000000000..39a4d9f98808 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sku_py3.py @@ -0,0 +1,51 @@ +# 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 Sku(Model): + """The Sku description for a namespace. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the notification hub sku. Possible values + include: 'Free', 'Basic', 'Standard' + :type name: str or ~azure.mgmt.notificationhubs.models.SkuName + :param tier: The tier of particular sku + :type tier: str + :param size: The Sku size + :type size: str + :param family: The Sku Family + :type family: str + :param capacity: The capacity of the resource + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name, tier: str=None, size: str=None, family: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sub_resource.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sub_resource.py index e77acb8015b2..11e092cc6ff5 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sub_resource.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sub_resource.py @@ -23,5 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sub_resource_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sub_resource_py3.py new file mode 100644 index 000000000000..29e5afee38f9 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# 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 SubResource(Model): + """SubResource. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/wns_credential.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/wns_credential.py index c1efcc25b81d..4dc2f88e62f9 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/wns_credential.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/wns_credential.py @@ -29,7 +29,8 @@ class WnsCredential(Model): 'windows_live_endpoint': {'key': 'properties.windowsLiveEndpoint', 'type': 'str'}, } - def __init__(self, package_sid=None, secret_key=None, windows_live_endpoint=None): - self.package_sid = package_sid - self.secret_key = secret_key - self.windows_live_endpoint = windows_live_endpoint + def __init__(self, **kwargs): + super(WnsCredential, self).__init__(**kwargs) + self.package_sid = kwargs.get('package_sid', None) + self.secret_key = kwargs.get('secret_key', None) + self.windows_live_endpoint = kwargs.get('windows_live_endpoint', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/wns_credential_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/wns_credential_py3.py new file mode 100644 index 000000000000..104b788a1f68 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/wns_credential_py3.py @@ -0,0 +1,36 @@ +# 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 WnsCredential(Model): + """Description of a NotificationHub WnsCredential. + + :param package_sid: The package ID for this credential. + :type package_sid: str + :param secret_key: The secret key. + :type secret_key: str + :param windows_live_endpoint: The Windows Live endpoint. + :type windows_live_endpoint: str + """ + + _attribute_map = { + 'package_sid': {'key': 'properties.packageSid', 'type': 'str'}, + 'secret_key': {'key': 'properties.secretKey', 'type': 'str'}, + 'windows_live_endpoint': {'key': 'properties.windowsLiveEndpoint', 'type': 'str'}, + } + + def __init__(self, *, package_sid: str=None, secret_key: str=None, windows_live_endpoint: str=None, **kwargs) -> None: + super(WnsCredential, self).__init__(**kwargs) + self.package_sid = package_sid + self.secret_key = secret_key + self.windows_live_endpoint = windows_live_endpoint diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/notification_hubs_management_client.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/notification_hubs_management_client.py index 4b2d63604aa0..8ffd380593cc 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/notification_hubs_management_client.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/notification_hubs_management_client.py @@ -9,14 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.operations import Operations from .operations.namespaces_operations import NamespacesOperations -from .operations.name_operations import NameOperations from .operations.notification_hubs_operations import NotificationHubsOperations -from .operations.hubs_operations import HubsOperations from . import models @@ -42,34 +41,30 @@ 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(NotificationHubsManagementClientConfiguration, self).__init__(base_url) - self.add_user_agent('notificationhubsmanagementclient/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-notificationhubs/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials self.subscription_id = subscription_id -class NotificationHubsManagementClient(object): +class NotificationHubsManagementClient(SDKClient): """Azure NotificationHub client :ivar config: Configuration for client. :vartype config: NotificationHubsManagementClientConfiguration + :ivar operations: Operations operations + :vartype operations: azure.mgmt.notificationhubs.operations.Operations :ivar namespaces: Namespaces operations :vartype namespaces: azure.mgmt.notificationhubs.operations.NamespacesOperations - :ivar name: Name operations - :vartype name: azure.mgmt.notificationhubs.operations.NameOperations :ivar notification_hubs: NotificationHubs operations :vartype notification_hubs: azure.mgmt.notificationhubs.operations.NotificationHubsOperations - :ivar hubs: Hubs operations - :vartype hubs: azure.mgmt.notificationhubs.operations.HubsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -85,18 +80,16 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = NotificationHubsManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(NotificationHubsManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2017-04-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.namespaces = NamespacesOperations( + self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - self.name = NameOperations( + self.namespaces = NamespacesOperations( self._client, self.config, self._serialize, self._deserialize) self.notification_hubs = NotificationHubsOperations( self._client, self.config, self._serialize, self._deserialize) - self.hubs = HubsOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/__init__.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/__init__.py index 16ffcc7b2d4a..a81c5ff50e13 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/__init__.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/__init__.py @@ -9,14 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- +from .operations import Operations from .namespaces_operations import NamespacesOperations -from .name_operations import NameOperations from .notification_hubs_operations import NotificationHubsOperations -from .hubs_operations import HubsOperations __all__ = [ + 'Operations', 'NamespacesOperations', - 'NameOperations', 'NotificationHubsOperations', - 'HubsOperations', ] diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/hubs_operations.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/hubs_operations.py deleted file mode 100644 index 6653fd418b60..000000000000 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/hubs_operations.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -import uuid - -from .. import models - - -class HubsOperations(object): - """HubsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2017-04-01". - """ - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-01" - - self.config = config - - def check_availability( - self, resource_group_name, namespace_name, name, custom_headers=None, raw=False, **operation_config): - """Checks the availability of the given notificationHub in a namespace. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param namespace_name: The namespace name. - :type namespace_name: str - :param name: Resource name - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: :class:`CheckNameAvailabilityResponse - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - parameters = models.CheckNameAvailabilityRequestParameters(name=name) - - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkHubAvailability' - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'CheckNameAvailabilityRequestParameters') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/name_operations.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/name_operations.py deleted file mode 100644 index cb14a1793726..000000000000 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/name_operations.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -import uuid - -from .. import models - - -class NameOperations(object): - """NameOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2017-04-01". - """ - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-01" - - self.config = config - - def check_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks the availability of the given service namespace across all Azure - subscriptions. This is useful because the domain name is created based - on the service namespace name. - - :param name: Resource name - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: :class:`CheckNameAvailabilityResponse - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - parameters = models.CheckNameAvailabilityRequestParameters(name=name) - - # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNameAvailability' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'CheckNameAvailabilityRequestParameters') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/namespaces_operations.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/namespaces_operations.py index 501e5ec14e28..066abe6ebc22 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/namespaces_operations.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/namespaces_operations.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- +import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller -import uuid +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -23,10 +24,12 @@ class NamespacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-04-01". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -43,21 +46,20 @@ def check_availability( on the service namespace name. :param parameters: The namespace name. - :type parameters: :class:`CheckAvailabilityParameters - ` + :type parameters: + ~azure.mgmt.notificationhubs.models.CheckAvailabilityParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`CheckAvailabilityResult - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: CheckAvailabilityResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.CheckAvailabilityResult or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability' + url = self.check_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -83,7 +85,7 @@ def check_availability( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -100,6 +102,7 @@ def check_availability( return client_raw_response return deserialized + check_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability'} def create_or_update( self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -111,21 +114,20 @@ def create_or_update( :param namespace_name: The namespace name. :type namespace_name: str :param parameters: Parameters supplied to create a Namespace Resource. - :type parameters: :class:`NamespaceCreateOrUpdateParameters - ` + :type parameters: + ~azure.mgmt.notificationhubs.models.NamespaceCreateOrUpdateParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`NamespaceResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: NamespaceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.NamespaceResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -153,25 +155,26 @@ def create_or_update( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) - if response.status_code not in [201, 200]: + if response.status_code not in [200, 201]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('NamespaceResource', response) if response.status_code == 200: deserialized = self._deserialize('NamespaceResource', response) + if response.status_code == 201: + deserialized = self._deserialize('NamespaceResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}'} def patch( self, resource_group_name, namespace_name, tags=None, sku=None, custom_headers=None, raw=False, **operation_config): @@ -182,24 +185,23 @@ def patch( :param namespace_name: The namespace name. :type namespace_name: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param sku: The sku of the created namespace - :type sku: :class:`Sku ` + :type sku: ~azure.mgmt.notificationhubs.models.Sku :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`NamespaceResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: NamespaceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.NamespaceResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ parameters = models.NamespacePatchParameters(tags=tags, sku=sku) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}' + url = self.patch.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -227,7 +229,7 @@ def patch( # Construct and send request request = self._client.patch(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -244,28 +246,13 @@ def patch( return client_raw_response return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}'} - def delete( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Deletes an existing namespace. This operation also removes all - associated notificationHubs under the namespace. - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param namespace_name: The namespace name. - :type namespace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :rtype: - :class:`AzureOperationPoller` - instance that returns None - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -288,40 +275,59 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): - - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - def get_long_running_status(status_link, headers=None): + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - def get_long_running_output(response): + def delete( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing namespace. This operation also removes all + associated notificationHubs under the namespace. - if response.status_code not in [204, 200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + def get_long_running_output(response): if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}'} def get( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): @@ -336,14 +342,13 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`NamespaceResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: NamespaceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.NamespaceResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -367,7 +372,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -384,9 +389,10 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}'} def create_or_update_authorization_rule( - self, resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, namespace_name, authorization_rule_name, properties, custom_headers=None, raw=False, **operation_config): """Creates an authorization rule for a namespace. :param resource_group_name: The name of the resource group. @@ -395,23 +401,25 @@ def create_or_update_authorization_rule( :type namespace_name: str :param authorization_rule_name: Aauthorization Rule Name. :type authorization_rule_name: str - :param parameters: The shared access authorization rule. - :type parameters: - :class:`SharedAccessAuthorizationRuleCreateOrUpdateParameters - ` + :param properties: Properties of the Namespace AuthorizationRules. + :type properties: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleProperties :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`SharedAccessAuthorizationRuleResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: SharedAccessAuthorizationRuleResource or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResource + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + parameters = models.SharedAccessAuthorizationRuleCreateOrUpdateParameters(properties=properties) + # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}' + url = self.create_or_update_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -440,7 +448,7 @@ def create_or_update_authorization_rule( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -457,6 +465,7 @@ def create_or_update_authorization_rule( return client_raw_response return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'} def delete_authorization_rule( self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -473,13 +482,12 @@ def delete_authorization_rule( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}' + url = self.delete_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -504,9 +512,9 @@ def delete_authorization_rule( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [204, 200]: + if response.status_code not in [200, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -514,6 +522,7 @@ def delete_authorization_rule( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'} def get_authorization_rule( self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -530,14 +539,15 @@ def get_authorization_rule( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`SharedAccessAuthorizationRuleResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: SharedAccessAuthorizationRuleResource or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResource + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}' + url = self.get_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -562,7 +572,7 @@ def get_authorization_rule( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -579,6 +589,7 @@ def get_authorization_rule( return client_raw_response return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -593,15 +604,16 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`NamespaceResourcePaged - ` + :return: An iterator like instance of NamespaceResource + :rtype: + ~azure.mgmt.notificationhubs.models.NamespaceResourcePaged[~azure.mgmt.notificationhubs.models.NamespaceResource] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -629,7 +641,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -647,6 +659,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -658,15 +671,16 @@ def list_all( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`NamespaceResourcePaged - ` + :return: An iterator like instance of NamespaceResource + :rtype: + ~azure.mgmt.notificationhubs.models.NamespaceResourcePaged[~azure.mgmt.notificationhubs.models.NamespaceResource] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -693,7 +707,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -711,6 +725,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces'} def list_authorization_rules( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): @@ -725,15 +740,17 @@ def list_authorization_rules( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`SharedAccessAuthorizationRuleResourcePaged - ` + :return: An iterator like instance of + SharedAccessAuthorizationRuleResource + :rtype: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResourcePaged[~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResource] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules' + url = self.list_authorization_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -762,7 +779,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -780,6 +797,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules'} def list_keys( self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -797,14 +815,15 @@ def list_keys( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`ResourceListKeys - ` - :rtype: :class:`ClientRawResponse` + :return: SharedAccessAuthorizationRuleListResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleListResult + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -829,7 +848,7 @@ def list_keys( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -839,13 +858,14 @@ def list_keys( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ResourceListKeys', response) + deserialized = self._deserialize('SharedAccessAuthorizationRuleListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys'} def regenerate_keys( self, resource_group_name, namespace_name, authorization_rule_name, policy_key=None, custom_headers=None, raw=False, **operation_config): @@ -868,16 +888,15 @@ def regenerate_keys( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`ResourceListKeys - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: ResourceListKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.ResourceListKeys or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ parameters = models.PolicykeyResource(policy_key=policy_key) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys' + url = self.regenerate_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -906,7 +925,7 @@ def regenerate_keys( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -923,3 +942,4 @@ def regenerate_keys( return client_raw_response return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'} diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/notification_hubs_operations.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/notification_hubs_operations.py index f9a3e086e722..d81cee2faf2e 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/notification_hubs_operations.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/notification_hubs_operations.py @@ -9,9 +9,9 @@ # regenerated. # -------------------------------------------------------------------------- +import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -import uuid from .. import models @@ -22,10 +22,12 @@ class NotificationHubsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2017-04-01". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -35,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def check_availability( + def check_notification_hub_availability( self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): """Checks the availability of the given notificationHub in a namespace. @@ -44,21 +46,20 @@ def check_availability( :param namespace_name: The namespace name. :type namespace_name: str :param parameters: The notificationHub name. - :type parameters: :class:`CheckAvailabilityParameters - ` + :type parameters: + ~azure.mgmt.notificationhubs.models.CheckAvailabilityParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`CheckAvailabilityResult - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: CheckAvailabilityResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.CheckAvailabilityResult or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability' + url = self.check_notification_hub_availability.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -86,7 +87,7 @@ def check_availability( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -103,6 +104,7 @@ def check_availability( return client_raw_response return deserialized + check_notification_hub_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability'} def create_or_update( self, resource_group_name, namespace_name, notification_hub_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -116,21 +118,20 @@ def create_or_update( :type notification_hub_name: str :param parameters: Parameters supplied to the create/update a NotificationHub Resource. - :type parameters: :class:`NotificationHubCreateOrUpdateParameters - ` + :type parameters: + ~azure.mgmt.notificationhubs.models.NotificationHubCreateOrUpdateParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`NotificationHubResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: NotificationHubResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.NotificationHubResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -159,7 +160,7 @@ def create_or_update( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -178,6 +179,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}'} def delete( self, resource_group_name, namespace_name, notification_hub_name, custom_headers=None, raw=False, **operation_config): @@ -194,13 +196,12 @@ def delete( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -225,7 +226,7 @@ def delete( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -235,6 +236,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}'} def get( self, resource_group_name, namespace_name, notification_hub_name, custom_headers=None, raw=False, **operation_config): @@ -251,14 +253,13 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`NotificationHubResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: NotificationHubResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.NotificationHubResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -283,7 +284,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -300,9 +301,10 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}'} def create_or_update_authorization_rule( - self, resource_group_name, namespace_name, notification_hub_name, authorization_rule_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, namespace_name, notification_hub_name, authorization_rule_name, properties, custom_headers=None, raw=False, **operation_config): """Creates/Updates an authorization rule for a NotificationHub. :param resource_group_name: The name of the resource group. @@ -313,23 +315,25 @@ def create_or_update_authorization_rule( :type notification_hub_name: str :param authorization_rule_name: Authorization Rule Name. :type authorization_rule_name: str - :param parameters: The shared access authorization rule. - :type parameters: - :class:`SharedAccessAuthorizationRuleCreateOrUpdateParameters - ` + :param properties: Properties of the Namespace AuthorizationRules. + :type properties: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleProperties :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`SharedAccessAuthorizationRuleResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: SharedAccessAuthorizationRuleResource or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResource + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + parameters = models.SharedAccessAuthorizationRuleCreateOrUpdateParameters(properties=properties) + # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}' + url = self.create_or_update_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -359,7 +363,7 @@ def create_or_update_authorization_rule( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -376,6 +380,7 @@ def create_or_update_authorization_rule( return client_raw_response return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}'} def delete_authorization_rule( self, resource_group_name, namespace_name, notification_hub_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -394,13 +399,12 @@ def delete_authorization_rule( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}' + url = self.delete_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -426,9 +430,9 @@ def delete_authorization_rule( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [204, 200]: + if response.status_code not in [200, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -436,6 +440,7 @@ def delete_authorization_rule( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}'} def get_authorization_rule( self, resource_group_name, namespace_name, notification_hub_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -454,14 +459,15 @@ def get_authorization_rule( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`SharedAccessAuthorizationRuleResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: SharedAccessAuthorizationRuleResource or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResource + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}' + url = self.get_authorization_rule.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -487,7 +493,7 @@ def get_authorization_rule( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -504,6 +510,7 @@ def get_authorization_rule( return client_raw_response return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}'} def list( self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): @@ -518,15 +525,16 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`NotificationHubResourcePaged - ` + :return: An iterator like instance of NotificationHubResource + :rtype: + ~azure.mgmt.notificationhubs.models.NotificationHubResourcePaged[~azure.mgmt.notificationhubs.models.NotificationHubResource] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -555,7 +563,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -573,6 +581,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs'} def list_authorization_rules( self, resource_group_name, namespace_name, notification_hub_name, custom_headers=None, raw=False, **operation_config): @@ -589,15 +598,17 @@ def list_authorization_rules( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`SharedAccessAuthorizationRuleResourcePaged - ` + :return: An iterator like instance of + SharedAccessAuthorizationRuleResource + :rtype: + ~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResourcePaged[~azure.mgmt.notificationhubs.models.SharedAccessAuthorizationRuleResource] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules' + url = self.list_authorization_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -627,7 +638,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -645,6 +656,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules'} def list_keys( self, resource_group_name, namespace_name, notification_hub_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): @@ -665,14 +677,13 @@ def list_keys( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`ResourceListKeys - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: ResourceListKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.ResourceListKeys or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -698,7 +709,7 @@ def list_keys( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -715,6 +726,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys'} def regenerate_keys( self, resource_group_name, namespace_name, notification_hub_name, authorization_rule_name, policy_key=None, custom_headers=None, raw=False, **operation_config): @@ -739,16 +751,15 @@ def regenerate_keys( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`ResourceListKeys - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: ResourceListKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.ResourceListKeys or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ parameters = models.PolicykeyResource(policy_key=policy_key) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys' + url = self.regenerate_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -778,7 +789,7 @@ def regenerate_keys( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -795,6 +806,7 @@ def regenerate_keys( return client_raw_response return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'} def get_pns_credentials( self, resource_group_name, namespace_name, notification_hub_name, custom_headers=None, raw=False, **operation_config): @@ -811,14 +823,13 @@ def get_pns_credentials( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`PnsCredentialsResource - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: PnsCredentialsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.PnsCredentialsResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials' + url = self.get_pns_credentials.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), @@ -843,7 +854,7 @@ def get_pns_credentials( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -860,3 +871,4 @@ def get_pns_credentials( return client_raw_response return deserialized + get_pns_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials'} diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/operations.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/operations.py new file mode 100644 index 000000000000..4b966f29589b --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/operations.py @@ -0,0 +1,97 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available NotificationHubs REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.notificationhubs.models.OperationPaged[~azure.mgmt.notificationhubs.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.NotificationHubs/operations'} diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/version.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/version.py index a39916c162ce..5c2dbfde66c5 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/version.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "2017-04-01"