diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py index 2b41304e2340..5638845c3e6e 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py @@ -45,6 +45,7 @@ from .sampling_settings_py3 import SamplingSettings from .diagnostic_contract_py3 import DiagnosticContract from .schema_contract_py3 import SchemaContract + from .schema_create_or_update_contract_py3 import SchemaCreateOrUpdateContract from .policy_contract_py3 import PolicyContract from .policy_collection_py3 import PolicyCollection from .product_contract_py3 import ProductContract @@ -200,6 +201,7 @@ from .sampling_settings import SamplingSettings from .diagnostic_contract import DiagnosticContract from .schema_contract import SchemaContract + from .schema_create_or_update_contract import SchemaCreateOrUpdateContract from .policy_contract import PolicyContract from .policy_collection import PolicyCollection from .product_contract import ProductContract @@ -428,6 +430,7 @@ 'SamplingSettings', 'DiagnosticContract', 'SchemaContract', + 'SchemaCreateOrUpdateContract', 'PolicyContract', 'PolicyCollection', 'ProductContract', diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract.py index 731db63de91c..03ea8798496d 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract.py @@ -28,11 +28,14 @@ class SchemaContract(Resource): :vartype type: str :param content_type: Required. Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema - document (e.g. application/json, application/xml). + document (e.g. application/json, application/xml).
- `Swagger` + Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
+ - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- + `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- + `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. :type content_type: str - :param value: Json escaped string defining the document representing the - Schema. - :type value: str + :param document: Properties of the Schema Document. + :type document: object """ _validation = { @@ -47,10 +50,10 @@ class SchemaContract(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'content_type': {'key': 'properties.contentType', 'type': 'str'}, - 'value': {'key': 'properties.document.value', 'type': 'str'}, + 'document': {'key': 'properties.document', 'type': 'object'}, } def __init__(self, **kwargs): super(SchemaContract, self).__init__(**kwargs) self.content_type = kwargs.get('content_type', None) - self.value = kwargs.get('value', None) + self.document = kwargs.get('document', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_py3.py index 552e09ef7db0..bde8934130e2 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_py3.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_contract_py3.py @@ -28,11 +28,14 @@ class SchemaContract(Resource): :vartype type: str :param content_type: Required. Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema - document (e.g. application/json, application/xml). + document (e.g. application/json, application/xml).
- `Swagger` + Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
+ - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- + `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- + `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. :type content_type: str - :param value: Json escaped string defining the document representing the - Schema. - :type value: str + :param document: Properties of the Schema Document. + :type document: object """ _validation = { @@ -47,10 +50,10 @@ class SchemaContract(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'content_type': {'key': 'properties.contentType', 'type': 'str'}, - 'value': {'key': 'properties.document.value', 'type': 'str'}, + 'document': {'key': 'properties.document', 'type': 'object'}, } - def __init__(self, *, content_type: str, value: str=None, **kwargs) -> None: + def __init__(self, *, content_type: str, document=None, **kwargs) -> None: super(SchemaContract, self).__init__(**kwargs) self.content_type = content_type - self.value = value + self.document = document diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_create_or_update_contract.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_create_or_update_contract.py new file mode 100644 index 000000000000..c22e78058a1e --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_create_or_update_contract.py @@ -0,0 +1,60 @@ +# 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 SchemaCreateOrUpdateContract(Resource): + """Schema 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 content_type: Required. Must be a valid a media type used in a + Content-Type header as defined in the RFC 2616. Media type of the schema + document (e.g. application/json, application/xml).
- `Swagger` + Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
+ - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- + `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- + `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. + :type content_type: str + :param value: Json escaped string defining the document representing the + Schema. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'content_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'value': {'key': 'properties.document.value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SchemaCreateOrUpdateContract, self).__init__(**kwargs) + self.content_type = kwargs.get('content_type', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_create_or_update_contract_py3.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_create_or_update_contract_py3.py new file mode 100644 index 000000000000..75aa161af9b8 --- /dev/null +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/schema_create_or_update_contract_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class SchemaCreateOrUpdateContract(Resource): + """Schema 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 content_type: Required. Must be a valid a media type used in a + Content-Type header as defined in the RFC 2616. Media type of the schema + document (e.g. application/json, application/xml).
- `Swagger` + Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
+ - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- + `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- + `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. + :type content_type: str + :param value: Json escaped string defining the document representing the + Schema. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'content_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'value': {'key': 'properties.document.value', 'type': 'str'}, + } + + def __init__(self, *, content_type: str, value: str=None, **kwargs) -> None: + super(SchemaCreateOrUpdateContract, self).__init__(**kwargs) + self.content_type = content_type + self.value = value diff --git a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_schema_operations.py b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_schema_operations.py index 2dd1c43f6238..6d9dc76a4f8c 100644 --- a/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_schema_operations.py +++ b/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/api_schema_operations.py @@ -283,7 +283,13 @@ def create_or_update( :type schema_id: str :param content_type: Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the - schema document (e.g. application/json, application/xml). + schema document (e.g. application/json, application/xml).
- + `Swagger` Schema use + `application/vnd.ms-azure-apim.swagger.definitions+json`
- + `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- + `OpenApi` Schema use `application/vnd.oai.openapi.components+json` +
- `WADL Schema` use + `application/vnd.ms-azure-apim.wadl.grammars+xml`. :type content_type: str :param if_match: ETag of the Entity. Not required when creating an entity, but required when updating an entity. @@ -302,7 +308,7 @@ def create_or_update( :raises: :class:`ErrorResponseException` """ - parameters = models.SchemaContract(content_type=content_type, value=value) + parameters = models.SchemaCreateOrUpdateContract(content_type=content_type, value=value) # Construct URL url = self.create_or_update.metadata['url'] @@ -333,7 +339,7 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'SchemaContract') + body_content = self._serialize.body(parameters, 'SchemaCreateOrUpdateContract') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content)