diff --git a/azure-mgmt-notificationhubs/HISTORY.rst b/azure-mgmt-notificationhubs/HISTORY.rst index cd91317f4237..d3bfe9ddd4e6 100644 --- a/azure-mgmt-notificationhubs/HISTORY.rst +++ b/azure-mgmt-notificationhubs/HISTORY.rst @@ -3,6 +3,14 @@ Release History =============== +2.1.0 (2019-04-30) +++++++++++++++++++ + +**Features** + +- Added operation NotificationHubsOperations.patch +- Added operation NotificationHubsOperations.debug_send + 2.0.0 (2018-05-25) ++++++++++++++++++ @@ -47,7 +55,7 @@ This version uses a next-generation code generator that *might* introduce breaki - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. - - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, the response of the initial call will be returned without polling. diff --git a/azure-mgmt-notificationhubs/MANIFEST.in b/azure-mgmt-notificationhubs/MANIFEST.in index bb37a2723dae..e4884efef41b 100644 --- a/azure-mgmt-notificationhubs/MANIFEST.in +++ b/azure-mgmt-notificationhubs/MANIFEST.in @@ -1 +1,5 @@ +recursive-include tests *.py *.yaml include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-notificationhubs/README.rst b/azure-mgmt-notificationhubs/README.rst index d9d406e03c22..91111215d41e 100644 --- a/azure-mgmt-notificationhubs/README.rst +++ b/azure-mgmt-notificationhubs/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== @@ -47,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-notificationhubs%2FREADME.png diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/__init__.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/__init__.py index fa659d0d218c..6e7e9ee3b381 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/__init__.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/__init__.py @@ -32,7 +32,9 @@ 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_patch_parameters_py3 import NotificationHubPatchParameters from .notification_hub_resource_py3 import NotificationHubResource + from .debug_send_response_py3 import DebugSendResponse from .pns_credentials_resource_py3 import PnsCredentialsResource from .resource_py3 import Resource from .sub_resource_py3 import SubResource @@ -59,7 +61,9 @@ from .adm_credential import AdmCredential from .baidu_credential import BaiduCredential from .notification_hub_create_or_update_parameters import NotificationHubCreateOrUpdateParameters + from .notification_hub_patch_parameters import NotificationHubPatchParameters from .notification_hub_resource import NotificationHubResource + from .debug_send_response import DebugSendResponse from .pns_credentials_resource import PnsCredentialsResource from .resource import Resource from .sub_resource import SubResource @@ -96,7 +100,9 @@ 'AdmCredential', 'BaiduCredential', 'NotificationHubCreateOrUpdateParameters', + 'NotificationHubPatchParameters', 'NotificationHubResource', + 'DebugSendResponse', 'PnsCredentialsResource', 'Resource', 'SubResource', 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 823a6dd3ec2d..d9a01894e636 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential.py @@ -21,7 +21,7 @@ class ApnsCredential(Model): :type certificate_key: str :param endpoint: The endpoint of this credential. :type endpoint: str - :param thumbprint: The Apns certificate Thumbprint + :param thumbprint: The APNS certificate Thumbprint :type thumbprint: str :param key_id: A 10-character key identifier (kid) key, obtained from your developer account 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 index 295a024f5eb2..598205deb715 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential_py3.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/apns_credential_py3.py @@ -21,7 +21,7 @@ class ApnsCredential(Model): :type certificate_key: str :param endpoint: The endpoint of this credential. :type endpoint: str - :param thumbprint: The Apns certificate Thumbprint + :param thumbprint: The APNS certificate Thumbprint :type thumbprint: str :param key_id: A 10-character key identifier (kid) key, obtained from your developer account 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 3ed36a8e0bf3..58a09e27f799 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 @@ -27,7 +27,7 @@ class CheckAvailabilityParameters(Model): :type name: str :ivar type: Resource type :vartype type: str - :param location: Required. Resource location + :param location: Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -42,7 +42,6 @@ class CheckAvailabilityParameters(Model): 'id': {'readonly': True}, 'name': {'required': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { 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 index 9913fc3c1b0b..2160e9778ec3 100644 --- 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 @@ -27,7 +27,7 @@ class CheckAvailabilityParameters(Model): :type name: str :ivar type: Resource type :vartype type: str - :param location: Required. Resource location + :param location: Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -42,7 +42,6 @@ class CheckAvailabilityParameters(Model): 'id': {'readonly': True}, 'name': {'required': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { @@ -55,7 +54,7 @@ class CheckAvailabilityParameters(Model): 'is_availiable': {'key': 'isAvailiable', 'type': 'bool'}, } - def __init__(self, *, name: str, location: str, tags=None, sku=None, is_availiable: bool=None, **kwargs) -> None: + def __init__(self, *, name: str, location: str=None, tags=None, sku=None, is_availiable: bool=None, **kwargs) -> None: super(CheckAvailabilityParameters, self).__init__(**kwargs) self.id = None self.name = name 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 8ad9a11c440b..dc77a2ee06f2 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 @@ -13,7 +13,7 @@ class CheckAvailabilityResult(Resource): - """Description of a CheckAvailibility resource. + """Description of a CheckAvailability resource. Variables are only populated by the server, and will be ignored when sending a request. 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 index 64e1ab2ad7de..6d23a72a32a4 100644 --- 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 @@ -13,7 +13,7 @@ class CheckAvailabilityResult(Resource): - """Description of a CheckAvailibility resource. + """Description of a CheckAvailability resource. Variables are only populated by the server, and will be ignored when sending a request. diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/debug_send_response.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/debug_send_response.py new file mode 100644 index 000000000000..c6b273e88cdf --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/debug_send_response.py @@ -0,0 +1,63 @@ +# 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 import Resource + + +class DebugSendResponse(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 success: successful send + :type success: float + :param failure: send failure + :type failure: float + :param results: actual failure description + :type results: object + """ + + _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'}, + 'success': {'key': 'properties.success', 'type': 'float'}, + 'failure': {'key': 'properties.failure', 'type': 'float'}, + 'results': {'key': 'properties.results', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(DebugSendResponse, self).__init__(**kwargs) + self.success = kwargs.get('success', None) + self.failure = kwargs.get('failure', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/debug_send_response_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/debug_send_response_py3.py new file mode 100644 index 000000000000..117573ecdc7c --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/debug_send_response_py3.py @@ -0,0 +1,63 @@ +# 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 DebugSendResponse(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 success: successful send + :type success: float + :param failure: send failure + :type failure: float + :param results: actual failure description + :type results: object + """ + + _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'}, + 'success': {'key': 'properties.success', 'type': 'float'}, + 'failure': {'key': 'properties.failure', 'type': 'float'}, + 'results': {'key': 'properties.results', 'type': 'object'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, success: float=None, failure: float=None, results=None, **kwargs) -> None: + super(DebugSendResponse, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.success = success + self.failure = failure + self.results = results diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response.py index 6d7907d66fd4..41dd380aa554 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response.py @@ -14,8 +14,8 @@ class ErrorResponse(Model): - """Error reponse indicates NotificationHubs service is not able to process the - incoming request. The reason is provided in the error message. + """Error response 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 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 index 22530f8dc898..96d571a8dbf4 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response_py3.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/error_response_py3.py @@ -14,8 +14,8 @@ class ErrorResponse(Model): - """Error reponse indicates NotificationHubs service is not able to process the - incoming request. The reason is provided in the error message. + """Error response 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 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 95ff2e76a3f5..ac410f2763a8 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential.py @@ -19,7 +19,7 @@ class MpnsCredential(Model): :type mpns_certificate: str :param certificate_key: The certificate key for this credential. :type certificate_key: str - :param thumbprint: The Mpns certificate Thumbprint + :param thumbprint: The MPNS certificate Thumbprint :type thumbprint: str """ 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 index a1d2da085167..8c076e32d322 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential_py3.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/mpns_credential_py3.py @@ -19,7 +19,7 @@ class MpnsCredential(Model): :type mpns_certificate: str :param certificate_key: The certificate key for this credential. :type certificate_key: str - :param thumbprint: The Mpns certificate Thumbprint + :param thumbprint: The MPNS certificate Thumbprint :type thumbprint: str """ diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_patch_parameters.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_patch_parameters.py new file mode 100644 index 000000000000..9906c1f182f4 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_patch_parameters.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 import Resource + + +class NotificationHubPatchParameters(Resource): + """Parameters supplied to the patch 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_patch_parameters_name: The NotificationHub name. + :type notification_hub_patch_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_patch_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, **kwargs): + super(NotificationHubPatchParameters, self).__init__(**kwargs) + self.notification_hub_patch_parameters_name = kwargs.get('notification_hub_patch_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_patch_parameters_py3.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_patch_parameters_py3.py new file mode 100644 index 000000000000..5743571caa10 --- /dev/null +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/notification_hub_patch_parameters_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 NotificationHubPatchParameters(Resource): + """Parameters supplied to the patch 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_patch_parameters_name: The NotificationHub name. + :type notification_hub_patch_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_patch_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_patch_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(NotificationHubPatchParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.notification_hub_patch_parameters_name = notification_hub_patch_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/operations/namespaces_operations.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/namespaces_operations.py index 066abe6ebc22..26c7bd6db320 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/namespaces_operations.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/namespaces_operations.py @@ -71,6 +71,7 @@ def check_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -83,9 +84,8 @@ def check_availability( body_content = self._serialize.body(parameters, 'CheckAvailabilityParameters') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -141,6 +141,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -153,9 +154,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'NamespaceCreateOrUpdateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -215,6 +215,7 @@ def patch( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -227,9 +228,8 @@ def patch( body_content = self._serialize.body(parameters, 'NamespacePatchParameters') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -266,7 +266,6 @@ def _delete_initial( # 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: @@ -275,8 +274,8 @@ def _delete_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: exp = CloudError(response) @@ -362,7 +361,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -371,8 +370,8 @@ def get( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -399,7 +398,7 @@ def create_or_update_authorization_rule( :type resource_group_name: str :param namespace_name: The namespace name. :type namespace_name: str - :param authorization_rule_name: Aauthorization Rule Name. + :param authorization_rule_name: Authorization Rule Name. :type authorization_rule_name: str :param properties: Properties of the Namespace AuthorizationRules. :type properties: @@ -434,6 +433,7 @@ def create_or_update_authorization_rule( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -446,9 +446,8 @@ def create_or_update_authorization_rule( body_content = self._serialize.body(parameters, 'SharedAccessAuthorizationRuleCreateOrUpdateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -502,7 +501,6 @@ def delete_authorization_rule( # 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: @@ -511,8 +509,8 @@ def delete_authorization_rule( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -562,7 +560,7 @@ def get_authorization_rule( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -571,8 +569,8 @@ def get_authorization_rule( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -630,7 +628,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -639,9 +637,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -696,7 +693,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -705,9 +702,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -768,7 +764,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -777,9 +773,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -838,7 +833,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -847,8 +842,8 @@ def list_keys( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -911,6 +906,7 @@ def regenerate_keys( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -923,9 +919,8 @@ def regenerate_keys( body_content = self._serialize.body(parameters, 'PolicykeyResource') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 d81cee2faf2e..343bfd03bce3 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 @@ -73,6 +73,7 @@ def check_notification_hub_availability( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -85,9 +86,8 @@ def check_notification_hub_availability( body_content = self._serialize.body(parameters, 'CheckAvailabilityParameters') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -146,6 +146,7 @@ def create_or_update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -158,9 +159,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'NotificationHubCreateOrUpdateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: exp = CloudError(response) @@ -181,6 +181,82 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}'} + def patch( + self, resource_group_name, namespace_name, notification_hub_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """Patch a 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 notification_hub_name: The notification hub name. + :type notification_hub_name: str + :param parameters: Parameters supplied to patch a NotificationHub + Resource. + :type parameters: + ~azure.mgmt.notificationhubs.models.NotificationHubPatchParameters + :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: NotificationHubResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.NotificationHubResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + 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'), + 'notificationHubName': self._serialize.url("notification_hub_name", notification_hub_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['Accept'] = 'application/json' + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'NotificationHubPatchParameters') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **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('NotificationHubResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch.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): """Deletes a notification hub associated with a namespace. @@ -216,7 +292,6 @@ def delete( # 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: @@ -225,8 +300,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -274,7 +349,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -283,8 +358,8 @@ def get( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -303,6 +378,80 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}'} + def debug_send( + self, resource_group_name, namespace_name, notification_hub_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """test send a push notification. + + :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 notification_hub_name: The notification hub name. + :type notification_hub_name: str + :param parameters: Debug send parameters + :type parameters: object + :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: DebugSendResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.notificationhubs.models.DebugSendResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.debug_send.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'), + 'notificationHubName': self._serialize.url("notification_hub_name", notification_hub_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['Accept'] = 'application/json' + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'object') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [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('DebugSendResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + debug_send.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend'} + def create_or_update_authorization_rule( 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. @@ -349,6 +498,7 @@ def create_or_update_authorization_rule( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -361,9 +511,8 @@ def create_or_update_authorization_rule( body_content = self._serialize.body(parameters, 'SharedAccessAuthorizationRuleCreateOrUpdateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -420,7 +569,6 @@ def delete_authorization_rule( # 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: @@ -429,8 +577,8 @@ def delete_authorization_rule( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -483,7 +631,7 @@ def get_authorization_rule( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -492,8 +640,8 @@ def get_authorization_rule( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -552,7 +700,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -561,9 +709,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -627,7 +774,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -636,9 +783,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -699,7 +845,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -708,8 +854,8 @@ def list_keys( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -775,6 +921,7 @@ def regenerate_keys( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -787,9 +934,8 @@ def regenerate_keys( body_content = self._serialize.body(parameters, 'PolicykeyResource') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -844,7 +990,7 @@ def get_pns_credentials( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -853,8 +999,8 @@ def get_pns_credentials( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/operations.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/operations.py index 4b966f29589b..65a041411647 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/operations.py +++ b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/operations/operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/version.py b/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/version.py index 53c4c7ea05e8..be75d8eae586 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 = "2.0.0" +VERSION = "2.1.0" diff --git a/azure-mgmt-notificationhubs/setup.py b/azure-mgmt-notificationhubs/setup.py index 605d8a7bc905..b7049c601991 100644 --- a/azure-mgmt-notificationhubs/setup.py +++ b/azure-mgmt-notificationhubs/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',