diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/api_management_client.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/api_management_client.py index 430a960255ec..71cbec822c47 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/api_management_client.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/api_management_client.py @@ -26,6 +26,14 @@ from .operations.api_schema_operations import ApiSchemaOperations from .operations.api_diagnostic_operations import ApiDiagnosticOperations from .operations.api_diagnostic_logger_operations import ApiDiagnosticLoggerOperations +from .operations.api_issues_operations import ApiIssuesOperations +from .operations.api_issue_operations import ApiIssueOperations +from .operations.api_issue_comments_operations import ApiIssueCommentsOperations +from .operations.api_issu_comment_operations import ApiIssuCommentOperations +from .operations.api_issue_comment_operations import ApiIssueCommentOperations +from .operations.api_issue_attachments_operations import ApiIssueAttachmentsOperations +from .operations.api_issu_attachment_operations import ApiIssuAttachmentOperations +from .operations.api_issue_attachment_operations import ApiIssueAttachmentOperations from .operations.authorization_server_operations import AuthorizationServerOperations from .operations.backend_operations import BackendOperations from .operations.certificate_operations import CertificateOperations @@ -138,6 +146,22 @@ class ApiManagementClient(object): :vartype api_diagnostic: azure.mgmt.apimanagement.operations.ApiDiagnosticOperations :ivar api_diagnostic_logger: ApiDiagnosticLogger operations :vartype api_diagnostic_logger: azure.mgmt.apimanagement.operations.ApiDiagnosticLoggerOperations + :ivar api_issues: ApiIssues operations + :vartype api_issues: azure.mgmt.apimanagement.operations.ApiIssuesOperations + :ivar api_issue: ApiIssue operations + :vartype api_issue: azure.mgmt.apimanagement.operations.ApiIssueOperations + :ivar api_issue_comments: ApiIssueComments operations + :vartype api_issue_comments: azure.mgmt.apimanagement.operations.ApiIssueCommentsOperations + :ivar api_issu_comment: ApiIssuComment operations + :vartype api_issu_comment: azure.mgmt.apimanagement.operations.ApiIssuCommentOperations + :ivar api_issue_comment: ApiIssueComment operations + :vartype api_issue_comment: azure.mgmt.apimanagement.operations.ApiIssueCommentOperations + :ivar api_issue_attachments: ApiIssueAttachments operations + :vartype api_issue_attachments: azure.mgmt.apimanagement.operations.ApiIssueAttachmentsOperations + :ivar api_issu_attachment: ApiIssuAttachment operations + :vartype api_issu_attachment: azure.mgmt.apimanagement.operations.ApiIssuAttachmentOperations + :ivar api_issue_attachment: ApiIssueAttachment operations + :vartype api_issue_attachment: azure.mgmt.apimanagement.operations.ApiIssueAttachmentOperations :ivar authorization_server: AuthorizationServer operations :vartype authorization_server: azure.mgmt.apimanagement.operations.AuthorizationServerOperations :ivar backend: Backend operations @@ -272,6 +296,22 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.api_diagnostic_logger = ApiDiagnosticLoggerOperations( self._client, self.config, self._serialize, self._deserialize) + self.api_issues = ApiIssuesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_issue = ApiIssueOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_issue_comments = ApiIssueCommentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_issu_comment = ApiIssuCommentOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_issue_comment = ApiIssueCommentOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_issue_attachments = ApiIssueAttachmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_issu_attachment = ApiIssuAttachmentOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_issue_attachment = ApiIssueAttachmentOperations( + self._client, self.config, self._serialize, self._deserialize) self.authorization_server = AuthorizationServerOperations( self._client, self.config, self._serialize, self._deserialize) self.backend = BackendOperations( diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py index d9da2332eed5..99bc8a8aedc1 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py @@ -40,6 +40,9 @@ from .operation_entity_base_contract_py3 import OperationEntityBaseContract from .operation_update_contract_py3 import OperationUpdateContract from .schema_contract_py3 import SchemaContract + from .issue_contract_py3 import IssueContract + from .issue_comment_contract_py3 import IssueCommentContract + from .issue_attachment_contract_py3 import IssueAttachmentContract from .logger_contract_py3 import LoggerContract from .diagnostic_contract_py3 import DiagnosticContract from .product_entity_base_parameters_py3 import ProductEntityBaseParameters @@ -181,6 +184,9 @@ from .operation_entity_base_contract import OperationEntityBaseContract from .operation_update_contract import OperationUpdateContract from .schema_contract import SchemaContract + from .issue_contract import IssueContract + from .issue_comment_contract import IssueCommentContract + from .issue_attachment_contract import IssueAttachmentContract from .logger_contract import LoggerContract from .diagnostic_contract import DiagnosticContract from .product_entity_base_parameters import ProductEntityBaseParameters @@ -301,6 +307,9 @@ from .schema_contract_paged import SchemaContractPaged from .diagnostic_contract_paged import DiagnosticContractPaged from .logger_contract_paged import LoggerContractPaged +from .issue_contract_paged import IssueContractPaged +from .issue_comment_contract_paged import IssueCommentContractPaged +from .issue_attachment_contract_paged import IssueAttachmentContractPaged from .authorization_server_contract_paged import AuthorizationServerContractPaged from .backend_contract_paged import BackendContractPaged from .certificate_contract_paged import CertificateContractPaged @@ -326,6 +335,7 @@ ContentFormat, SoapApiType, ApiType, + State, LoggerType, ProductState, GrantType, @@ -383,6 +393,9 @@ 'OperationEntityBaseContract', 'OperationUpdateContract', 'SchemaContract', + 'IssueContract', + 'IssueCommentContract', + 'IssueAttachmentContract', 'LoggerContract', 'DiagnosticContract', 'ProductEntityBaseParameters', @@ -503,6 +516,9 @@ 'SchemaContractPaged', 'DiagnosticContractPaged', 'LoggerContractPaged', + 'IssueContractPaged', + 'IssueCommentContractPaged', + 'IssueAttachmentContractPaged', 'AuthorizationServerContractPaged', 'BackendContractPaged', 'CertificateContractPaged', @@ -527,6 +543,7 @@ 'ContentFormat', 'SoapApiType', 'ApiType', + 'State', 'LoggerType', 'ProductState', 'GrantType', diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_client_enums.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_client_enums.py index fccd5681cb26..3cffd1387ec5 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_client_enums.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/api_management_client_enums.py @@ -14,8 +14,10 @@ class PolicyContentFormat(str, Enum): - xml = "xml" - xml_link = "xml-link" + xml = "xml" #: The contents are inline and Content type is an XML document. + xml_link = "xml-link" #: The policy XML document is hosted on a http endpoint accessible from the API Management service. + rawxml = "rawxml" #: The contents are inline and Content type is a non XML encoded policy document. + rawxml_link = "rawxml-link" #: The policy document is not Xml encoded and is hosted on a http endpoint accessible from the API Management service. class Protocol(str, Enum): @@ -26,18 +28,18 @@ class Protocol(str, Enum): class ContentFormat(str, Enum): - wadl_xml = "wadl-xml" - wadl_link_json = "wadl-link-json" - swagger_json = "swagger-json" - swagger_link_json = "swagger-link-json" - wsdl = "wsdl" - wsdl_link = "wsdl-link" + wadl_xml = "wadl-xml" #: The contents are inline and Content type is a WADL document. + wadl_link_json = "wadl-link-json" #: The WADL document is hosted on a publicly accessible internet address. + swagger_json = "swagger-json" #: The contents are inline and Content Type is a OpenApi 2.0 Document. + swagger_link_json = "swagger-link-json" #: The Open Api 2.0 document is hosted on a publicly accessible internet address. + wsdl = "wsdl" #: The contents are inline and the document is a WSDL/Soap document. + wsdl_link = "wsdl-link" #: The WSDL document is hosted on a publicly accessible internet address. class SoapApiType(str, Enum): - soap_to_rest = "http" - soap_pass_through = "soap" + soap_to_rest = "http" #: Imports a SOAP API having a RESTful front end. + soap_pass_through = "soap" #: Imports the Soap API having a SOAP front end. class ApiType(str, Enum): @@ -46,10 +48,19 @@ class ApiType(str, Enum): soap = "soap" +class State(str, Enum): + + proposed = "proposed" #: The issue is proposed. + open = "open" #: The issue is opened. + removed = "removed" #: The issue was removed. + resolved = "resolved" #: The issue is now resolved. + closed = "closed" #: The issue was closed. + + class LoggerType(str, Enum): - azure_event_hub = "azureEventHub" - application_insights = "applicationInsights" + azure_event_hub = "azureEventHub" #: Azure Event Hub as log destination. + application_insights = "applicationInsights" #: Azure Application Insights as log destination. class ProductState(str, Enum): @@ -60,10 +71,10 @@ class ProductState(str, Enum): class GrantType(str, Enum): - authorization_code = "authorizationCode" - implicit = "implicit" - resource_owner_password = "resourceOwnerPassword" - client_credentials = "clientCredentials" + authorization_code = "authorizationCode" #: Authorization Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.1. + implicit = "implicit" #: Implicit Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.2. + resource_owner_password = "resourceOwnerPassword" #: Resource Owner Password Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.3. + client_credentials = "clientCredentials" #: Client Credentials Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.4. class AuthorizationMethod(str, Enum): @@ -80,8 +91,8 @@ class AuthorizationMethod(str, Enum): class ClientAuthenticationMethod(str, Enum): - basic = "Basic" - body = "Body" + basic = "Basic" #: Basic Client Authentication method. + body = "Body" #: Body based Authentication method. class BearerTokenSendingMethod(str, Enum): @@ -92,8 +103,8 @@ class BearerTokenSendingMethod(str, Enum): class BackendProtocol(str, Enum): - http = "http" - soap = "soap" + http = "http" #: The Backend is a RESTful service. + soap = "soap" #: The Backend is a SOAP service. class HostnameType(str, Enum): @@ -106,17 +117,17 @@ class HostnameType(str, Enum): class SkuType(str, Enum): - developer = "Developer" - standard = "Standard" - premium = "Premium" - basic = "Basic" + developer = "Developer" #: Developer SKU of Api Management. + standard = "Standard" #: Standard SKU of Api Management. + premium = "Premium" #: Premium SKU of Api Management. + basic = "Basic" #: Basic SKU of Api Management. class VirtualNetworkType(str, Enum): - none = "None" - external = "External" - internal = "Internal" + none = "None" #: The service is not part of any Virtual Network. + external = "External" #: The service is part of Virtual Network and it is accessible from Internet. + internal = "Internal" #: The service is part of Virtual Network and it is only accessible from within the virtual network. class NameAvailabilityReason(str, Enum): @@ -135,26 +146,26 @@ class GroupType(str, Enum): class Confirmation(str, Enum): - signup = "signup" - invite = "invite" + signup = "signup" #: Send an e-mail to the user confirming they have successfully signed up. + invite = "invite" #: Send an e-mail inviting the user to sign-up and complete registration. class UserState(str, Enum): - active = "active" - blocked = "blocked" - pending = "pending" - deleted = "deleted" + active = "active" #: User state is active. + blocked = "blocked" #: User is blocked. Blocked users cannot authenticate at developer portal or call API. + pending = "pending" #: User account is pending. Requires identity confirmation before it can be made active. + deleted = "deleted" #: User account is closed. All identities and related entities are removed. class IdentityProviderType(str, Enum): - facebook = "facebook" - google = "google" - microsoft = "microsoft" - twitter = "twitter" - aad = "aad" - aad_b2_c = "aadB2C" + facebook = "facebook" #: Facebook as Identity provider. + google = "google" #: Google as Identity provider. + microsoft = "microsoft" #: Microsoft Live as Identity provider. + twitter = "twitter" #: Twitter as Identity provider. + aad = "aad" #: Azure Active Directory as Identity provider. + aad_b2_c = "aadB2C" #: Azure Active Directory B2C as Identity provider. class ConnectivityStatusType(str, Enum): @@ -190,9 +201,9 @@ class KeyType(str, Enum): class VersioningScheme(str, Enum): - segment = "Segment" - query = "Query" - header = "Header" + segment = "Segment" #: The API Version is passed in a path segment. + query = "Query" #: The API Version is passed in a query parameter. + header = "Header" #: The API Version is passed in a HTTP header. class TemplateName(str, Enum): @@ -215,13 +226,13 @@ class TemplateName(str, Enum): class NotificationName(str, Enum): - request_publisher_notification_message = "RequestPublisherNotificationMessage" - purchase_publisher_notification_message = "PurchasePublisherNotificationMessage" - new_application_notification_message = "NewApplicationNotificationMessage" - bcc = "BCC" - new_issue_publisher_notification_message = "NewIssuePublisherNotificationMessage" - account_closed_publisher = "AccountClosedPublisher" - quota_limit_approaching_publisher_notification_message = "QuotaLimitApproachingPublisherNotificationMessage" + request_publisher_notification_message = "RequestPublisherNotificationMessage" #: The following email recipients and users will receive email notifications about subscription requests for API products requiring approval. + purchase_publisher_notification_message = "PurchasePublisherNotificationMessage" #: The following email recipients and users will receive email notifications about new API product subscriptions. + new_application_notification_message = "NewApplicationNotificationMessage" #: The following email recipients and users will receive email notifications when new applications are submitted to the application gallery. + bcc = "BCC" #: The following recipients will receive blind carbon copies of all emails sent to developers. + new_issue_publisher_notification_message = "NewIssuePublisherNotificationMessage" #: The following email recipients and users will receive email notifications when a new issue or comment is submitted on the developer portal. + account_closed_publisher = "AccountClosedPublisher" #: The following email recipients and users will receive email notifications when developer closes his account. + quota_limit_approaching_publisher_notification_message = "QuotaLimitApproachingPublisherNotificationMessage" #: The following email recipients and users will receive email notifications when subscription usage gets close to usage quota. class PolicyScopeContract(str, Enum): @@ -235,6 +246,6 @@ class PolicyScopeContract(str, Enum): class ExportFormat(str, Enum): - swagger = "swagger-link" - wsdl = "wsdl-link" - wadl = "wadl-link" + swagger = "swagger-link" #: Export the Api Definition in OpenApi Specification 2.0 format to the Storage Blob. + wsdl = "wsdl-link" #: Export the Api Definition in WSDL Schema to Storage Blob. This is only supported for APIs of Type `soap` + wadl = "wadl-link" #: Export the Api Definition in WADL Schema to Storage Blob. diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_attachment_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_attachment_contract.py new file mode 100644 index 000000000000..3b45cdf7a4a3 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_attachment_contract.py @@ -0,0 +1,61 @@ +# 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 IssueAttachmentContract(Resource): + """Issue Attachment Contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param title: Required. Filename by which the binary data will be saved. + :type title: str + :param content_format: Required. Either 'link' if content is provided via + an HTTP link or the MIME type of the Base64-encoded binary data provided + in the 'content' property. + :type content_format: str + :param content: Required. An HTTP link or Base64-encoded binary data. + :type content: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'title': {'required': True}, + 'content_format': {'required': True}, + 'content': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'content_format': {'key': 'properties.contentFormat', 'type': 'str'}, + 'content': {'key': 'properties.content', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IssueAttachmentContract, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.content_format = kwargs.get('content_format', None) + self.content = kwargs.get('content', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_attachment_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_attachment_contract_paged.py new file mode 100644 index 000000000000..31f08fe12743 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_attachment_contract_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class IssueAttachmentContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`IssueAttachmentContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IssueAttachmentContract]'} + } + + def __init__(self, *args, **kwargs): + + super(IssueAttachmentContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_attachment_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_attachment_contract_py3.py new file mode 100644 index 000000000000..0bc78a4daea8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_attachment_contract_py3.py @@ -0,0 +1,61 @@ +# 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 IssueAttachmentContract(Resource): + """Issue Attachment Contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param title: Required. Filename by which the binary data will be saved. + :type title: str + :param content_format: Required. Either 'link' if content is provided via + an HTTP link or the MIME type of the Base64-encoded binary data provided + in the 'content' property. + :type content_format: str + :param content: Required. An HTTP link or Base64-encoded binary data. + :type content: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'title': {'required': True}, + 'content_format': {'required': True}, + 'content': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'content_format': {'key': 'properties.contentFormat', 'type': 'str'}, + 'content': {'key': 'properties.content', 'type': 'str'}, + } + + def __init__(self, *, title: str, content_format: str, content: str, **kwargs) -> None: + super(IssueAttachmentContract, self).__init__(, **kwargs) + self.title = title + self.content_format = content_format + self.content = content diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_comment_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_comment_contract.py new file mode 100644 index 000000000000..edcad5812c6e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_comment_contract.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class IssueCommentContract(Resource): + """Issue Comment Contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param text: Required. Comment text. + :type text: str + :param created_date: Date and time when the comment was created. + :type created_date: datetime + :param user_id: Required. A resource identifier for the user who left the + comment. + :type user_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'text': {'required': True}, + 'user_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'text': {'key': 'properties.text', 'type': 'str'}, + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IssueCommentContract, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.created_date = kwargs.get('created_date', None) + self.user_id = kwargs.get('user_id', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_comment_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_comment_contract_paged.py new file mode 100644 index 000000000000..4dc920095266 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_comment_contract_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class IssueCommentContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`IssueCommentContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IssueCommentContract]'} + } + + def __init__(self, *args, **kwargs): + + super(IssueCommentContractPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_comment_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_comment_contract_py3.py new file mode 100644 index 000000000000..e6d3887b4a92 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_comment_contract_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class IssueCommentContract(Resource): + """Issue Comment Contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param text: Required. Comment text. + :type text: str + :param created_date: Date and time when the comment was created. + :type created_date: datetime + :param user_id: Required. A resource identifier for the user who left the + comment. + :type user_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'text': {'required': True}, + 'user_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'text': {'key': 'properties.text', 'type': 'str'}, + 'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + } + + def __init__(self, *, text: str, user_id: str, created_date=None, **kwargs) -> None: + super(IssueCommentContract, self).__init__(, **kwargs) + self.text = text + self.created_date = created_date + self.user_id = user_id diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract.py new file mode 100644 index 000000000000..2a2c6ac6a303 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract.py @@ -0,0 +1,74 @@ +# 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 IssueContract(Resource): + """Issue Contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'title': {'required': True}, + 'description': {'required': True}, + 'user_id': {'required': True}, + } + + _attribute_map = { + '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'}, + } + + 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) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_paged.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_paged.py new file mode 100644 index 000000000000..fd9375bcab14 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class IssueContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`IssueContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IssueContract]'} + } + + def __init__(self, *args, **kwargs): + + super(IssueContractPaged, self).__init__(*args, **kwargs) 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 new file mode 100644 index 000000000000..fc3d86fc1e3f --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/issue_contract_py3.py @@ -0,0 +1,74 @@ +# 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 IssueContract(Resource): + """Issue Contract details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'title': {'required': True}, + 'description': {'required': True}, + 'user_id': {'required': True}, + } + + _attribute_map = { + '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'}, + } + + 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 diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract.py index 3f9ee1431ee0..63747be29cfd 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract.py @@ -30,7 +30,8 @@ class PolicyContract(Resource): Policy. :type policy_content: str :param content_format: Format of the policyContent. Possible values - include: 'xml', 'xml-link'. Default value: "xml" . + include: 'xml', 'xml-link', 'rawxml', 'rawxml-link'. Default value: "xml" + . :type content_format: str or ~azure.mgmt.apimanagement.models.PolicyContentFormat """ diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract_py3.py index 49fecdc49cf9..d56fa1e6ac2f 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract_py3.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/policy_contract_py3.py @@ -30,7 +30,8 @@ class PolicyContract(Resource): Policy. :type policy_content: str :param content_format: Format of the policyContent. Possible values - include: 'xml', 'xml-link'. Default value: "xml" . + include: 'xml', 'xml-link', 'rawxml', 'rawxml-link'. Default value: "xml" + . :type content_format: str or ~azure.mgmt.apimanagement.models.PolicyContentFormat """ diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py index d9a744f4ab9d..0cf5138659a4 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py @@ -22,6 +22,14 @@ from .api_schema_operations import ApiSchemaOperations from .api_diagnostic_operations import ApiDiagnosticOperations from .api_diagnostic_logger_operations import ApiDiagnosticLoggerOperations +from .api_issues_operations import ApiIssuesOperations +from .api_issue_operations import ApiIssueOperations +from .api_issue_comments_operations import ApiIssueCommentsOperations +from .api_issu_comment_operations import ApiIssuCommentOperations +from .api_issue_comment_operations import ApiIssueCommentOperations +from .api_issue_attachments_operations import ApiIssueAttachmentsOperations +from .api_issu_attachment_operations import ApiIssuAttachmentOperations +from .api_issue_attachment_operations import ApiIssueAttachmentOperations from .authorization_server_operations import AuthorizationServerOperations from .backend_operations import BackendOperations from .certificate_operations import CertificateOperations @@ -80,6 +88,14 @@ 'ApiSchemaOperations', 'ApiDiagnosticOperations', 'ApiDiagnosticLoggerOperations', + 'ApiIssuesOperations', + 'ApiIssueOperations', + 'ApiIssueCommentsOperations', + 'ApiIssuCommentOperations', + 'ApiIssueCommentOperations', + 'ApiIssueAttachmentsOperations', + 'ApiIssuAttachmentOperations', + 'ApiIssueAttachmentOperations', 'AuthorizationServerOperations', 'BackendOperations', 'CertificateOperations', diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issu_attachment_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issu_attachment_operations.py new file mode 100644 index 000000000000..c7d6d9cb79f7 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issu_attachment_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiIssuAttachmentOperations(object): + """ApiIssuAttachmentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def head( + self, resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the issue Attachment for an API + specified by its identifier. + + :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 attachment_id: Attachment identifier within an Issue. Must be + unique in the current Issue. + :type attachment_id: 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.head.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'^[^*#&+:<>?]+$'), + 'attachmentId': self._serialize.url("attachment_id", attachment_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 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.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + head.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issu_comment_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issu_comment_operations.py new file mode 100644 index 000000000000..1b7bf57e22db --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issu_comment_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiIssuCommentOperations(object): + """ApiIssuCommentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def head( + self, resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the issue Comment for an API + specified by its identifier. + + :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 comment_id: Comment identifier within an Issue. Must be unique + in the current Issue. + :type comment_id: 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.head.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'^[^*#&+:<>?]+$'), + 'commentId': self._serialize.url("comment_id", comment_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 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.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + head.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_attachment_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_attachment_operations.py new file mode 100644 index 000000000000..3810c3876c1c --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_attachment_operations.py @@ -0,0 +1,275 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiIssueAttachmentOperations(object): + """ApiIssueAttachmentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def get( + self, resource_group_name, service_name, api_id, issue_id, attachment_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the issue Attachment for an API specified by its + identifier. + + :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 attachment_id: Attachment identifier within an Issue. Must be + unique in the current Issue. + :type attachment_id: 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: IssueAttachmentContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IssueAttachmentContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.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'^[^*#&+:<>?]+$'), + 'attachmentId': self._serialize.url("attachment_id", attachment_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 self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('IssueAttachmentContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, issue_id, attachment_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates a new Attachment for the Issue in an API or updates an existing + one. + + :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 attachment_id: Attachment identifier within an Issue. Must be + unique in the current Issue. + :type attachment_id: str + :param parameters: Create parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.IssueAttachmentContract + :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: IssueAttachmentContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IssueAttachmentContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_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'^[^*#&+:<>?]+$'), + 'attachmentId': self._serialize.url("attachment_id", attachment_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, 'IssueAttachmentContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IssueAttachmentContract', response) + if response.status_code == 201: + deserialized = self._deserialize('IssueAttachmentContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} + + def delete( + self, resource_group_name, service_name, api_id, issue_id, attachment_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified comment from an Issue. + + :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 attachment_id: Attachment identifier within an Issue. Must be + unique in the current Issue. + :type attachment_id: str + :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.delete.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'^[^*#&+:<>?]+$'), + 'attachmentId': self._serialize.url("attachment_id", attachment_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) + 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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_attachments_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_attachments_operations.py new file mode 100644 index 000000000000..56895d0686c8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_attachments_operations.py @@ -0,0 +1,133 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiIssueAttachmentsOperations(object): + """ApiIssueAttachmentsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, api_id, issue_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all comments for the Issue assosiated with the specified 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 filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IssueAttachmentContract + :rtype: + ~azure.mgmt.apimanagement.models.IssueAttachmentContractPaged[~azure.mgmt.apimanagement.models.IssueAttachmentContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.IssueAttachmentContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.IssueAttachmentContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_comment_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_comment_operations.py new file mode 100644 index 000000000000..392a81638728 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_comment_operations.py @@ -0,0 +1,275 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiIssueCommentOperations(object): + """ApiIssueCommentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def get( + self, resource_group_name, service_name, api_id, issue_id, comment_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the issue Comment for an API specified by its + identifier. + + :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 comment_id: Comment identifier within an Issue. Must be unique + in the current Issue. + :type comment_id: 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: IssueCommentContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IssueCommentContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.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'^[^*#&+:<>?]+$'), + 'commentId': self._serialize.url("comment_id", comment_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 self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('IssueCommentContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, issue_id, comment_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates a new Comment for the Issue in an API or updates an existing + one. + + :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 comment_id: Comment identifier within an Issue. Must be unique + in the current Issue. + :type comment_id: str + :param parameters: Create parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.IssueCommentContract + :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: IssueCommentContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IssueCommentContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_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'^[^*#&+:<>?]+$'), + 'commentId': self._serialize.url("comment_id", comment_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, 'IssueCommentContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IssueCommentContract', response) + if response.status_code == 201: + deserialized = self._deserialize('IssueCommentContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} + + def delete( + self, resource_group_name, service_name, api_id, issue_id, comment_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes the specified comment from an Issue. + + :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 comment_id: Comment identifier within an Issue. Must be unique + in the current Issue. + :type comment_id: str + :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.delete.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'^[^*#&+:<>?]+$'), + 'commentId': self._serialize.url("comment_id", comment_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) + 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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_comments_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_comments_operations.py new file mode 100644 index 000000000000..090ff8c314d9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_comments_operations.py @@ -0,0 +1,133 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiIssueCommentsOperations(object): + """ApiIssueCommentsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, api_id, issue_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all comments for the Issue assosiated with the specified 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 filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IssueCommentContract + :rtype: + ~azure.mgmt.apimanagement.models.IssueCommentContractPaged[~azure.mgmt.apimanagement.models.IssueCommentContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.IssueCommentContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.IssueCommentContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments'} 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 new file mode 100644 index 000000000000..eae12283a1c9 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issue_operations.py @@ -0,0 +1,325 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiIssueOperations(object): + """ApiIssueOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def head( + self, resource_group_name, service_name, api_id, issue_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the Issue for an API specified + by its identifier. + + :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 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.head.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 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.head(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + head.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} + + def get( + self, resource_group_name, service_name, api_id, issue_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the Issue for an API specified by its identifier. + + :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 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: IssueContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IssueContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.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 self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('IssueContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} + + def create_or_update( + self, resource_group_name, service_name, api_id, issue_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates a new Issue for an API or updates an existing one. + + :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: Create parameters. + :type parameters: ~azure.mgmt.apimanagement.models.IssueContract + :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: IssueContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IssueContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_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, 'IssueContract') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IssueContract', response) + if response.status_code == 201: + deserialized = self._deserialize('IssueContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.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. + + :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 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.delete.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) + 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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issues_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issues_operations.py new file mode 100644 index 000000000000..84b7ca6837cb --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_issues_operations.py @@ -0,0 +1,131 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiIssuesOperations(object): + """ApiIssuesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, api_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists all issues assosiated with the specified 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 filter: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + | id | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + | state | eq | + | + | userId | ge, le, eq, ne, gt, lt | substringof, startswith, + endswith | + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IssueContract + :rtype: + ~azure.mgmt.apimanagement.models.IssueContractPaged[~azure.mgmt.apimanagement.models.IssueContract] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_service.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]$)'), + '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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.IssueContractPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.IssueContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues'} diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_policy_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_policy_operations.py index 3cb9b3ca0d50..bfbe2795c2a1 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_policy_operations.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_operation_policy_operations.py @@ -273,7 +273,7 @@ def create_or_update( entity, but required when updating an entity. :type if_match: str :param content_format: Format of the policyContent. Possible values - include: 'xml', 'xml-link' + include: 'xml', 'xml-link', 'rawxml', 'rawxml-link' :type content_format: str or ~azure.mgmt.apimanagement.models.PolicyContentFormat :param dict custom_headers: headers that will be added to the request diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_policy_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_policy_operations.py index 83fdff87d9e0..4018aa1288c3 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_policy_operations.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_policy_operations.py @@ -263,7 +263,7 @@ def create_or_update( entity, but required when updating an entity. :type if_match: str :param content_format: Format of the policyContent. Possible values - include: 'xml', 'xml-link' + include: 'xml', 'xml-link', 'rawxml', 'rawxml-link' :type content_format: str or ~azure.mgmt.apimanagement.models.PolicyContentFormat :param dict custom_headers: headers that will be added to the request diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_operations.py index 96af9bab57ca..f418849b26d0 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_operations.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/policy_operations.py @@ -245,7 +245,7 @@ def create_or_update( Policy. :type policy_content: str :param content_format: Format of the policyContent. Possible values - include: 'xml', 'xml-link' + include: 'xml', 'xml-link', 'rawxml', 'rawxml-link' :type content_format: str or ~azure.mgmt.apimanagement.models.PolicyContentFormat :param dict custom_headers: headers that will be added to the request diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_policy_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_policy_operations.py index 0b2471308071..667f1e30ee36 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_policy_operations.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/product_policy_operations.py @@ -258,7 +258,7 @@ def create_or_update( entity, but required when updating an entity. :type if_match: str :param content_format: Format of the policyContent. Possible values - include: 'xml', 'xml-link' + include: 'xml', 'xml-link', 'rawxml', 'rawxml-link' :type content_format: str or ~azure.mgmt.apimanagement.models.PolicyContentFormat :param dict custom_headers: headers that will be added to the request