From 8f159f8e630769eb5c897880519fc6c855bdd147 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 14 Nov 2018 01:34:12 +0000 Subject: [PATCH 1/2] Generated from 8363d68686accd9a2c5c1727ebab556ca7529cb3 /identity endpoint added --- .../mgmt/apimanagement/models/__init__.py | 3 + .../models/current_user_identity.py | 28 +++++++++ .../models/current_user_identity_py3.py | 28 +++++++++ .../operations/user_operations.py | 61 +++++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/current_user_identity.py create mode 100644 azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/current_user_identity_py3.py diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py index d35d341ff41c..4525e6aa1714 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py @@ -152,6 +152,7 @@ from .user_token_parameters_py3 import UserTokenParameters from .user_token_result_py3 import UserTokenResult from .user_update_parameters_py3 import UserUpdateParameters + from .current_user_identity_py3 import CurrentUserIdentity from .api_version_set_contract_py3 import ApiVersionSetContract from .api_version_set_entity_base_py3 import ApiVersionSetEntityBase from .api_version_set_update_parameters_py3 import ApiVersionSetUpdateParameters @@ -298,6 +299,7 @@ from .user_token_parameters import UserTokenParameters from .user_token_result import UserTokenResult from .user_update_parameters import UserUpdateParameters + from .current_user_identity import CurrentUserIdentity from .api_version_set_contract import ApiVersionSetContract from .api_version_set_entity_base import ApiVersionSetEntityBase from .api_version_set_update_parameters import ApiVersionSetUpdateParameters @@ -510,6 +512,7 @@ 'UserTokenParameters', 'UserTokenResult', 'UserUpdateParameters', + 'CurrentUserIdentity', 'ApiVersionSetContract', 'ApiVersionSetEntityBase', 'ApiVersionSetUpdateParameters', diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/current_user_identity.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/current_user_identity.py new file mode 100644 index 000000000000..c2485d5a5484 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/current_user_identity.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 CurrentUserIdentity(Model): + """CurrentUserIdentity. + + :param id: API Management service user id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CurrentUserIdentity, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/current_user_identity_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/current_user_identity_py3.py new file mode 100644 index 000000000000..f5b2c3f5187f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/current_user_identity_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 CurrentUserIdentity(Model): + """CurrentUserIdentity. + + :param id: API Management service user id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(CurrentUserIdentity, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_operations.py index 292e683e2735..1576ffdd718c 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_operations.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/user_operations.py @@ -36,6 +36,67 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def get_identity( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Returns calling user identity information. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_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`. + :return: CurrentUserIdentity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.CurrentUserIdentity or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_identity.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + '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' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CurrentUserIdentity', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_identity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identity'} + def list_by_service( self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): """Lists a collection of registered users in the specified service From 3a3e26cdecff2c15f6010ba8d293d2a93f9447a4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 14 Nov 2018 16:41:17 +0000 Subject: [PATCH 2/2] Generated from 8363d68686accd9a2c5c1727ebab556ca7529cb3 /identity endpoint added --- .../mgmt/apimanagement/models/__init__.py | 6 ++ .../apimanagement/models/issue_contract.py | 26 +++---- .../models/issue_contract_base_properties.py | 38 ++++++++++ .../issue_contract_base_properties_py3.py | 38 ++++++++++ .../models/issue_contract_py3.py | 26 +++---- .../models/issue_update_contract.py | 50 +++++++++++++ .../models/issue_update_contract_py3.py | 50 +++++++++++++ .../operations/api_issue_operations.py | 72 +++++++++++++++++++ 8 files changed, 280 insertions(+), 26 deletions(-) create mode 100644 azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_base_properties.py create mode 100644 azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_base_properties_py3.py create mode 100644 azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_update_contract.py create mode 100644 azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_update_contract_py3.py diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py index 4525e6aa1714..9ba1d3c0005e 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py @@ -43,6 +43,8 @@ from .operation_update_contract_py3 import OperationUpdateContract from .schema_contract_py3 import SchemaContract from .issue_contract_py3 import IssueContract + from .issue_update_contract_py3 import IssueUpdateContract + from .issue_contract_base_properties_py3 import IssueContractBaseProperties from .issue_comment_contract_py3 import IssueCommentContract from .issue_attachment_contract_py3 import IssueAttachmentContract from .logger_contract_py3 import LoggerContract @@ -190,6 +192,8 @@ from .operation_update_contract import OperationUpdateContract from .schema_contract import SchemaContract from .issue_contract import IssueContract + from .issue_update_contract import IssueUpdateContract + from .issue_contract_base_properties import IssueContractBaseProperties from .issue_comment_contract import IssueCommentContract from .issue_attachment_contract import IssueAttachmentContract from .logger_contract import LoggerContract @@ -403,6 +407,8 @@ 'OperationUpdateContract', 'SchemaContract', 'IssueContract', + 'IssueUpdateContract', + 'IssueContractBaseProperties', 'IssueCommentContract', 'IssueAttachmentContract', 'LoggerContract', diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract.py index 2a2c6ac6a303..7e9a0bb26e16 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract.py @@ -26,21 +26,21 @@ class IssueContract(Resource): :vartype name: str :ivar type: Resource type for API Management resource. :vartype type: str - :param title: Required. The issue title. - :type title: str - :param description: Required. Text describing the issue. - :type description: str :param created_date: Date and time when the issue was created. :type created_date: datetime :param state: Status of the issue. Possible values include: 'proposed', 'open', 'removed', 'resolved', 'closed' :type state: str or ~azure.mgmt.apimanagement.models.State - :param user_id: Required. A resource identifier for the user created the - issue. - :type user_id: str :param api_id: A resource identifier for the API the issue was created for. :type api_id: str + :param title: Required. The issue title. + :type title: str + :param description: Required. Text describing the issue. + :type description: str + :param user_id: Required. A resource identifier for the user created the + issue. + :type user_id: str """ _validation = { @@ -56,19 +56,19 @@ class IssueContract(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'title': {'key': 'properties.title', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, 'state': {'key': 'properties.state', 'type': 'str'}, - 'user_id': {'key': 'properties.userId', 'type': 'str'}, 'api_id': {'key': 'properties.apiId', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, } def __init__(self, **kwargs): super(IssueContract, self).__init__(**kwargs) - self.title = kwargs.get('title', None) - self.description = kwargs.get('description', None) self.created_date = kwargs.get('created_date', None) self.state = kwargs.get('state', None) - self.user_id = kwargs.get('user_id', None) self.api_id = kwargs.get('api_id', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.user_id = kwargs.get('user_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_base_properties.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_base_properties.py new file mode 100644 index 000000000000..8bf825f0f0de --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_base_properties.py @@ -0,0 +1,38 @@ +# 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 IssueContractBaseProperties(Model): + """Issue contract Base Properties. + + :param created_date: Date and time when the issue was created. + :type created_date: datetime + :param state: Status of the issue. Possible values include: 'proposed', + 'open', 'removed', 'resolved', 'closed' + :type state: str or ~azure.mgmt.apimanagement.models.State + :param api_id: A resource identifier for the API the issue was created + for. + :type api_id: str + """ + + _attribute_map = { + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'api_id': {'key': 'apiId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IssueContractBaseProperties, self).__init__(**kwargs) + self.created_date = kwargs.get('created_date', None) + self.state = kwargs.get('state', None) + self.api_id = kwargs.get('api_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_base_properties_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_base_properties_py3.py new file mode 100644 index 000000000000..30126d7f0845 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_base_properties_py3.py @@ -0,0 +1,38 @@ +# 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 IssueContractBaseProperties(Model): + """Issue contract Base Properties. + + :param created_date: Date and time when the issue was created. + :type created_date: datetime + :param state: Status of the issue. Possible values include: 'proposed', + 'open', 'removed', 'resolved', 'closed' + :type state: str or ~azure.mgmt.apimanagement.models.State + :param api_id: A resource identifier for the API the issue was created + for. + :type api_id: str + """ + + _attribute_map = { + 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, + 'state': {'key': 'state', 'type': 'str'}, + 'api_id': {'key': 'apiId', 'type': 'str'}, + } + + def __init__(self, *, created_date=None, state=None, api_id: str=None, **kwargs) -> None: + super(IssueContractBaseProperties, self).__init__(**kwargs) + self.created_date = created_date + self.state = state + self.api_id = api_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_py3.py index fb9605cf3507..f635214f5b15 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_py3.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_py3.py @@ -26,21 +26,21 @@ class IssueContract(Resource): :vartype name: str :ivar type: Resource type for API Management resource. :vartype type: str - :param title: Required. The issue title. - :type title: str - :param description: Required. Text describing the issue. - :type description: str :param created_date: Date and time when the issue was created. :type created_date: datetime :param state: Status of the issue. Possible values include: 'proposed', 'open', 'removed', 'resolved', 'closed' :type state: str or ~azure.mgmt.apimanagement.models.State - :param user_id: Required. A resource identifier for the user created the - issue. - :type user_id: str :param api_id: A resource identifier for the API the issue was created for. :type api_id: str + :param title: Required. The issue title. + :type title: str + :param description: Required. Text describing the issue. + :type description: str + :param user_id: Required. A resource identifier for the user created the + issue. + :type user_id: str """ _validation = { @@ -56,19 +56,19 @@ class IssueContract(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'title': {'key': 'properties.title', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, 'state': {'key': 'properties.state', 'type': 'str'}, - 'user_id': {'key': 'properties.userId', 'type': 'str'}, 'api_id': {'key': 'properties.apiId', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, } def __init__(self, *, title: str, description: str, user_id: str, created_date=None, state=None, api_id: str=None, **kwargs) -> None: super(IssueContract, self).__init__(**kwargs) - self.title = title - self.description = description self.created_date = created_date self.state = state - self.user_id = user_id self.api_id = api_id + self.title = title + self.description = description + self.user_id = user_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_update_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_update_contract.py new file mode 100644 index 000000000000..cd0c09f71fe8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_update_contract.py @@ -0,0 +1,50 @@ +# 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 IssueUpdateContract(Model): + """Issue update Parameters. + + :param created_date: Date and time when the issue was created. + :type created_date: datetime + :param state: Status of the issue. Possible values include: 'proposed', + 'open', 'removed', 'resolved', 'closed' + :type state: str or ~azure.mgmt.apimanagement.models.State + :param api_id: A resource identifier for the API the issue was created + for. + :type api_id: str + :param title: The issue title. + :type title: str + :param description: Text describing the issue. + :type description: str + :param user_id: A resource identifier for the user created the issue. + :type user_id: str + """ + + _attribute_map = { + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'api_id': {'key': 'properties.apiId', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IssueUpdateContract, self).__init__(**kwargs) + self.created_date = kwargs.get('created_date', None) + self.state = kwargs.get('state', None) + self.api_id = kwargs.get('api_id', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.user_id = kwargs.get('user_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_update_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_update_contract_py3.py new file mode 100644 index 000000000000..adaf82829d94 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_update_contract_py3.py @@ -0,0 +1,50 @@ +# 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 IssueUpdateContract(Model): + """Issue update Parameters. + + :param created_date: Date and time when the issue was created. + :type created_date: datetime + :param state: Status of the issue. Possible values include: 'proposed', + 'open', 'removed', 'resolved', 'closed' + :type state: str or ~azure.mgmt.apimanagement.models.State + :param api_id: A resource identifier for the API the issue was created + for. + :type api_id: str + :param title: The issue title. + :type title: str + :param description: Text describing the issue. + :type description: str + :param user_id: A resource identifier for the user created the issue. + :type user_id: str + """ + + _attribute_map = { + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'api_id': {'key': 'properties.apiId', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + } + + def __init__(self, *, created_date=None, state=None, api_id: str=None, title: str=None, description: str=None, user_id: str=None, **kwargs) -> None: + super(IssueUpdateContract, self).__init__(**kwargs) + self.created_date = created_date + self.state = state + self.api_id = api_id + self.title = title + self.description = description + self.user_id = user_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_operations.py index b3e3633b07d4..c89df36dc15d 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_operations.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_operations.py @@ -350,6 +350,78 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} + def update( + self, resource_group_name, service_name, api_id, issue_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Updates an existing issue for an API. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param api_id: API identifier. Must be unique in the current API + Management service instance. + :type api_id: str + :param issue_id: Issue identifier. Must be unique in the current API + Management service instance. + :type issue_id: str + :param parameters: Update parameters. + :type parameters: ~azure.mgmt.apimanagement.models.IssueUpdateContract + :param if_match: ETag of the Issue Entity. ETag should match the + current entity state from the header response of the GET request or it + should be * for unconditional update. + :type if_match: 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`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=80, min_length=1, pattern=r'(^[\w]+$)|(^[\w][\w\-]+[\w]$)'), + 'issueId': self._serialize.url("issue_id", issue_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + '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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, 'IssueUpdateContract') + + # 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 [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} + def delete( self, resource_group_name, service_name, api_id, issue_id, if_match, custom_headers=None, raw=False, **operation_config): """Deletes the specified Issue from an API.