From 365ce82175e3b7b1f8e9119fd8d2b1fae3e64d73 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 15 Jul 2020 06:39:20 +0000 Subject: [PATCH] Generated from a177c3ca7cca105c403c676741433ce8ac1b3b92 minor changes in descriptions --- .../mgmt/apimanagement/models/__init__.py | 3 +++ .../models/_api_management_client_enums.py | 1 + .../mgmt/apimanagement/models/_models.py | 26 ++++++++++++++++--- .../mgmt/apimanagement/models/_models_py3.py | 26 ++++++++++++++++--- .../_quota_by_counter_keys_operations.py | 4 +-- .../_quota_by_period_keys_operations.py | 4 +-- .../operations/_subscription_operations.py | 16 ++++++++++-- .../_user_confirmation_password_operations.py | 8 +++++- .../operations/_user_operations.py | 14 ++++++++-- .../azure-mgmt-apimanagement/setup.py | 4 ++- 10 files changed, 90 insertions(+), 16 deletions(-) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py index 63f339e9d0f0..681188e0ace8 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py @@ -135,6 +135,7 @@ from ._models_py3 import QuotaCounterContract from ._models_py3 import QuotaCounterValueContract from ._models_py3 import QuotaCounterValueContractProperties + from ._models_py3 import QuotaCounterValueUpdateContract from ._models_py3 import RecipientEmailCollection from ._models_py3 import RecipientEmailContract from ._models_py3 import RecipientsContractProperties @@ -306,6 +307,7 @@ from ._models import QuotaCounterContract from ._models import QuotaCounterValueContract from ._models import QuotaCounterValueContractProperties + from ._models import QuotaCounterValueUpdateContract from ._models import RecipientEmailCollection from ._models import RecipientEmailContract from ._models import RecipientsContractProperties @@ -557,6 +559,7 @@ 'QuotaCounterContract', 'QuotaCounterValueContract', 'QuotaCounterValueContractProperties', + 'QuotaCounterValueUpdateContract', 'RecipientEmailCollection', 'RecipientEmailContract', 'RecipientsContractProperties', diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_api_management_client_enums.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_api_management_client_enums.py index 6c2944f5bc97..dd052c71ba3b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_api_management_client_enums.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_api_management_client_enums.py @@ -210,6 +210,7 @@ class KeyType(str, Enum): class AppType(str, Enum): + portal = "portal" #: User create request was sent by legacy developer portal. developer_portal = "developerPortal" #: User create request was sent by new developer portal. diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py index 3e016257f412..9cc85274fc78 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py @@ -6142,6 +6142,26 @@ def __init__(self, **kwargs): self.kb_transferred = kwargs.get('kb_transferred', None) +class QuotaCounterValueUpdateContract(Model): + """Quota counter value details. + + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + """ + + _attribute_map = { + 'calls_count': {'key': 'properties.callsCount', 'type': 'int'}, + 'kb_transferred': {'key': 'properties.kbTransferred', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(QuotaCounterValueUpdateContract, self).__init__(**kwargs) + self.calls_count = kwargs.get('calls_count', None) + self.kb_transferred = kwargs.get('kb_transferred', None) + + class RecipientEmailCollection(Model): """Paged Recipient User list representation. @@ -6976,7 +6996,7 @@ class SubscriptionContract(Resource): value. :type secondary_key: str :param state_comment: Optional subscription comment added by an - administrator. + administrator when the state is changed to the 'rejected'. :type state_comment: str :param allow_tracing: Determines whether tracing is enabled :type allow_tracing: bool @@ -7183,7 +7203,7 @@ class SubscriptionUpdateParameters(Model): 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :param state_comment: Comments describing subscription state change by the - administrator. + administrator when the state is changed to the 'rejected'. :type state_comment: str :param allow_tracing: Determines whether tracing can be enabled :type allow_tracing: bool @@ -7620,7 +7640,7 @@ class UserCreateParameters(Model): password is generated. :type password: str :param app_type: Determines the type of application which send the create - user request. Default is old publisher portal. Possible values include: + user request. Default is legacy portal. Possible values include: 'portal', 'developerPortal' :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param confirmation: Determines the type of confirmation e-mail that will diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py index 1e014d4da659..4413e5ab6910 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py @@ -6142,6 +6142,26 @@ def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwarg self.kb_transferred = kb_transferred +class QuotaCounterValueUpdateContract(Model): + """Quota counter value details. + + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + """ + + _attribute_map = { + 'calls_count': {'key': 'properties.callsCount', 'type': 'int'}, + 'kb_transferred': {'key': 'properties.kbTransferred', 'type': 'float'}, + } + + def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwargs) -> None: + super(QuotaCounterValueUpdateContract, self).__init__(**kwargs) + self.calls_count = calls_count + self.kb_transferred = kb_transferred + + class RecipientEmailCollection(Model): """Paged Recipient User list representation. @@ -6976,7 +6996,7 @@ class SubscriptionContract(Resource): value. :type secondary_key: str :param state_comment: Optional subscription comment added by an - administrator. + administrator when the state is changed to the 'rejected'. :type state_comment: str :param allow_tracing: Determines whether tracing is enabled :type allow_tracing: bool @@ -7183,7 +7203,7 @@ class SubscriptionUpdateParameters(Model): 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :param state_comment: Comments describing subscription state change by the - administrator. + administrator when the state is changed to the 'rejected'. :type state_comment: str :param allow_tracing: Determines whether tracing can be enabled :type allow_tracing: bool @@ -7620,7 +7640,7 @@ class UserCreateParameters(Model): password is generated. :type password: str :param app_type: Determines the type of application which send the create - user request. Default is old publisher portal. Possible values include: + user request. Default is legacy portal. Possible values include: 'portal', 'developerPortal' :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param confirmation: Determines the type of confirmation e-mail that will diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_counter_keys_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_counter_keys_operations.py index 0d4220b0cfd6..4b7b87dac019 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_counter_keys_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_counter_keys_operations.py @@ -139,7 +139,7 @@ def update( :raises: :class:`ErrorResponseException` """ - parameters = models.QuotaCounterValueContractProperties(calls_count=calls_count, kb_transferred=kb_transferred) + parameters = models.QuotaCounterValueUpdateContract(calls_count=calls_count, kb_transferred=kb_transferred) # Construct URL url = self.update.metadata['url'] @@ -166,7 +166,7 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'QuotaCounterValueContractProperties') + body_content = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_period_keys_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_period_keys_operations.py index db29c87e0c04..e10229eb6993 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_period_keys_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_period_keys_operations.py @@ -142,7 +142,7 @@ def update( :raises: :class:`ErrorResponseException` """ - parameters = models.QuotaCounterValueContractProperties(calls_count=calls_count, kb_transferred=kb_transferred) + parameters = models.QuotaCounterValueUpdateContract(calls_count=calls_count, kb_transferred=kb_transferred) # Construct URL url = self.update.metadata['url'] @@ -170,7 +170,7 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'QuotaCounterValueContractProperties') + body_content = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py index c6dbaa892536..617ffe42b0f2 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py @@ -265,7 +265,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} def create_or_update( - self, resource_group_name, service_name, sid, parameters, notify=None, if_match=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, sid, parameters, notify=None, if_match=None, app_type="portal", custom_headers=None, raw=False, **operation_config): """Creates or updates the subscription of specified user to the specified product. @@ -287,6 +287,10 @@ def create_or_update( :param if_match: ETag of the Entity. Not required when creating an entity, but required when updating an entity. :type if_match: str + :param app_type: Determines the type of application which send the + create user request. Default is legacy publisher portal. Possible + values include: 'portal', 'developerPortal' + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -313,6 +317,8 @@ def create_or_update( if notify is not None: query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if app_type is not None: + query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str') # Construct headers header_parameters = {} @@ -359,7 +365,7 @@ def create_or_update( create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} def update( - self, resource_group_name, service_name, sid, parameters, if_match, notify=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, sid, parameters, if_match, notify=None, app_type="portal", custom_headers=None, raw=False, **operation_config): """Updates the details of a subscription specified by its identifier. :param resource_group_name: The name of the resource group. @@ -381,6 +387,10 @@ def update( subscription - If true, send email notification of change of state of subscription :type notify: bool + :param app_type: Determines the type of application which send the + create user request. Default is legacy publisher portal. Possible + values include: 'portal', 'developerPortal' + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -406,6 +416,8 @@ def update( if notify is not None: query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if app_type is not None: + query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str') # Construct headers header_parameters = {} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py index 193c9b412fe3..329336c87ae0 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def send( - self, resource_group_name, service_name, user_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, user_id, app_type="portal", custom_headers=None, raw=False, **operation_config): """Sends confirmation. :param resource_group_name: The name of the resource group. @@ -49,6 +49,10 @@ def send( :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str + :param app_type: Determines the type of application which send the + create user request. Default is legacy publisher portal. Possible + values include: 'portal', 'developerPortal' + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -72,6 +76,8 @@ def send( # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if app_type is not None: + query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str') # Construct headers header_parameters = {} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_operations.py index 2fd37c3c6203..0f7a77beb5e1 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_operations.py @@ -268,7 +268,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} def create_or_update( - self, resource_group_name, service_name, user_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, user_id, parameters, notify=None, if_match=None, custom_headers=None, raw=False, **operation_config): """Creates or Updates a user. :param resource_group_name: The name of the resource group. @@ -281,6 +281,8 @@ def create_or_update( :param parameters: Create or update parameters. :type parameters: ~azure.mgmt.apimanagement.models.UserCreateParameters + :param notify: Send an Email notification to the User. + :type notify: bool :param if_match: ETag of the Entity. Not required when creating an entity, but required when updating an entity. :type if_match: str @@ -307,6 +309,8 @@ def create_or_update( # Construct parameters query_parameters = {} + if notify is not None: + query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -422,7 +426,7 @@ def update( update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} def delete( - self, resource_group_name, service_name, user_id, if_match, delete_subscriptions=None, notify=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, user_id, if_match, delete_subscriptions=None, notify=None, app_type="portal", custom_headers=None, raw=False, **operation_config): """Deletes specific user. :param resource_group_name: The name of the resource group. @@ -441,6 +445,10 @@ def delete( :type delete_subscriptions: bool :param notify: Send an Account Closed Email notification to the User. :type notify: bool + :param app_type: Determines the type of application which send the + create user request. Default is legacy publisher portal. Possible + values include: 'portal', 'developerPortal' + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -468,6 +476,8 @@ def delete( if notify is not None: query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if app_type is not None: + query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str') # Construct headers header_parameters = {} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/setup.py b/sdk/apimanagement/azure-mgmt-apimanagement/setup.py index 071df946dd93..a6a7586a2742 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/setup.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)