diff --git a/azure-mgmt/customproviders/__init__.py b/azure-mgmt/customproviders/__init__.py new file mode 100644 index 000000000000..a7b757850145 --- /dev/null +++ b/azure-mgmt/customproviders/__init__.py @@ -0,0 +1,18 @@ +# 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 .customproviders_client import customprovidersClient +from .version import VERSION + +__all__ = ['customprovidersClient'] + +__version__ = VERSION + diff --git a/azure-mgmt/customproviders/customproviders_client.py b/azure-mgmt/customproviders/customproviders_client.py new file mode 100644 index 000000000000..b9b34365da91 --- /dev/null +++ b/azure-mgmt/customproviders/customproviders_client.py @@ -0,0 +1,88 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.operations import Operations +from .operations.custom_resource_provider_operations import CustomResourceProviderOperations +from . import models + + +class customprovidersClientConfiguration(AzureConfiguration): + """Configuration for customprovidersClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(customprovidersClientConfiguration, self).__init__(base_url) + + self.add_user_agent('customproviders/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class customprovidersClient(SDKClient): + """Allows extension of ARM control plane with custom resource providers. + + :ivar config: Configuration for client. + :vartype config: customprovidersClientConfiguration + + :ivar operations: Operations operations + :vartype operations: microsoft.customproviders.operations.Operations + :ivar custom_resource_provider: CustomResourceProvider operations + :vartype custom_resource_provider: microsoft.customproviders.operations.CustomResourceProviderOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = customprovidersClientConfiguration(credentials, subscription_id, base_url) + super(customprovidersClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-09-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.custom_resource_provider = CustomResourceProviderOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt/customproviders/models/__init__.py b/azure-mgmt/customproviders/models/__init__.py new file mode 100644 index 000000000000..4f8c2760e754 --- /dev/null +++ b/azure-mgmt/customproviders/models/__init__.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .custom_rp_action_route_definition_py3 import CustomRPActionRouteDefinition + from .custom_rp_resource_type_route_definition_py3 import CustomRPResourceTypeRouteDefinition + from .custom_rp_validations_py3 import CustomRPValidations + from .custom_rp_manifest_py3 import CustomRPManifest + from .custom_rp_route_definition_py3 import CustomRPRouteDefinition + from .resource_provider_operation_display_py3 import ResourceProviderOperationDisplay + from .resource_provider_operation_py3 import ResourceProviderOperation + from .resource_py3 import Resource + from .resource_providers_update_py3 import ResourceProvidersUpdate + from .error_definition_py3 import ErrorDefinition + from .error_response_py3 import ErrorResponse, ErrorResponseException +except (SyntaxError, ImportError): + from .custom_rp_action_route_definition import CustomRPActionRouteDefinition + from .custom_rp_resource_type_route_definition import CustomRPResourceTypeRouteDefinition + from .custom_rp_validations import CustomRPValidations + from .custom_rp_manifest import CustomRPManifest + from .custom_rp_route_definition import CustomRPRouteDefinition + from .resource_provider_operation_display import ResourceProviderOperationDisplay + from .resource_provider_operation import ResourceProviderOperation + from .resource import Resource + from .resource_providers_update import ResourceProvidersUpdate + from .error_definition import ErrorDefinition + from .error_response import ErrorResponse, ErrorResponseException +from .resource_provider_operation_paged import ResourceProviderOperationPaged +from .custom_rp_manifest_paged import CustomRPManifestPaged +from .customproviders_client_enums import ( + ActionRouting, + ResourceTypeRouting, + ValidationType, + ProvisioningState, +) + +__all__ = [ + 'CustomRPActionRouteDefinition', + 'CustomRPResourceTypeRouteDefinition', + 'CustomRPValidations', + 'CustomRPManifest', + 'CustomRPRouteDefinition', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperation', + 'Resource', + 'ResourceProvidersUpdate', + 'ErrorDefinition', + 'ErrorResponse', 'ErrorResponseException', + 'ResourceProviderOperationPaged', + 'CustomRPManifestPaged', + 'ActionRouting', + 'ResourceTypeRouting', + 'ValidationType', + 'ProvisioningState', +] diff --git a/azure-mgmt/customproviders/models/custom_rp_action_route_definition.py b/azure-mgmt/customproviders/models/custom_rp_action_route_definition.py new file mode 100644 index 000000000000..cd1f8c6707d6 --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_action_route_definition.py @@ -0,0 +1,48 @@ +# 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 .custom_rp_route_definition import CustomRPRouteDefinition + + +class CustomRPActionRouteDefinition(CustomRPRouteDefinition): + """The route definition for an action implemented by the custom resource + provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + :param routing_type: The routing types that are supported for action + requests. Possible values include: 'Proxy' + :type routing_type: str or ~microsoft.customproviders.models.ActionRouting + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'routing_type': {'key': 'routingType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPActionRouteDefinition, self).__init__(**kwargs) + self.routing_type = kwargs.get('routing_type', None) diff --git a/azure-mgmt/customproviders/models/custom_rp_action_route_definition_py3.py b/azure-mgmt/customproviders/models/custom_rp_action_route_definition_py3.py new file mode 100644 index 000000000000..ca414a0a90a6 --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_action_route_definition_py3.py @@ -0,0 +1,48 @@ +# 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 .custom_rp_route_definition_py3 import CustomRPRouteDefinition + + +class CustomRPActionRouteDefinition(CustomRPRouteDefinition): + """The route definition for an action implemented by the custom resource + provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + :param routing_type: The routing types that are supported for action + requests. Possible values include: 'Proxy' + :type routing_type: str or ~microsoft.customproviders.models.ActionRouting + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'routing_type': {'key': 'routingType', 'type': 'str'}, + } + + def __init__(self, *, name: str, endpoint: str, routing_type=None, **kwargs) -> None: + super(CustomRPActionRouteDefinition, self).__init__(name=name, endpoint=endpoint, **kwargs) + self.routing_type = routing_type diff --git a/azure-mgmt/customproviders/models/custom_rp_manifest.py b/azure-mgmt/customproviders/models/custom_rp_manifest.py new file mode 100644 index 000000000000..54033acec12b --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_manifest.py @@ -0,0 +1,77 @@ +# 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 CustomRPManifest(Resource): + """A manifest file that defines the custom resource provider resources. + + 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 + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param actions: A list of actions that the custom resource provider + implements. + :type actions: + list[~microsoft.customproviders.models.CustomRPActionRouteDefinition] + :param resource_types: A list of resource types that the custom resource + provider implements. + :type resource_types: + list[~microsoft.customproviders.models.CustomRPResourceTypeRouteDefinition] + :param validations: A list of validations to run on the custom resource + provider's requests. + :type validations: + list[~microsoft.customproviders.models.CustomRPValidations] + :ivar provisioning_state: The provisioning state of the resource provider. + Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', + 'Failed' + :vartype provisioning_state: str or + ~microsoft.customproviders.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'actions': {'key': 'properties.actions', 'type': '[CustomRPActionRouteDefinition]'}, + 'resource_types': {'key': 'properties.resourceTypes', 'type': '[CustomRPResourceTypeRouteDefinition]'}, + 'validations': {'key': 'properties.validations', 'type': '[CustomRPValidations]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPManifest, self).__init__(**kwargs) + self.actions = kwargs.get('actions', None) + self.resource_types = kwargs.get('resource_types', None) + self.validations = kwargs.get('validations', None) + self.provisioning_state = None diff --git a/azure-mgmt/customproviders/models/custom_rp_manifest_paged.py b/azure-mgmt/customproviders/models/custom_rp_manifest_paged.py new file mode 100644 index 000000000000..2ee4a009cc03 --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_manifest_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 CustomRPManifestPaged(Paged): + """ + A paging container for iterating over a list of :class:`CustomRPManifest ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CustomRPManifest]'} + } + + def __init__(self, *args, **kwargs): + + super(CustomRPManifestPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt/customproviders/models/custom_rp_manifest_py3.py b/azure-mgmt/customproviders/models/custom_rp_manifest_py3.py new file mode 100644 index 000000000000..94bb8fa16867 --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_manifest_py3.py @@ -0,0 +1,77 @@ +# 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 CustomRPManifest(Resource): + """A manifest file that defines the custom resource provider resources. + + 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 + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param actions: A list of actions that the custom resource provider + implements. + :type actions: + list[~microsoft.customproviders.models.CustomRPActionRouteDefinition] + :param resource_types: A list of resource types that the custom resource + provider implements. + :type resource_types: + list[~microsoft.customproviders.models.CustomRPResourceTypeRouteDefinition] + :param validations: A list of validations to run on the custom resource + provider's requests. + :type validations: + list[~microsoft.customproviders.models.CustomRPValidations] + :ivar provisioning_state: The provisioning state of the resource provider. + Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', + 'Failed' + :vartype provisioning_state: str or + ~microsoft.customproviders.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'actions': {'key': 'properties.actions', 'type': '[CustomRPActionRouteDefinition]'}, + 'resource_types': {'key': 'properties.resourceTypes', 'type': '[CustomRPResourceTypeRouteDefinition]'}, + 'validations': {'key': 'properties.validations', 'type': '[CustomRPValidations]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, actions=None, resource_types=None, validations=None, **kwargs) -> None: + super(CustomRPManifest, self).__init__(location=location, tags=tags, **kwargs) + self.actions = actions + self.resource_types = resource_types + self.validations = validations + self.provisioning_state = None diff --git a/azure-mgmt/customproviders/models/custom_rp_resource_type_route_definition.py b/azure-mgmt/customproviders/models/custom_rp_resource_type_route_definition.py new file mode 100644 index 000000000000..c8908da7dfae --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_resource_type_route_definition.py @@ -0,0 +1,49 @@ +# 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 .custom_rp_route_definition import CustomRPRouteDefinition + + +class CustomRPResourceTypeRouteDefinition(CustomRPRouteDefinition): + """The route definition for a resource implemented by the custom resource + provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + :param routing_type: The routing types that are supported for resource + requests. Possible values include: 'Proxy', 'Proxy,Cache' + :type routing_type: str or + ~microsoft.customproviders.models.ResourceTypeRouting + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'routing_type': {'key': 'routingType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPResourceTypeRouteDefinition, self).__init__(**kwargs) + self.routing_type = kwargs.get('routing_type', None) diff --git a/azure-mgmt/customproviders/models/custom_rp_resource_type_route_definition_py3.py b/azure-mgmt/customproviders/models/custom_rp_resource_type_route_definition_py3.py new file mode 100644 index 000000000000..b273271514db --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_resource_type_route_definition_py3.py @@ -0,0 +1,49 @@ +# 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 .custom_rp_route_definition_py3 import CustomRPRouteDefinition + + +class CustomRPResourceTypeRouteDefinition(CustomRPRouteDefinition): + """The route definition for a resource implemented by the custom resource + provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + :param routing_type: The routing types that are supported for resource + requests. Possible values include: 'Proxy', 'Proxy,Cache' + :type routing_type: str or + ~microsoft.customproviders.models.ResourceTypeRouting + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'routing_type': {'key': 'routingType', 'type': 'str'}, + } + + def __init__(self, *, name: str, endpoint: str, routing_type=None, **kwargs) -> None: + super(CustomRPResourceTypeRouteDefinition, self).__init__(name=name, endpoint=endpoint, **kwargs) + self.routing_type = routing_type diff --git a/azure-mgmt/customproviders/models/custom_rp_route_definition.py b/azure-mgmt/customproviders/models/custom_rp_route_definition.py new file mode 100644 index 000000000000..c3234fe086b0 --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_route_definition.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomRPRouteDefinition(Model): + """A route definition that defines an action or resource that can be + interacted with through the custom resource provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPRouteDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.endpoint = kwargs.get('endpoint', None) diff --git a/azure-mgmt/customproviders/models/custom_rp_route_definition_py3.py b/azure-mgmt/customproviders/models/custom_rp_route_definition_py3.py new file mode 100644 index 000000000000..5094f11151ec --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_route_definition_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomRPRouteDefinition(Model): + """A route definition that defines an action or resource that can be + interacted with through the custom resource provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__(self, *, name: str, endpoint: str, **kwargs) -> None: + super(CustomRPRouteDefinition, self).__init__(**kwargs) + self.name = name + self.endpoint = endpoint diff --git a/azure-mgmt/customproviders/models/custom_rp_validations.py b/azure-mgmt/customproviders/models/custom_rp_validations.py new file mode 100644 index 000000000000..49a9bfcef4af --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_validations.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomRPValidations(Model): + """A validation to apply on custom resource provider requests. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: The type of validation to run against a matching + request. Possible values include: 'Swagger' + :type validation_type: str or + ~microsoft.customproviders.models.ValidationType + :param specification: Required. A link to the validation specification. + The specification must be hosted on raw.githubusercontent.com. + :type specification: str + """ + + _validation = { + 'specification': {'required': True, 'pattern': r'^https://raw.githubusercontent.com/.+'}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'specification': {'key': 'specification', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPValidations, self).__init__(**kwargs) + self.validation_type = kwargs.get('validation_type', None) + self.specification = kwargs.get('specification', None) diff --git a/azure-mgmt/customproviders/models/custom_rp_validations_py3.py b/azure-mgmt/customproviders/models/custom_rp_validations_py3.py new file mode 100644 index 000000000000..5283a6be2137 --- /dev/null +++ b/azure-mgmt/customproviders/models/custom_rp_validations_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CustomRPValidations(Model): + """A validation to apply on custom resource provider requests. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: The type of validation to run against a matching + request. Possible values include: 'Swagger' + :type validation_type: str or + ~microsoft.customproviders.models.ValidationType + :param specification: Required. A link to the validation specification. + The specification must be hosted on raw.githubusercontent.com. + :type specification: str + """ + + _validation = { + 'specification': {'required': True, 'pattern': r'^https://raw.githubusercontent.com/.+'}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'specification': {'key': 'specification', 'type': 'str'}, + } + + def __init__(self, *, specification: str, validation_type=None, **kwargs) -> None: + super(CustomRPValidations, self).__init__(**kwargs) + self.validation_type = validation_type + self.specification = specification diff --git a/azure-mgmt/customproviders/models/customproviders_client_enums.py b/azure-mgmt/customproviders/models/customproviders_client_enums.py new file mode 100644 index 000000000000..66c28c30a9a9 --- /dev/null +++ b/azure-mgmt/customproviders/models/customproviders_client_enums.py @@ -0,0 +1,37 @@ +# 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 enum import Enum + + +class ActionRouting(str, Enum): + + proxy = "Proxy" + + +class ResourceTypeRouting(str, Enum): + + proxy = "Proxy" + proxy_cache = "Proxy,Cache" + + +class ValidationType(str, Enum): + + swagger = "Swagger" + + +class ProvisioningState(str, Enum): + + accepted = "Accepted" + deleting = "Deleting" + running = "Running" + succeeded = "Succeeded" + failed = "Failed" diff --git a/azure-mgmt/customproviders/models/error_definition.py b/azure-mgmt/customproviders/models/error_definition.py new file mode 100644 index 000000000000..598cf19598d5 --- /dev/null +++ b/azure-mgmt/customproviders/models/error_definition.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: list[~microsoft.customproviders.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None diff --git a/azure-mgmt/customproviders/models/error_definition_py3.py b/azure-mgmt/customproviders/models/error_definition_py3.py new file mode 100644 index 000000000000..c2d9680f478d --- /dev/null +++ b/azure-mgmt/customproviders/models/error_definition_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: list[~microsoft.customproviders.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None diff --git a/azure-mgmt/customproviders/models/error_response.py b/azure-mgmt/customproviders/models/error_response.py new file mode 100644 index 000000000000..55c3f682747f --- /dev/null +++ b/azure-mgmt/customproviders/models/error_response.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response. + + :param error: The error details. + :type error: ~microsoft.customproviders.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt/customproviders/models/error_response_py3.py b/azure-mgmt/customproviders/models/error_response_py3.py new file mode 100644 index 000000000000..4917c8d0ada4 --- /dev/null +++ b/azure-mgmt/customproviders/models/error_response_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response. + + :param error: The error details. + :type error: ~microsoft.customproviders.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt/customproviders/models/resource.py b/azure-mgmt/customproviders/models/resource.py new file mode 100644 index 000000000000..0af3ea498982 --- /dev/null +++ b/azure-mgmt/customproviders/models/resource.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The resource definition. + + 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 + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt/customproviders/models/resource_provider_operation.py b/azure-mgmt/customproviders/models/resource_provider_operation.py new file mode 100644 index 000000000000..bb6e33a6d83d --- /dev/null +++ b/azure-mgmt/customproviders/models/resource_provider_operation.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProviderOperation(Model): + """Supported operations of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~microsoft.customproviders.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt/customproviders/models/resource_provider_operation_display.py b/azure-mgmt/customproviders/models/resource_provider_operation_display.py new file mode 100644 index 000000000000..5ec9125156a1 --- /dev/null +++ b/azure-mgmt/customproviders/models/resource_provider_operation_display.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Custom Providers. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt/customproviders/models/resource_provider_operation_display_py3.py b/azure-mgmt/customproviders/models/resource_provider_operation_display_py3.py new file mode 100644 index 000000000000..1b4dd199c20d --- /dev/null +++ b/azure-mgmt/customproviders/models/resource_provider_operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Custom Providers. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt/customproviders/models/resource_provider_operation_paged.py b/azure-mgmt/customproviders/models/resource_provider_operation_paged.py new file mode 100644 index 000000000000..34c6c5fbb59d --- /dev/null +++ b/azure-mgmt/customproviders/models/resource_provider_operation_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 ResourceProviderOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceProviderOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceProviderOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceProviderOperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt/customproviders/models/resource_provider_operation_py3.py b/azure-mgmt/customproviders/models/resource_provider_operation_py3.py new file mode 100644 index 000000000000..7ec93d1e49fa --- /dev/null +++ b/azure-mgmt/customproviders/models/resource_provider_operation_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProviderOperation(Model): + """Supported operations of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~microsoft.customproviders.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt/customproviders/models/resource_providers_update.py b/azure-mgmt/customproviders/models/resource_providers_update.py new file mode 100644 index 000000000000..1653efb7d9df --- /dev/null +++ b/azure-mgmt/customproviders/models/resource_providers_update.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProvidersUpdate(Model): + """custom resource provider update information. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceProvidersUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt/customproviders/models/resource_providers_update_py3.py b/azure-mgmt/customproviders/models/resource_providers_update_py3.py new file mode 100644 index 000000000000..0fb5ebc76616 --- /dev/null +++ b/azure-mgmt/customproviders/models/resource_providers_update_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceProvidersUpdate(Model): + """custom resource provider update information. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ResourceProvidersUpdate, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt/customproviders/models/resource_py3.py b/azure-mgmt/customproviders/models/resource_py3.py new file mode 100644 index 000000000000..72c125363866 --- /dev/null +++ b/azure-mgmt/customproviders/models/resource_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The resource definition. + + 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 + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt/customproviders/operations/__init__.py b/azure-mgmt/customproviders/operations/__init__.py new file mode 100644 index 000000000000..c5ef594a407e --- /dev/null +++ b/azure-mgmt/customproviders/operations/__init__.py @@ -0,0 +1,18 @@ +# 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 .operations import Operations +from .custom_resource_provider_operations import CustomResourceProviderOperations + +__all__ = [ + 'Operations', + 'CustomResourceProviderOperations', +] diff --git a/azure-mgmt/customproviders/operations/custom_resource_provider_operations.py b/azure-mgmt/customproviders/operations/custom_resource_provider_operations.py new file mode 100644 index 000000000000..07563e6a96d2 --- /dev/null +++ b/azure-mgmt/customproviders/operations/custom_resource_provider_operations.py @@ -0,0 +1,480 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class CustomResourceProviderOperations(object): + """CustomResourceProviderOperations 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: The API version to be used with the HTTP request. Constant value: "2018-09-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-01-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, resource_provider_name, resource_provider, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(resource_provider, 'CustomRPManifest') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CustomRPManifest', response) + if response.status_code == 201: + deserialized = self._deserialize('CustomRPManifest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_provider_name, resource_provider, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates the custom resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_name: The name of the resource provider. + :type resource_provider_name: str + :param resource_provider: The parameters required to create or update + a custom resource provider definition. + :type resource_provider: + ~microsoft.customproviders.models.CustomRPManifest + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns CustomRPManifest or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~microsoft.customproviders.models.CustomRPManifest] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~microsoft.customproviders.models.CustomRPManifest]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_provider_name=resource_provider_name, + resource_provider=resource_provider, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CustomRPManifest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} + + + def _delete_initial( + self, resource_group_name, resource_provider_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3) + } + 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 = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_provider_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the custom resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_name: The name of the resource provider. + :type resource_provider_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_provider_name=resource_provider_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} + + def get( + self, resource_group_name, resource_provider_name, custom_headers=None, raw=False, **operation_config): + """Gets the custom resource provider manifest. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_name: The name of the resource provider. + :type resource_provider_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CustomRPManifest or ClientRawResponse if raw=true + :rtype: ~microsoft.customproviders.models.CustomRPManifest or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CustomRPManifest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} + + def update( + self, resource_group_name, resource_provider_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates an existing custom resource provider. The only value that can + be updated via PATCH currently is the tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_name: The name of the resource provider. + :type resource_provider_name: str + :param tags: Resource tags + :type tags: dict[str, 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: CustomRPManifest or ClientRawResponse if raw=true + :rtype: ~microsoft.customproviders.models.CustomRPManifest or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + patchable_resource = models.ResourceProvidersUpdate(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(patchable_resource, 'ResourceProvidersUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CustomRPManifest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all the custom resource providers within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of CustomRPManifest + :rtype: + ~microsoft.customproviders.models.CustomRPManifestPaged[~microsoft.customproviders.models.CustomRPManifest] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CustomRPManifestPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CustomRPManifestPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the custom resource providers within a subscription. + + :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 CustomRPManifest + :rtype: + ~microsoft.customproviders.models.CustomRPManifestPaged[~microsoft.customproviders.models.CustomRPManifest] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CustomRPManifestPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CustomRPManifestPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CustomProviders/resourceProviders'} diff --git a/azure-mgmt/customproviders/operations/operations.py b/azure-mgmt/customproviders/operations/operations.py new file mode 100644 index 000000000000..6893c4d2f855 --- /dev/null +++ b/azure-mgmt/customproviders/operations/operations.py @@ -0,0 +1,96 @@ +# 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 Operations(object): + """Operations 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: The API version to be used with the HTTP request. Constant value: "2018-09-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """The list of operations provided by Microsoft CustomProviders. + + :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 ResourceProviderOperation + :rtype: + ~microsoft.customproviders.models.ResourceProviderOperationPaged[~microsoft.customproviders.models.ResourceProviderOperation] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CustomProviders/operations'} diff --git a/azure-mgmt/customproviders/version.py b/azure-mgmt/customproviders/version.py new file mode 100644 index 000000000000..b8bbafae36fe --- /dev/null +++ b/azure-mgmt/customproviders/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2018-09-01-preview" +