diff --git a/src/customproviders/HISTORY.rst b/src/customproviders/HISTORY.rst
new file mode 100644
index 00000000000..1c139576ba0
--- /dev/null
+++ b/src/customproviders/HISTORY.rst
@@ -0,0 +1,8 @@
+.. :changelog:
+
+Release History
+===============
+
+0.1.0
+++++++
+* Initial release.
diff --git a/src/customproviders/README.md b/src/customproviders/README.md
new file mode 100644
index 00000000000..741dd9dd566
--- /dev/null
+++ b/src/customproviders/README.md
@@ -0,0 +1,55 @@
+# Azure CLI customproviders Extension #
+This is the extension for customproviders
+
+### How to use ###
+Install this extension using the below CLI command
+```
+az extension add --name customproviders
+```
+
+### Included Features ###
+#### customproviders custom-resource-provider ####
+##### Create #####
+```
+az customproviders custom-resource-provider create --resource-group "testRG" --location "eastus" \
+ --actions name="TestAction" endpoint="https://mytestendpoint/" routing-type="Proxy" \
+ --resource-types name="TestResource" endpoint="https://mytestendpoint2/" routing-type="Proxy,Cache" \
+ --resource-provider-name "newrp"
+```
+##### Show #####
+```
+az customproviders custom-resource-provider show --resource-group "testRG" --resource-provider-name "newrp"
+```
+##### List #####
+```
+az customproviders custom-resource-provider list --resource-group "testRG"
+```
+##### Update #####
+```
+az customproviders custom-resource-provider update --resource-group "testRG" --resource-provider-name "newrp"
+```
+##### Delete #####
+```
+az customproviders custom-resource-provider delete --resource-group "testRG" --resource-provider-name "newrp"
+```
+#### customproviders association ####
+##### Create #####
+```
+az customproviders association create \
+ --target-resource-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" \
+ --name "associationName" --scope "scope"
+
+az customproviders association wait --created --name "{myAssociation}"
+```
+##### Show #####
+```
+az customproviders association show --name "associationName" --scope "scope"
+```
+##### List-all #####
+```
+az customproviders association list-all --scope "scope"
+```
+##### Delete #####
+```
+az customproviders association delete --name "associationName" --scope "scope"
+```
\ No newline at end of file
diff --git a/src/customproviders/azext_customproviders/__init__.py b/src/customproviders/azext_customproviders/__init__.py
new file mode 100644
index 00000000000..33706493313
--- /dev/null
+++ b/src/customproviders/azext_customproviders/__init__.py
@@ -0,0 +1,50 @@
+# --------------------------------------------------------------------------
+# 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 azure.cli.core import AzCommandsLoader
+from azext_customproviders.generated._help import helps # pylint: disable=unused-import
+try:
+ from azext_customproviders.manual._help import helps # pylint: disable=reimported
+except ImportError:
+ pass
+
+
+class CustomprovidersCommandsLoader(AzCommandsLoader):
+
+ def __init__(self, cli_ctx=None):
+ from azure.cli.core.commands import CliCommandType
+ from azext_customproviders.generated._client_factory import cf_customproviders_cl
+ customproviders_custom = CliCommandType(
+ operations_tmpl='azext_customproviders.custom#{}',
+ client_factory=cf_customproviders_cl)
+ parent = super(CustomprovidersCommandsLoader, self)
+ parent.__init__(cli_ctx=cli_ctx, custom_command_type=customproviders_custom)
+
+ def load_command_table(self, args):
+ from azext_customproviders.generated.commands import load_command_table
+ load_command_table(self, args)
+ try:
+ from azext_customproviders.manual.commands import load_command_table as load_command_table_manual
+ load_command_table_manual(self, args)
+ except ImportError:
+ pass
+ return self.command_table
+
+ def load_arguments(self, command):
+ from azext_customproviders.generated._params import load_arguments
+ load_arguments(self, command)
+ try:
+ from azext_customproviders.manual._params import load_arguments as load_arguments_manual
+ load_arguments_manual(self, command)
+ except ImportError:
+ pass
+
+
+COMMAND_LOADER_CLS = CustomprovidersCommandsLoader
diff --git a/src/customproviders/azext_customproviders/action.py b/src/customproviders/azext_customproviders/action.py
new file mode 100644
index 00000000000..d95d53bf711
--- /dev/null
+++ b/src/customproviders/azext_customproviders/action.py
@@ -0,0 +1,17 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=wildcard-import
+# pylint: disable=unused-wildcard-import
+
+from .generated.action import * # noqa: F403
+try:
+ from .manual.action import * # noqa: F403
+except ImportError:
+ pass
diff --git a/src/customproviders/azext_customproviders/azext_metadata.json b/src/customproviders/azext_customproviders/azext_metadata.json
new file mode 100644
index 00000000000..4f48fa652a5
--- /dev/null
+++ b/src/customproviders/azext_customproviders/azext_metadata.json
@@ -0,0 +1,4 @@
+{
+ "azext.isExperimental": true,
+ "azext.minCliCoreVersion": "2.11.0"
+}
\ No newline at end of file
diff --git a/src/customproviders/azext_customproviders/custom.py b/src/customproviders/azext_customproviders/custom.py
new file mode 100644
index 00000000000..dbe9d5f9742
--- /dev/null
+++ b/src/customproviders/azext_customproviders/custom.py
@@ -0,0 +1,17 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=wildcard-import
+# pylint: disable=unused-wildcard-import
+
+from .generated.custom import * # noqa: F403
+try:
+ from .manual.custom import * # noqa: F403
+except ImportError:
+ pass
diff --git a/src/customproviders/azext_customproviders/generated/__init__.py b/src/customproviders/azext_customproviders/generated/__init__.py
new file mode 100644
index 00000000000..c9cfdc73e77
--- /dev/null
+++ b/src/customproviders/azext_customproviders/generated/__init__.py
@@ -0,0 +1,12 @@
+# 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.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/customproviders/azext_customproviders/generated/_client_factory.py b/src/customproviders/azext_customproviders/generated/_client_factory.py
new file mode 100644
index 00000000000..0ce5ed6f271
--- /dev/null
+++ b/src/customproviders/azext_customproviders/generated/_client_factory.py
@@ -0,0 +1,24 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+
+
+def cf_customproviders_cl(cli_ctx, *_):
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
+ from ..vendored_sdks.customproviders import Customproviders
+ return get_mgmt_service_client(cli_ctx,
+ Customproviders)
+
+
+def cf_custom_resource_provider(cli_ctx, *_):
+ return cf_customproviders_cl(cli_ctx).custom_resource_provider
+
+
+def cf_association(cli_ctx, *_):
+ return cf_customproviders_cl(cli_ctx).association
diff --git a/src/customproviders/azext_customproviders/generated/_help.py b/src/customproviders/azext_customproviders/generated/_help.py
new file mode 100644
index 00000000000..69acdd43b4e
--- /dev/null
+++ b/src/customproviders/azext_customproviders/generated/_help.py
@@ -0,0 +1,192 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-lines
+
+from knack.help_files import helps
+
+
+helps['customproviders custom-resource-provider'] = """
+ type: group
+ short-summary: customproviders custom-resource-provider
+"""
+
+helps['customproviders custom-resource-provider list'] = """
+ type: command
+ short-summary: "Gets all the custom resource providers within a resource group. And Gets all the custom resource \
+providers within a subscription."
+ examples:
+ - name: List all custom resource providers on the resourceGroup
+ text: |-
+ az customproviders custom-resource-provider list --resource-group "testRG"
+ - name: List all custom resource providers on the subscription
+ text: |-
+ az customproviders custom-resource-provider list
+"""
+
+helps['customproviders custom-resource-provider show'] = """
+ type: command
+ short-summary: "Gets the custom resource provider manifest."
+ examples:
+ - name: Get a custom resource provider
+ text: |-
+ az customproviders custom-resource-provider show --resource-group "testRG" --resource-provider-name \
+"newrp"
+"""
+
+helps['customproviders custom-resource-provider create'] = """
+ type: command
+ short-summary: "Create the custom resource provider."
+ parameters:
+ - name: --actions
+ short-summary: "A list of actions that the custom resource provider implements."
+ long-summary: |
+ Usage: --actions routing-type=XX name=XX endpoint=XX
+
+ routing-type: The routing types that are supported for action requests.
+ 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/resourceProvide\
+rs/{resourceProviderName}/{name}')
+ 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}')
+
+ Multiple actions can be specified by using more than one --actions argument.
+ - name: --resource-types
+ short-summary: "A list of resource types that the custom resource provider implements."
+ long-summary: |
+ Usage: --resource-types routing-type=XX name=XX endpoint=XX
+
+ routing-type: The routing types that are supported for resource requests.
+ 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/resourceProvide\
+rs/{resourceProviderName}/{name}')
+ 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}')
+
+ Multiple actions can be specified by using more than one --resource-types argument.
+ - name: --validations
+ short-summary: "A list of validations to run on the custom resource provider's requests."
+ long-summary: |
+ Usage: --validations validation-type=XX specification=XX
+
+ validation-type: The type of validation to run against a matching request.
+ specification: Required. A link to the validation specification. The specification must be hosted on \
+raw.githubusercontent.com.
+
+ Multiple actions can be specified by using more than one --validations argument.
+ examples:
+ - name: Create or update the custom resource provider
+ text: |-
+ az customproviders custom-resource-provider create --resource-group "testRG" --location "eastus" \
+--actions name="TestAction" endpoint="https://mytestendpoint/" routing-type="Proxy" --resource-types \
+name="TestResource" endpoint="https://mytestendpoint2/" routing-type="Proxy,Cache" --resource-provider-name "newrp"
+"""
+
+helps['customproviders custom-resource-provider update'] = """
+ type: command
+ short-summary: "Updates an existing custom resource provider. The only value that can be updated via PATCH \
+currently is the tags."
+ examples:
+ - name: Update a custom resource provider
+ text: |-
+ az customproviders custom-resource-provider update --resource-group "testRG" --resource-provider-name \
+"newrp"
+"""
+
+helps['customproviders custom-resource-provider delete'] = """
+ type: command
+ short-summary: "Deletes the custom resource provider."
+ examples:
+ - name: Delete a custom resource provider
+ text: |-
+ az customproviders custom-resource-provider delete --resource-group "testRG" --resource-provider-name \
+"newrp"
+"""
+
+helps['customproviders custom-resource-provider wait'] = """
+ type: command
+ short-summary: Place the CLI in a waiting state until a condition of the customproviders custom-resource-provider \
+is met.
+ examples:
+ - name: Pause executing next line of CLI script until the customproviders custom-resource-provider is \
+successfully created.
+ text: |-
+ az customproviders custom-resource-provider wait --resource-group "testRG" --resource-provider-name \
+"newrp" --created
+ - name: Pause executing next line of CLI script until the customproviders custom-resource-provider is \
+successfully deleted.
+ text: |-
+ az customproviders custom-resource-provider wait --resource-group "testRG" --resource-provider-name \
+"newrp" --deleted
+"""
+
+helps['customproviders association'] = """
+ type: group
+ short-summary: customproviders association
+"""
+
+helps['customproviders association show'] = """
+ type: command
+ short-summary: "Get an association."
+ examples:
+ - name: Get an association
+ text: |-
+ az customproviders association show --name "associationName" --scope "scope"
+"""
+
+helps['customproviders association create'] = """
+ type: command
+ short-summary: "Create an association."
+ examples:
+ - name: Create or update an association
+ text: |-
+ az customproviders association create --target-resource-id "/subscriptions/00000000-0000-0000-0000-00000\
+0000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" --name "associationName" \
+--scope "scope"
+"""
+
+helps['customproviders association update'] = """
+ type: command
+ short-summary: "Update an association."
+"""
+
+helps['customproviders association delete'] = """
+ type: command
+ short-summary: "Delete an association."
+ examples:
+ - name: Delete an association
+ text: |-
+ az customproviders association delete --name "associationName" --scope "scope"
+"""
+
+helps['customproviders association list-all'] = """
+ type: command
+ short-summary: "Gets all association for the given scope."
+ examples:
+ - name: Get all associations
+ text: |-
+ az customproviders association list-all --scope "scope"
+"""
+
+helps['customproviders association wait'] = """
+ type: command
+ short-summary: Place the CLI in a waiting state until a condition of the customproviders association is met.
+ examples:
+ - name: Pause executing next line of CLI script until the customproviders association is successfully created.
+ text: |-
+ az customproviders association wait --name "associationName" --scope "scope" --created
+ - name: Pause executing next line of CLI script until the customproviders association is successfully updated.
+ text: |-
+ az customproviders association wait --name "associationName" --scope "scope" --updated
+ - name: Pause executing next line of CLI script until the customproviders association is successfully deleted.
+ text: |-
+ az customproviders association wait --name "associationName" --scope "scope" --deleted
+"""
diff --git a/src/customproviders/azext_customproviders/generated/_params.py b/src/customproviders/azext_customproviders/generated/_params.py
new file mode 100644
index 00000000000..b010066fecf
--- /dev/null
+++ b/src/customproviders/azext_customproviders/generated/_params.py
@@ -0,0 +1,95 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-lines
+# pylint: disable=too-many-statements
+
+from azure.cli.core.commands.parameters import (
+ tags_type,
+ resource_group_name_type,
+ get_location_type
+)
+from azure.cli.core.commands.validators import get_default_location_from_resource_group
+from azext_customproviders.action import (
+ AddActions,
+ AddResourceTypes,
+ AddValidations
+)
+
+
+def load_arguments(self, _):
+
+ with self.argument_context('customproviders custom-resource-provider list') as c:
+ c.argument('resource_group_name', resource_group_name_type)
+
+ with self.argument_context('customproviders custom-resource-provider show') as c:
+ c.argument('resource_group_name', resource_group_name_type)
+ c.argument('resource_provider_name', type=str, help='The name of the resource provider.', id_part='name')
+
+ with self.argument_context('customproviders custom-resource-provider create') as c:
+ c.argument('resource_group_name', resource_group_name_type)
+ c.argument('resource_provider_name', type=str, help='The name of the resource provider.')
+ c.argument('location', arg_type=get_location_type(self.cli_ctx),
+ validator=get_default_location_from_resource_group)
+ c.argument('tags', tags_type)
+ c.argument('actions', action=AddActions, nargs='*', help='A list of actions that the custom resource provider '
+ 'implements.')
+ c.argument('resource_types', action=AddResourceTypes, nargs='*', help='A list of resource types that the '
+ 'custom resource provider implements.')
+ c.argument('validations', action=AddValidations, nargs='*', help='A list of validations to run on the custom '
+ 'resource provider\'s requests.')
+
+ with self.argument_context('customproviders custom-resource-provider update') as c:
+ c.argument('resource_group_name', resource_group_name_type)
+ c.argument('resource_provider_name', type=str, help='The name of the resource provider.', id_part='name')
+ c.argument('tags', tags_type)
+
+ with self.argument_context('customproviders custom-resource-provider delete') as c:
+ c.argument('resource_group_name', resource_group_name_type)
+ c.argument('resource_provider_name', type=str, help='The name of the resource provider.', id_part='name')
+
+ with self.argument_context('customproviders custom-resource-provider wait') as c:
+ c.argument('resource_group_name', resource_group_name_type)
+ c.argument('resource_provider_name', type=str, help='The name of the resource provider.', id_part='name')
+
+ with self.argument_context('customproviders association show') as c:
+ c.argument('scope', type=str, help='The scope of the association.')
+ c.argument('association_name', options_list=['--name', '-n', '--association-name'], type=str, help='The name '
+ 'of the association.')
+
+ with self.argument_context('customproviders association create') as c:
+ c.argument('scope', type=str, help='The scope of the association. The scope can be any valid REST resource '
+ 'instance. For example, use \'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/'
+ 'providers/Microsoft.Compute/virtualMachines/{vm-name}\' for a virtual machine resource.')
+ c.argument('association_name', options_list=['--name', '-n', '--association-name'], type=str, help='The name '
+ 'of the association.')
+ c.argument('target_resource_id', type=str, help='The REST resource instance of the target resource for this '
+ 'association.')
+
+ with self.argument_context('customproviders association update') as c:
+ c.argument('scope', type=str, help='The scope of the association. The scope can be any valid REST resource '
+ 'instance. For example, use \'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/'
+ 'providers/Microsoft.Compute/virtualMachines/{vm-name}\' for a virtual machine resource.')
+ c.argument('association_name', options_list=['--name', '-n', '--association-name'], type=str, help='The name '
+ 'of the association.')
+ c.argument('target_resource_id', type=str, help='The REST resource instance of the target resource for this '
+ 'association.')
+
+ with self.argument_context('customproviders association delete') as c:
+ c.argument('scope', type=str, help='The scope of the association.')
+ c.argument('association_name', options_list=['--name', '-n', '--association-name'], type=str, help='The name '
+ 'of the association.')
+
+ with self.argument_context('customproviders association list-all') as c:
+ c.argument('scope', type=str, help='The scope of the association.')
+
+ with self.argument_context('customproviders association wait') as c:
+ c.argument('scope', type=str, help='The scope of the association.')
+ c.argument('association_name', options_list=['--name', '-n', '--association-name'], type=str, help='The name '
+ 'of the association.')
diff --git a/src/customproviders/azext_customproviders/generated/_validators.py b/src/customproviders/azext_customproviders/generated/_validators.py
new file mode 100644
index 00000000000..b33a44c1ebf
--- /dev/null
+++ b/src/customproviders/azext_customproviders/generated/_validators.py
@@ -0,0 +1,9 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
diff --git a/src/customproviders/azext_customproviders/generated/action.py b/src/customproviders/azext_customproviders/generated/action.py
new file mode 100644
index 00000000000..12a6a636c78
--- /dev/null
+++ b/src/customproviders/azext_customproviders/generated/action.py
@@ -0,0 +1,90 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=protected-access
+
+import argparse
+from collections import defaultdict
+from knack.util import CLIError
+
+
+class AddActions(argparse._AppendAction):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ super(AddActions, self).__call__(parser, namespace, action, option_string)
+
+ def get_action(self, values, option_string): # pylint: disable=no-self-use
+ try:
+ properties = defaultdict(list)
+ for (k, v) in (x.split('=', 1) for x in values):
+ properties[k].append(v)
+ properties = dict(properties)
+ except ValueError:
+ raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
+ d = {}
+ for k in properties:
+ kl = k.lower()
+ v = properties[k]
+ if kl == 'routing-type':
+ d['routing_type'] = v[0]
+ elif kl == 'name':
+ d['name'] = v[0]
+ elif kl == 'endpoint':
+ d['endpoint'] = v[0]
+ return d
+
+
+class AddResourceTypes(argparse._AppendAction):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ super(AddResourceTypes, self).__call__(parser, namespace, action, option_string)
+
+ def get_action(self, values, option_string): # pylint: disable=no-self-use
+ try:
+ properties = defaultdict(list)
+ for (k, v) in (x.split('=', 1) for x in values):
+ properties[k].append(v)
+ properties = dict(properties)
+ except ValueError:
+ raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
+ d = {}
+ for k in properties:
+ kl = k.lower()
+ v = properties[k]
+ if kl == 'routing-type':
+ d['routing_type'] = v[0]
+ elif kl == 'name':
+ d['name'] = v[0]
+ elif kl == 'endpoint':
+ d['endpoint'] = v[0]
+ return d
+
+
+class AddValidations(argparse._AppendAction):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ super(AddValidations, self).__call__(parser, namespace, action, option_string)
+
+ def get_action(self, values, option_string): # pylint: disable=no-self-use
+ try:
+ properties = defaultdict(list)
+ for (k, v) in (x.split('=', 1) for x in values):
+ properties[k].append(v)
+ properties = dict(properties)
+ except ValueError:
+ raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
+ d = {}
+ for k in properties:
+ kl = k.lower()
+ v = properties[k]
+ if kl == 'validation-type':
+ d['validation_type'] = v[0]
+ elif kl == 'specification':
+ d['specification'] = v[0]
+ return d
diff --git a/src/customproviders/azext_customproviders/generated/commands.py b/src/customproviders/azext_customproviders/generated/commands.py
new file mode 100644
index 00000000000..75efd33bf5d
--- /dev/null
+++ b/src/customproviders/azext_customproviders/generated/commands.py
@@ -0,0 +1,45 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-statements
+# pylint: disable=too-many-locals
+
+from azure.cli.core.commands import CliCommandType
+
+
+def load_command_table(self, _):
+
+ from azext_customproviders.generated._client_factory import cf_custom_resource_provider
+ customproviders_custom_resource_provider = CliCommandType(
+ operations_tmpl='azext_customproviders.vendored_sdks.customproviders.operations._custom_resource_provider_opera'
+ 'tions#CustomResourceProviderOperations.{}',
+ client_factory=cf_custom_resource_provider)
+ with self.command_group('customproviders custom-resource-provider', customproviders_custom_resource_provider,
+ client_factory=cf_custom_resource_provider, is_experimental=True) as g:
+ g.custom_command('list', 'customproviders_custom_resource_provider_list')
+ g.custom_show_command('show', 'customproviders_custom_resource_provider_show')
+ g.custom_command('create', 'customproviders_custom_resource_provider_create', supports_no_wait=True)
+ g.custom_command('update', 'customproviders_custom_resource_provider_update')
+ g.custom_command('delete', 'customproviders_custom_resource_provider_delete', supports_no_wait=True,
+ confirmation=True)
+ g.custom_wait_command('wait', 'customproviders_custom_resource_provider_show')
+
+ from azext_customproviders.generated._client_factory import cf_association
+ customproviders_association = CliCommandType(
+ operations_tmpl='azext_customproviders.vendored_sdks.customproviders.operations._association_operations#Associa'
+ 'tionOperations.{}',
+ client_factory=cf_association)
+ with self.command_group('customproviders association', customproviders_association, client_factory=cf_association,
+ is_experimental=True) as g:
+ g.custom_show_command('show', 'customproviders_association_show')
+ g.custom_command('create', 'customproviders_association_create', supports_no_wait=True)
+ g.custom_command('update', 'customproviders_association_update', supports_no_wait=True)
+ g.custom_command('delete', 'customproviders_association_delete', supports_no_wait=True, confirmation=True)
+ g.custom_command('list-all', 'customproviders_association_list_all')
+ g.custom_wait_command('wait', 'customproviders_association_show')
diff --git a/src/customproviders/azext_customproviders/generated/custom.py b/src/customproviders/azext_customproviders/generated/custom.py
new file mode 100644
index 00000000000..03256e6d910
--- /dev/null
+++ b/src/customproviders/azext_customproviders/generated/custom.py
@@ -0,0 +1,111 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-lines
+
+from azure.cli.core.util import sdk_no_wait
+
+
+def customproviders_custom_resource_provider_list(client,
+ resource_group_name=None):
+ if resource_group_name:
+ return client.list_by_resource_group(resource_group_name=resource_group_name)
+ return client.list_by_subscription()
+
+
+def customproviders_custom_resource_provider_show(client,
+ resource_group_name,
+ resource_provider_name):
+ return client.get(resource_group_name=resource_group_name,
+ resource_provider_name=resource_provider_name)
+
+
+def customproviders_custom_resource_provider_create(client,
+ resource_group_name,
+ resource_provider_name,
+ location,
+ tags=None,
+ actions=None,
+ resource_types=None,
+ validations=None,
+ no_wait=False):
+ return sdk_no_wait(no_wait,
+ client.begin_create_or_update,
+ resource_group_name=resource_group_name,
+ resource_provider_name=resource_provider_name,
+ location=location,
+ tags=tags,
+ actions=actions,
+ resource_types=resource_types,
+ validations=validations)
+
+
+def customproviders_custom_resource_provider_update(client,
+ resource_group_name,
+ resource_provider_name,
+ tags=None):
+ return client.update(resource_group_name=resource_group_name,
+ resource_provider_name=resource_provider_name,
+ tags=tags)
+
+
+def customproviders_custom_resource_provider_delete(client,
+ resource_group_name,
+ resource_provider_name,
+ no_wait=False):
+ return sdk_no_wait(no_wait,
+ client.begin_delete,
+ resource_group_name=resource_group_name,
+ resource_provider_name=resource_provider_name)
+
+
+def customproviders_association_show(client,
+ scope,
+ association_name):
+ return client.get(scope=scope,
+ association_name=association_name)
+
+
+def customproviders_association_create(client,
+ scope,
+ association_name,
+ target_resource_id=None,
+ no_wait=False):
+ return sdk_no_wait(no_wait,
+ client.begin_create_or_update,
+ scope=scope,
+ association_name=association_name,
+ target_resource_id=target_resource_id)
+
+
+def customproviders_association_update(client,
+ scope,
+ association_name,
+ target_resource_id=None,
+ no_wait=False):
+ return sdk_no_wait(no_wait,
+ client.begin_create_or_update,
+ scope=scope,
+ association_name=association_name,
+ target_resource_id=target_resource_id)
+
+
+def customproviders_association_delete(client,
+ scope,
+ association_name,
+ no_wait=False):
+ return sdk_no_wait(no_wait,
+ client.begin_delete,
+ scope=scope,
+ association_name=association_name)
+
+
+def customproviders_association_list_all(client,
+ scope):
+ return client.list_all(scope=scope)
diff --git a/src/customproviders/azext_customproviders/manual/__init__.py b/src/customproviders/azext_customproviders/manual/__init__.py
new file mode 100644
index 00000000000..c9cfdc73e77
--- /dev/null
+++ b/src/customproviders/azext_customproviders/manual/__init__.py
@@ -0,0 +1,12 @@
+# 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.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/customproviders/azext_customproviders/tests/__init__.py b/src/customproviders/azext_customproviders/tests/__init__.py
new file mode 100644
index 00000000000..50e0627daff
--- /dev/null
+++ b/src/customproviders/azext_customproviders/tests/__init__.py
@@ -0,0 +1,114 @@
+# 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 inspect
+import logging
+import os
+import sys
+import traceback
+import datetime as dt
+
+from azure.core.exceptions import AzureError
+from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError
+
+
+logger = logging.getLogger('azure.cli.testsdk')
+logger.addHandler(logging.StreamHandler())
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
+exceptions = []
+test_map = dict()
+SUCCESSED = "successed"
+FAILED = "failed"
+
+
+def try_manual(func):
+ def import_manual_function(origin_func):
+ from importlib import import_module
+ decorated_path = inspect.getfile(origin_func)
+ module_path = __path__[0]
+ if not decorated_path.startswith(module_path):
+ raise Exception("Decorator can only be used in submodules!")
+ manual_path = os.path.join(
+ decorated_path[module_path.rfind(os.path.sep) + 1:])
+ manual_file_path, manual_file_name = os.path.split(manual_path)
+ module_name, _ = os.path.splitext(manual_file_name)
+ manual_module = "..manual." + \
+ ".".join(manual_file_path.split(os.path.sep) + [module_name, ])
+ return getattr(import_module(manual_module, package=__name__), origin_func.__name__)
+
+ def get_func_to_call():
+ func_to_call = func
+ try:
+ func_to_call = import_manual_function(func)
+ func_to_call = import_manual_function(func)
+ logger.info("Found manual override for %s(...)", func.__name__)
+ except (ImportError, AttributeError):
+ pass
+ return func_to_call
+
+ def wrapper(*args, **kwargs):
+ func_to_call = get_func_to_call()
+ logger.info("running %s()...", func.__name__)
+ try:
+ test_map[func.__name__] = dict()
+ test_map[func.__name__]["result"] = SUCCESSED
+ test_map[func.__name__]["error_message"] = ""
+ test_map[func.__name__]["error_stack"] = ""
+ test_map[func.__name__]["error_normalized"] = ""
+ test_map[func.__name__]["start_dt"] = dt.datetime.utcnow()
+ ret = func_to_call(*args, **kwargs)
+ except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit,
+ JMESPathCheckAssertionError) as e:
+ test_map[func.__name__]["end_dt"] = dt.datetime.utcnow()
+ test_map[func.__name__]["result"] = FAILED
+ test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500]
+ test_map[func.__name__]["error_stack"] = traceback.format_exc().replace(
+ "\r\n", " ").replace("\n", " ")[:500]
+ logger.info("--------------------------------------")
+ logger.info("step exception: %s", e)
+ logger.error("--------------------------------------")
+ logger.error("step exception in %s: %s", func.__name__, e)
+ logger.info(traceback.format_exc())
+ exceptions.append((func.__name__, sys.exc_info()))
+ else:
+ test_map[func.__name__]["end_dt"] = dt.datetime.utcnow()
+ return ret
+
+ if inspect.isclass(func):
+ return get_func_to_call()
+ return wrapper
+
+
+def calc_coverage(filename):
+ filename = filename.split(".")[0]
+ coverage_name = filename + "_coverage.md"
+ with open(coverage_name, "w") as f:
+ f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n")
+ total = len(test_map)
+ covered = 0
+ for k, v in test_map.items():
+ if not k.startswith("step_"):
+ total -= 1
+ continue
+ if v["result"] == SUCCESSED:
+ covered += 1
+ f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|"
+ "{end_dt}|\n".format(step_name=k, **v))
+ f.write("Coverage: {}/{}\n".format(covered, total))
+ print("Create coverage\n", file=sys.stderr)
+
+
+def raise_if():
+ if exceptions:
+ if len(exceptions) <= 1:
+ raise exceptions[0][1][1]
+ message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1]))
+ message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]])
+ raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2])
diff --git a/src/customproviders/azext_customproviders/tests/latest/__init__.py b/src/customproviders/azext_customproviders/tests/latest/__init__.py
new file mode 100644
index 00000000000..c9cfdc73e77
--- /dev/null
+++ b/src/customproviders/azext_customproviders/tests/latest/__init__.py
@@ -0,0 +1,12 @@
+# 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.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/customproviders/azext_customproviders/tests/latest/test_customproviders_scenario.py b/src/customproviders/azext_customproviders/tests/latest/test_customproviders_scenario.py
new file mode 100644
index 00000000000..edcd7275102
--- /dev/null
+++ b/src/customproviders/azext_customproviders/tests/latest/test_customproviders_scenario.py
@@ -0,0 +1,169 @@
+# --------------------------------------------------------------------------
+# 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 os
+from azure.cli.testsdk import ScenarioTest
+from .. import try_manual, raise_if, calc_coverage
+from azure.cli.testsdk import ResourceGroupPreparer
+
+
+TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
+
+
+# Env setup
+@try_manual
+def setup(test, rg_2, rg):
+ pass
+
+
+# EXAMPLE: /Associations/put/Create or update an association
+@try_manual
+def step__associations_put(test, rg_2, rg):
+ test.cmd('az customproviders association create '
+ '--target-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Solution'
+ 's/applications/applicationName" '
+ '--name "{myAssociation}" '
+ '--scope "scope"',
+ checks=[
+ test.check("targetResourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Micro"
+ "soft.Solutions/applications/applicationName", case_sensitive=False),
+ test.check("name", "{myAssociation}", case_sensitive=False),
+ ])
+ test.cmd('az customproviders association wait --created '
+ '--name "{myAssociation}"',
+ checks=[])
+
+
+# EXAMPLE: /Associations/get/Get all associations
+@try_manual
+def step__associations_get_get_all_associations(test, rg_2, rg):
+ test.cmd('az customproviders association list-all '
+ '--scope "scope"',
+ checks=[])
+
+
+# EXAMPLE: /Associations/get/Get an association
+@try_manual
+def step__associations_get_get_an_association(test, rg_2, rg):
+ test.cmd('az customproviders association show '
+ '--name "{myAssociation}" '
+ '--scope "scope"',
+ checks=[
+ test.check("targetResourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Micro"
+ "soft.Solutions/applications/applicationName", case_sensitive=False),
+ test.check("name", "{myAssociation}", case_sensitive=False),
+ ])
+
+
+# EXAMPLE: /Associations/delete/Delete an association
+@try_manual
+def step__associations_delete_delete_an_association(test, rg_2, rg):
+ test.cmd('az customproviders association delete -y '
+ '--name "{myAssociation}" '
+ '--scope "scope"',
+ checks=[])
+
+
+# EXAMPLE: /CustomResourceProvider/put/Create or update the custom resource provider
+@try_manual
+def step__customresourceprovider_put(test, rg_2, rg):
+ test.cmd('az customproviders custom-resource-provider create '
+ '--resource-group "{rg}" '
+ '--location "eastus" '
+ '--actions name="TestAction" endpoint="https://mytestendpoint/" routing-type="Proxy" '
+ '--resource-types name="TestResource" endpoint="https://mytestendpoint2/" routing-type="Proxy,Cache" '
+ '--resource-provider-name "newrp"',
+ checks=[])
+
+
+# EXAMPLE: /CustomResourceProvider/get/Get a custom resource provider
+@try_manual
+def step__customresourceprovider_get(test, rg_2, rg):
+ test.cmd('az customproviders custom-resource-provider show '
+ '--resource-group "{rg}" '
+ '--resource-provider-name "newrp"',
+ checks=[])
+
+
+# EXAMPLE: /CustomResourceProvider/get/List all custom resource providers on the resourceGroup
+@try_manual
+def step__customresourceprovider_get2(test, rg_2, rg):
+ test.cmd('az customproviders custom-resource-provider list '
+ '--resource-group "{rg}"',
+ checks=[])
+
+
+# EXAMPLE: /CustomResourceProvider/get/List all custom resource providers on the subscription
+@try_manual
+def step__customresourceprovider_get3(test, rg_2, rg):
+ test.cmd('az customproviders custom-resource-provider list '
+ '-g ""',
+ checks=[])
+
+
+# EXAMPLE: /CustomResourceProvider/patch/Update a custom resource provider
+@try_manual
+def step__customresourceprovider_patch(test, rg_2, rg):
+ test.cmd('az customproviders custom-resource-provider update '
+ '--resource-group "{rg}" '
+ '--resource-provider-name "newrp"',
+ checks=[])
+
+
+# EXAMPLE: /CustomResourceProvider/delete/Delete a custom resource provider
+@try_manual
+def step__customresourceprovider_delete(test, rg_2, rg):
+ test.cmd('az customproviders custom-resource-provider delete -y '
+ '--resource-group "{rg}" '
+ '--resource-provider-name "newrp"',
+ checks=[])
+
+
+# Env cleanup
+@try_manual
+def cleanup(test, rg_2, rg):
+ pass
+
+
+# Testcase
+@try_manual
+def call_scenario(test, rg_2, rg):
+ setup(test, rg_2, rg)
+ step__associations_put(test, rg_2, rg)
+ step__associations_get_get_all_associations(test, rg_2, rg)
+ step__associations_get_get_an_association(test, rg_2, rg)
+ step__associations_delete_delete_an_association(test, rg_2, rg)
+ step__customresourceprovider_put(test, rg_2, rg)
+ step__customresourceprovider_get(test, rg_2, rg)
+ step__customresourceprovider_get2(test, rg_2, rg)
+ step__customresourceprovider_get3(test, rg_2, rg)
+ step__customresourceprovider_patch(test, rg_2, rg)
+ step__customresourceprovider_delete(test, rg_2, rg)
+ cleanup(test, rg_2, rg)
+
+
+@try_manual
+class CustomprovidersScenarioTest(ScenarioTest):
+
+ @ResourceGroupPreparer(name_prefix='clitestcustomproviders_appRG'[:7], key='rg_2', parameter_name='rg_2')
+ @ResourceGroupPreparer(name_prefix='clitestcustomproviders_testRG'[:7], key='rg', parameter_name='rg')
+ def test_customproviders(self, rg_2, rg):
+
+ self.kwargs.update({
+ 'subscription_id': self.get_subscription_id()
+ })
+
+ self.kwargs.update({
+ 'myAssociation': 'associationName',
+ })
+
+ call_scenario(self, rg_2, rg)
+ calc_coverage(__file__)
+ raise_if()
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/__init__.py b/src/customproviders/azext_customproviders/vendored_sdks/__init__.py
new file mode 100644
index 00000000000..c9cfdc73e77
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/__init__.py
@@ -0,0 +1,12 @@
+# 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.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/__init__.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/__init__.py
new file mode 100644
index 00000000000..3396cd480cd
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/__init__.py
@@ -0,0 +1,16 @@
+# 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 import Customproviders
+__all__ = ['Customproviders']
+
+try:
+ from ._patch import patch_sdk # type: ignore
+ patch_sdk()
+except ImportError:
+ pass
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/_configuration.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/_configuration.py
new file mode 100644
index 00000000000..dcb7b9f674a
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/_configuration.py
@@ -0,0 +1,70 @@
+# 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 typing import TYPE_CHECKING
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+from azure.mgmt.core.policies import ARMHttpLoggingPolicy
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
+
+ from azure.core.credentials import TokenCredential
+
+VERSION = "unknown"
+
+class CustomprovidersConfiguration(Configuration):
+ """Configuration for Customproviders.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials.TokenCredential
+ :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ :type subscription_id: str
+ """
+
+ def __init__(
+ self,
+ credential, # type: "TokenCredential"
+ subscription_id, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ if credential is None:
+ raise ValueError("Parameter 'credential' must not be None.")
+ if subscription_id is None:
+ raise ValueError("Parameter 'subscription_id' must not be None.")
+ super(CustomprovidersConfiguration, self).__init__(**kwargs)
+
+ self.credential = credential
+ self.subscription_id = subscription_id
+ self.api_version = "2018-09-01-preview"
+ self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
+ kwargs.setdefault('sdk_moniker', 'customproviders/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
+ if self.credential and not self.authentication_policy:
+ self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/_customproviders.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/_customproviders.py
new file mode 100644
index 00000000000..1415610ecb9
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/_customproviders.py
@@ -0,0 +1,79 @@
+# 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 typing import TYPE_CHECKING
+
+from azure.mgmt.core import ARMPipelineClient
+from msrest import Deserializer, Serializer
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Optional
+
+ from azure.core.credentials import TokenCredential
+
+from ._configuration import CustomprovidersConfiguration
+from .operations import OperationOperations
+from .operations import CustomResourceProviderOperations
+from .operations import AssociationOperations
+from . import models
+
+
+class Customproviders(object):
+ """Allows extension of ARM control plane with custom resource providers.
+
+ :ivar operation: OperationOperations operations
+ :vartype operation: customproviders.operations.OperationOperations
+ :ivar custom_resource_provider: CustomResourceProviderOperations operations
+ :vartype custom_resource_provider: customproviders.operations.CustomResourceProviderOperations
+ :ivar association: AssociationOperations operations
+ :vartype association: customproviders.operations.AssociationOperations
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials.TokenCredential
+ :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
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ """
+
+ def __init__(
+ self,
+ credential, # type: "TokenCredential"
+ subscription_id, # type: str
+ base_url=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ if not base_url:
+ base_url = 'https://management.azure.com'
+ self._config = CustomprovidersConfiguration(credential, subscription_id, **kwargs)
+ self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
+
+ client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
+ self._serialize = Serializer(client_models)
+ self._deserialize = Deserializer(client_models)
+
+ self.operation = OperationOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+ self.custom_resource_provider = CustomResourceProviderOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+ self.association = AssociationOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+
+ def close(self):
+ # type: () -> None
+ self._client.close()
+
+ def __enter__(self):
+ # type: () -> Customproviders
+ self._client.__enter__()
+ return self
+
+ def __exit__(self, *exc_details):
+ # type: (Any) -> None
+ self._client.__exit__(*exc_details)
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/__init__.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/__init__.py
new file mode 100644
index 00000000000..158a0fe1249
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/__init__.py
@@ -0,0 +1,10 @@
+# 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 import Customproviders
+__all__ = ['Customproviders']
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/_configuration.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/_configuration.py
new file mode 100644
index 00000000000..2c35f9ce76c
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/_configuration.py
@@ -0,0 +1,66 @@
+# 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 typing import Any, TYPE_CHECKING
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+from azure.mgmt.core.policies import ARMHttpLoggingPolicy
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from azure.core.credentials_async import AsyncTokenCredential
+
+VERSION = "unknown"
+
+class CustomprovidersConfiguration(Configuration):
+ """Configuration for Customproviders.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
+ :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ :type subscription_id: str
+ """
+
+ def __init__(
+ self,
+ credential: "AsyncTokenCredential",
+ subscription_id: str,
+ **kwargs: Any
+ ) -> None:
+ if credential is None:
+ raise ValueError("Parameter 'credential' must not be None.")
+ if subscription_id is None:
+ raise ValueError("Parameter 'subscription_id' must not be None.")
+ super(CustomprovidersConfiguration, self).__init__(**kwargs)
+
+ self.credential = credential
+ self.subscription_id = subscription_id
+ self.api_version = "2018-09-01-preview"
+ self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
+ kwargs.setdefault('sdk_moniker', 'customproviders/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
+ if self.credential and not self.authentication_policy:
+ self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/_customproviders.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/_customproviders.py
new file mode 100644
index 00000000000..a65b697d28b
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/_customproviders.py
@@ -0,0 +1,73 @@
+# 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 typing import Any, Optional, TYPE_CHECKING
+
+from azure.mgmt.core import AsyncARMPipelineClient
+from msrest import Deserializer, Serializer
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from azure.core.credentials_async import AsyncTokenCredential
+
+from ._configuration import CustomprovidersConfiguration
+from .operations import OperationOperations
+from .operations import CustomResourceProviderOperations
+from .operations import AssociationOperations
+from .. import models
+
+
+class Customproviders(object):
+ """Allows extension of ARM control plane with custom resource providers.
+
+ :ivar operation: OperationOperations operations
+ :vartype operation: customproviders.aio.operations.OperationOperations
+ :ivar custom_resource_provider: CustomResourceProviderOperations operations
+ :vartype custom_resource_provider: customproviders.aio.operations.CustomResourceProviderOperations
+ :ivar association: AssociationOperations operations
+ :vartype association: customproviders.aio.operations.AssociationOperations
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
+ :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
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ """
+
+ def __init__(
+ self,
+ credential: "AsyncTokenCredential",
+ subscription_id: str,
+ base_url: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ if not base_url:
+ base_url = 'https://management.azure.com'
+ self._config = CustomprovidersConfiguration(credential, subscription_id, **kwargs)
+ self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
+
+ client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
+ self._serialize = Serializer(client_models)
+ self._deserialize = Deserializer(client_models)
+
+ self.operation = OperationOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+ self.custom_resource_provider = CustomResourceProviderOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+ self.association = AssociationOperations(
+ self._client, self._config, self._serialize, self._deserialize)
+
+ async def close(self) -> None:
+ await self._client.close()
+
+ async def __aenter__(self) -> "Customproviders":
+ await self._client.__aenter__()
+ return self
+
+ async def __aexit__(self, *exc_details) -> None:
+ await self._client.__aexit__(*exc_details)
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/__init__.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/__init__.py
new file mode 100644
index 00000000000..865272625df
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/__init__.py
@@ -0,0 +1,17 @@
+# 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 ._operation_operations import OperationOperations
+from ._custom_resource_provider_operations import CustomResourceProviderOperations
+from ._association_operations import AssociationOperations
+
+__all__ = [
+ 'OperationOperations',
+ 'CustomResourceProviderOperations',
+ 'AssociationOperations',
+]
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/_association_operations.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/_association_operations.py
new file mode 100644
index 00000000000..26bfd2c914b
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/_association_operations.py
@@ -0,0 +1,411 @@
+# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class AssociationOperations:
+ """AssociationOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~customproviders.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ async def _create_or_update_initial(
+ self,
+ scope: str,
+ association_name: str,
+ target_resource_id: Optional[str] = None,
+ **kwargs
+ ) -> "models.Association":
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Association"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+
+ association = models.Association(target_resource_id=target_resource_id)
+ api_version = "2018-09-01-preview"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self._create_or_update_initial.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(association, 'Association')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('Association', pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize('Association', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ _create_or_update_initial.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ async def begin_create_or_update(
+ self,
+ scope: str,
+ association_name: str,
+ target_resource_id: Optional[str] = None,
+ **kwargs
+ ) -> AsyncLROPoller["models.Association"]:
+ """Create or update an association.
+
+ :param scope: The scope of the association. The scope can be any valid REST resource instance.
+ For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-
+ name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.
+ :type scope: str
+ :param association_name: The name of the association.
+ :type association_name: str
+ :param target_resource_id: The REST resource instance of the target resource for this
+ association.
+ :type target_resource_id: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either Association or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~customproviders.models.Association]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Association"]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = await self._create_or_update_initial(
+ scope=scope,
+ association_name=association_name,
+ target_resource_id=target_resource_id,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize('Association', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+
+ if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = AsyncNoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ async def _delete_initial(
+ self,
+ scope: str,
+ association_name: str,
+ **kwargs
+ ) -> None:
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ # Construct URL
+ url = self._delete_initial.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ _delete_initial.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ async def begin_delete(
+ self,
+ scope: str,
+ association_name: str,
+ **kwargs
+ ) -> AsyncLROPoller[None]:
+ """Delete an association.
+
+ :param scope: The scope of the association.
+ :type scope: str
+ :param association_name: The name of the association.
+ :type association_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = await self._delete_initial(
+ scope=scope,
+ association_name=association_name,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+
+ if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = AsyncNoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_delete.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ async def get(
+ self,
+ scope: str,
+ association_name: str,
+ **kwargs
+ ) -> "models.Association":
+ """Get an association.
+
+ :param scope: The scope of the association.
+ :type scope: str
+ :param association_name: The name of the association.
+ :type association_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Association, or the result of cls(response)
+ :rtype: ~customproviders.models.Association
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Association"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('Association', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ def list_all(
+ self,
+ scope: str,
+ **kwargs
+ ) -> AsyncIterable["models.AssociationsList"]:
+ """Gets all association for the given scope.
+
+ :param scope: The scope of the association.
+ :type scope: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either AssociationsList or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~customproviders.models.AssociationsList]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.AssociationsList"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list_all.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('AssociationsList', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ list_all.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations'} # type: ignore
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/_custom_resource_provider_operations.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/_custom_resource_provider_operations.py
new file mode 100644
index 00000000000..9abc0dd8b20
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/_custom_resource_provider_operations.py
@@ -0,0 +1,571 @@
+# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class CustomResourceProviderOperations:
+ """CustomResourceProviderOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~customproviders.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ async def _create_or_update_initial(
+ self,
+ resource_group_name: str,
+ resource_provider_name: str,
+ location: str,
+ tags: Optional[Dict[str, str]] = None,
+ actions: Optional[List["models.CustomRPActionRouteDefinition"]] = None,
+ resource_types: Optional[List["models.CustomRPResourceTypeRouteDefinition"]] = None,
+ validations: Optional[List["models.CustomRPValidations"]] = None,
+ **kwargs
+ ) -> "models.CustomRPManifest":
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+
+ resource_provider = models.CustomRPManifest(location=location, tags=tags, actions=actions, resource_types=resource_types, validations=validations)
+ api_version = "2018-09-01-preview"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self._create_or_update_initial.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(resource_provider, 'CustomRPManifest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ resource_provider_name: str,
+ location: str,
+ tags: Optional[Dict[str, str]] = None,
+ actions: Optional[List["models.CustomRPActionRouteDefinition"]] = None,
+ resource_types: Optional[List["models.CustomRPResourceTypeRouteDefinition"]] = None,
+ validations: Optional[List["models.CustomRPValidations"]] = None,
+ **kwargs
+ ) -> AsyncLROPoller["models.CustomRPManifest"]:
+ """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 location: 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[~customproviders.models.CustomRPActionRouteDefinition]
+ :param resource_types: A list of resource types that the custom resource provider implements.
+ :type resource_types: list[~customproviders.models.CustomRPResourceTypeRouteDefinition]
+ :param validations: A list of validations to run on the custom resource provider's requests.
+ :type validations: list[~customproviders.models.CustomRPValidations]
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either CustomRPManifest or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~customproviders.models.CustomRPManifest]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CustomRPManifest"]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = await self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_name=resource_provider_name,
+ location=location,
+ tags=tags,
+ actions=actions,
+ resource_types=resource_types,
+ validations=validations,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ 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),
+ }
+
+ if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = AsyncNoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ async def _delete_initial(
+ self,
+ resource_group_name: str,
+ resource_provider_name: str,
+ **kwargs
+ ) -> None:
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ # Construct URL
+ url = self._delete_initial.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ async def begin_delete(
+ self,
+ resource_group_name: str,
+ resource_provider_name: str,
+ **kwargs
+ ) -> AsyncLROPoller[None]:
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = await self._delete_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_name=resource_provider_name,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ 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),
+ }
+
+ if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = AsyncNoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ async def get(
+ self,
+ resource_group_name: str,
+ resource_provider_name: str,
+ **kwargs
+ ) -> "models.CustomRPManifest":
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CustomRPManifest, or the result of cls(response)
+ :rtype: ~customproviders.models.CustomRPManifest
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ async def update(
+ self,
+ resource_group_name: str,
+ resource_provider_name: str,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ) -> "models.CustomRPManifest":
+ """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]
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CustomRPManifest, or the result of cls(response)
+ :rtype: ~customproviders.models.CustomRPManifest
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+
+ patchable_resource = models.ResourceProvidersUpdate(tags=tags)
+ api_version = "2018-09-01-preview"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.update.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(patchable_resource, 'ResourceProvidersUpdate')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ def list_by_resource_group(
+ self,
+ resource_group_name: str,
+ **kwargs
+ ) -> AsyncIterable["models.ListByCustomRPManifest"]:
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ListByCustomRPManifest or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~customproviders.models.ListByCustomRPManifest]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ListByCustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list_by_resource_group.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('ListByCustomRPManifest', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders'} # type: ignore
+
+ def list_by_subscription(
+ self,
+ **kwargs
+ ) -> AsyncIterable["models.ListByCustomRPManifest"]:
+ """Gets all the custom resource providers within a subscription.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ListByCustomRPManifest or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~customproviders.models.ListByCustomRPManifest]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ListByCustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list_by_subscription.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('ListByCustomRPManifest', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CustomProviders/resourceProviders'} # type: ignore
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/_operation_operations.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/_operation_operations.py
new file mode 100644
index 00000000000..ae6055593d1
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/aio/operations/_operation_operations.py
@@ -0,0 +1,105 @@
+# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class OperationOperations:
+ """OperationOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~customproviders.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ **kwargs
+ ) -> AsyncIterable["models.ResourceProviderOperationList"]:
+ """The list of operations provided by Microsoft CustomProviders.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~customproviders.models.ResourceProviderOperationList]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceProviderOperationList"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ list.metadata = {'url': '/providers/Microsoft.CustomProviders/operations'} # type: ignore
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/__init__.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/__init__.py
new file mode 100644
index 00000000000..a196b22c81a
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/__init__.py
@@ -0,0 +1,69 @@
+# 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 ._models_py3 import Association
+ from ._models_py3 import AssociationsList
+ from ._models_py3 import CustomRPActionRouteDefinition
+ from ._models_py3 import CustomRPManifest
+ from ._models_py3 import CustomRPResourceTypeRouteDefinition
+ from ._models_py3 import CustomRPRouteDefinition
+ from ._models_py3 import CustomRPValidations
+ from ._models_py3 import ErrorDefinition
+ from ._models_py3 import ErrorResponse
+ from ._models_py3 import ListByCustomRPManifest
+ from ._models_py3 import Resource
+ from ._models_py3 import ResourceProviderOperation
+ from ._models_py3 import ResourceProviderOperationDisplay
+ from ._models_py3 import ResourceProviderOperationList
+ from ._models_py3 import ResourceProvidersUpdate
+except (SyntaxError, ImportError):
+ from ._models import Association # type: ignore
+ from ._models import AssociationsList # type: ignore
+ from ._models import CustomRPActionRouteDefinition # type: ignore
+ from ._models import CustomRPManifest # type: ignore
+ from ._models import CustomRPResourceTypeRouteDefinition # type: ignore
+ from ._models import CustomRPRouteDefinition # type: ignore
+ from ._models import CustomRPValidations # type: ignore
+ from ._models import ErrorDefinition # type: ignore
+ from ._models import ErrorResponse # type: ignore
+ from ._models import ListByCustomRPManifest # type: ignore
+ from ._models import Resource # type: ignore
+ from ._models import ResourceProviderOperation # type: ignore
+ from ._models import ResourceProviderOperationDisplay # type: ignore
+ from ._models import ResourceProviderOperationList # type: ignore
+ from ._models import ResourceProvidersUpdate # type: ignore
+
+from ._customproviders_enums import (
+ ActionRouting,
+ ProvisioningState,
+ ResourceTypeRouting,
+ ValidationType,
+)
+
+__all__ = [
+ 'Association',
+ 'AssociationsList',
+ 'CustomRPActionRouteDefinition',
+ 'CustomRPManifest',
+ 'CustomRPResourceTypeRouteDefinition',
+ 'CustomRPRouteDefinition',
+ 'CustomRPValidations',
+ 'ErrorDefinition',
+ 'ErrorResponse',
+ 'ListByCustomRPManifest',
+ 'Resource',
+ 'ResourceProviderOperation',
+ 'ResourceProviderOperationDisplay',
+ 'ResourceProviderOperationList',
+ 'ResourceProvidersUpdate',
+ 'ActionRouting',
+ 'ProvisioningState',
+ 'ResourceTypeRouting',
+ 'ValidationType',
+]
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/_customproviders_enums.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/_customproviders_enums.py
new file mode 100644
index 00000000000..25436b9160c
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/_customproviders_enums.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 enum import Enum, EnumMeta
+from six import with_metaclass
+
+class _CaseInsensitiveEnumMeta(EnumMeta):
+ def __getitem__(self, name):
+ return super().__getitem__(name.upper())
+
+ def __getattr__(cls, name):
+ """Return the enum member matching `name`
+ We use __getattr__ instead of descriptors or inserting into the enum
+ class' __dict__ in order to support `name` and `value` being both
+ properties for enum members (which live in the class' __dict__) and
+ enum members themselves.
+ """
+ try:
+ return cls._member_map_[name.upper()]
+ except KeyError:
+ raise AttributeError(name)
+
+
+class ActionRouting(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The routing types that are supported for action requests.
+ """
+
+ PROXY = "Proxy"
+
+class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The provisioning state of the resource provider.
+ """
+
+ ACCEPTED = "Accepted"
+ DELETING = "Deleting"
+ RUNNING = "Running"
+ SUCCEEDED = "Succeeded"
+ FAILED = "Failed"
+
+class ResourceTypeRouting(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The routing types that are supported for resource requests.
+ """
+
+ PROXY = "Proxy"
+ PROXY_CACHE = "Proxy,Cache"
+
+class ValidationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The type of validation to run against a matching request.
+ """
+
+ SWAGGER = "Swagger"
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/_models.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/_models.py
new file mode 100644
index 00000000000..a0ece7467a1
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/_models.py
@@ -0,0 +1,496 @@
+# 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 azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+
+class Association(msrest.serialization.Model):
+ """The resource definition of this association.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: The association id.
+ :vartype id: str
+ :ivar name: The association name.
+ :vartype name: str
+ :ivar type: The association type.
+ :vartype type: str
+ :param target_resource_id: The REST resource instance of the target resource for this
+ association.
+ :type target_resource_id: str
+ :ivar provisioning_state: The provisioning state of the association. Possible values include:
+ "Accepted", "Deleting", "Running", "Succeeded", "Failed".
+ :vartype provisioning_state: str or ~customproviders.models.ProvisioningState
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'provisioning_state': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'target_resource_id': {'key': 'properties.targetResourceId', 'type': 'str'},
+ 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(Association, self).__init__(**kwargs)
+ self.id = None
+ self.name = None
+ self.type = None
+ self.target_resource_id = kwargs.get('target_resource_id', None)
+ self.provisioning_state = None
+
+
+class AssociationsList(msrest.serialization.Model):
+ """List of associations.
+
+ :param value: The array of associations.
+ :type value: list[~customproviders.models.Association]
+ :param next_link: The URL to use for getting the next set of results.
+ :type next_link: str
+ """
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[Association]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(AssociationsList, self).__init__(**kwargs)
+ self.value = kwargs.get('value', None)
+ self.next_link = kwargs.get('next_link', None)
+
+
+class CustomRPRouteDefinition(msrest.serialization.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['name']
+ self.endpoint = kwargs['endpoint']
+
+
+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 ~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)
+
+
+class Resource(msrest.serialization.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: A set of 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['location']
+ self.tags = kwargs.get('tags', None)
+
+
+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: A set of tags. Resource tags.
+ :type tags: dict[str, str]
+ :param actions: A list of actions that the custom resource provider implements.
+ :type actions: list[~customproviders.models.CustomRPActionRouteDefinition]
+ :param resource_types: A list of resource types that the custom resource provider implements.
+ :type resource_types: list[~customproviders.models.CustomRPResourceTypeRouteDefinition]
+ :param validations: A list of validations to run on the custom resource provider's requests.
+ :type validations: list[~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 ~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
+
+
+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 ~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)
+
+
+class CustomRPValidations(msrest.serialization.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 ~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['specification']
+
+
+class ErrorDefinition(msrest.serialization.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[~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
+
+
+class ErrorResponse(msrest.serialization.Model):
+ """Error response.
+
+ :param error: The error details.
+ :type error: ~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 ListByCustomRPManifest(msrest.serialization.Model):
+ """List of custom resource providers.
+
+ :param value: The array of custom resource provider manifests.
+ :type value: list[~customproviders.models.CustomRPManifest]
+ :param next_link: The URL to use for getting the next set of results.
+ :type next_link: str
+ """
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[CustomRPManifest]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ListByCustomRPManifest, self).__init__(**kwargs)
+ self.value = kwargs.get('value', None)
+ self.next_link = kwargs.get('next_link', None)
+
+
+class ResourceProviderOperation(msrest.serialization.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: ~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)
+
+
+class ResourceProviderOperationDisplay(msrest.serialization.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)
+
+
+class ResourceProviderOperationList(msrest.serialization.Model):
+ """Results of the request to list operations.
+
+ :param value: List of operations supported by this resource provider.
+ :type value: list[~customproviders.models.ResourceProviderOperation]
+ :param next_link: The URL to use for getting the next set of results.
+ :type next_link: str
+ """
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ResourceProviderOperationList, self).__init__(**kwargs)
+ self.value = kwargs.get('value', None)
+ self.next_link = kwargs.get('next_link', None)
+
+
+class ResourceProvidersUpdate(msrest.serialization.Model):
+ """custom resource provider update information.
+
+ :param tags: A set of 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/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/_models_py3.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/_models_py3.py
new file mode 100644
index 00000000000..66e3fa29d2e
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/models/_models_py3.py
@@ -0,0 +1,546 @@
+# 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 typing import Dict, List, Optional, Union
+
+from azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+from ._customproviders_enums import *
+
+
+class Association(msrest.serialization.Model):
+ """The resource definition of this association.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: The association id.
+ :vartype id: str
+ :ivar name: The association name.
+ :vartype name: str
+ :ivar type: The association type.
+ :vartype type: str
+ :param target_resource_id: The REST resource instance of the target resource for this
+ association.
+ :type target_resource_id: str
+ :ivar provisioning_state: The provisioning state of the association. Possible values include:
+ "Accepted", "Deleting", "Running", "Succeeded", "Failed".
+ :vartype provisioning_state: str or ~customproviders.models.ProvisioningState
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'provisioning_state': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'target_resource_id': {'key': 'properties.targetResourceId', 'type': 'str'},
+ 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ target_resource_id: Optional[str] = None,
+ **kwargs
+ ):
+ super(Association, self).__init__(**kwargs)
+ self.id = None
+ self.name = None
+ self.type = None
+ self.target_resource_id = target_resource_id
+ self.provisioning_state = None
+
+
+class AssociationsList(msrest.serialization.Model):
+ """List of associations.
+
+ :param value: The array of associations.
+ :type value: list[~customproviders.models.Association]
+ :param next_link: The URL to use for getting the next set of results.
+ :type next_link: str
+ """
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[Association]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[List["Association"]] = None,
+ next_link: Optional[str] = None,
+ **kwargs
+ ):
+ super(AssociationsList, self).__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
+
+
+class CustomRPRouteDefinition(msrest.serialization.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
+ ):
+ super(CustomRPRouteDefinition, self).__init__(**kwargs)
+ self.name = name
+ self.endpoint = endpoint
+
+
+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 ~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: Optional[Union[str, "ActionRouting"]] = None,
+ **kwargs
+ ):
+ super(CustomRPActionRouteDefinition, self).__init__(name=name, endpoint=endpoint, **kwargs)
+ self.routing_type = routing_type
+
+
+class Resource(msrest.serialization.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: A set of 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: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
+ super(Resource, self).__init__(**kwargs)
+ self.id = None
+ self.name = None
+ self.type = None
+ self.location = location
+ self.tags = tags
+
+
+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: A set of tags. Resource tags.
+ :type tags: dict[str, str]
+ :param actions: A list of actions that the custom resource provider implements.
+ :type actions: list[~customproviders.models.CustomRPActionRouteDefinition]
+ :param resource_types: A list of resource types that the custom resource provider implements.
+ :type resource_types: list[~customproviders.models.CustomRPResourceTypeRouteDefinition]
+ :param validations: A list of validations to run on the custom resource provider's requests.
+ :type validations: list[~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 ~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: Optional[Dict[str, str]] = None,
+ actions: Optional[List["CustomRPActionRouteDefinition"]] = None,
+ resource_types: Optional[List["CustomRPResourceTypeRouteDefinition"]] = None,
+ validations: Optional[List["CustomRPValidations"]] = None,
+ **kwargs
+ ):
+ super(CustomRPManifest, self).__init__(location=location, tags=tags, **kwargs)
+ self.actions = actions
+ self.resource_types = resource_types
+ self.validations = validations
+ self.provisioning_state = None
+
+
+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 ~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: Optional[Union[str, "ResourceTypeRouting"]] = None,
+ **kwargs
+ ):
+ super(CustomRPResourceTypeRouteDefinition, self).__init__(name=name, endpoint=endpoint, **kwargs)
+ self.routing_type = routing_type
+
+
+class CustomRPValidations(msrest.serialization.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 ~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: Optional[Union[str, "ValidationType"]] = None,
+ **kwargs
+ ):
+ super(CustomRPValidations, self).__init__(**kwargs)
+ self.validation_type = validation_type
+ self.specification = specification
+
+
+class ErrorDefinition(msrest.serialization.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[~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
+
+
+class ErrorResponse(msrest.serialization.Model):
+ """Error response.
+
+ :param error: The error details.
+ :type error: ~customproviders.models.ErrorDefinition
+ """
+
+ _attribute_map = {
+ 'error': {'key': 'error', 'type': 'ErrorDefinition'},
+ }
+
+ def __init__(
+ self,
+ *,
+ error: Optional["ErrorDefinition"] = None,
+ **kwargs
+ ):
+ super(ErrorResponse, self).__init__(**kwargs)
+ self.error = error
+
+
+class ListByCustomRPManifest(msrest.serialization.Model):
+ """List of custom resource providers.
+
+ :param value: The array of custom resource provider manifests.
+ :type value: list[~customproviders.models.CustomRPManifest]
+ :param next_link: The URL to use for getting the next set of results.
+ :type next_link: str
+ """
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[CustomRPManifest]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[List["CustomRPManifest"]] = None,
+ next_link: Optional[str] = None,
+ **kwargs
+ ):
+ super(ListByCustomRPManifest, self).__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
+
+
+class ResourceProviderOperation(msrest.serialization.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: ~customproviders.models.ResourceProviderOperationDisplay
+ """
+
+ _attribute_map = {
+ 'name': {'key': 'name', 'type': 'str'},
+ 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'},
+ }
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ display: Optional["ResourceProviderOperationDisplay"] = None,
+ **kwargs
+ ):
+ super(ResourceProviderOperation, self).__init__(**kwargs)
+ self.name = name
+ self.display = display
+
+
+class ResourceProviderOperationDisplay(msrest.serialization.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: Optional[str] = None,
+ resource: Optional[str] = None,
+ operation: Optional[str] = None,
+ description: Optional[str] = None,
+ **kwargs
+ ):
+ super(ResourceProviderOperationDisplay, self).__init__(**kwargs)
+ self.provider = provider
+ self.resource = resource
+ self.operation = operation
+ self.description = description
+
+
+class ResourceProviderOperationList(msrest.serialization.Model):
+ """Results of the request to list operations.
+
+ :param value: List of operations supported by this resource provider.
+ :type value: list[~customproviders.models.ResourceProviderOperation]
+ :param next_link: The URL to use for getting the next set of results.
+ :type next_link: str
+ """
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[List["ResourceProviderOperation"]] = None,
+ next_link: Optional[str] = None,
+ **kwargs
+ ):
+ super(ResourceProviderOperationList, self).__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
+
+
+class ResourceProvidersUpdate(msrest.serialization.Model):
+ """custom resource provider update information.
+
+ :param tags: A set of tags. Resource tags.
+ :type tags: dict[str, str]
+ """
+
+ _attribute_map = {
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ }
+
+ def __init__(
+ self,
+ *,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs
+ ):
+ super(ResourceProvidersUpdate, self).__init__(**kwargs)
+ self.tags = tags
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/__init__.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/__init__.py
new file mode 100644
index 00000000000..865272625df
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/__init__.py
@@ -0,0 +1,17 @@
+# 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 ._operation_operations import OperationOperations
+from ._custom_resource_provider_operations import CustomResourceProviderOperations
+from ._association_operations import AssociationOperations
+
+__all__ = [
+ 'OperationOperations',
+ 'CustomResourceProviderOperations',
+ 'AssociationOperations',
+]
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/_association_operations.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/_association_operations.py
new file mode 100644
index 00000000000..29aa86ddd80
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/_association_operations.py
@@ -0,0 +1,421 @@
+# 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 typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class AssociationOperations(object):
+ """AssociationOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~customproviders.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def _create_or_update_initial(
+ self,
+ scope, # type: str
+ association_name, # type: str
+ target_resource_id=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.Association"
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Association"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+
+ association = models.Association(target_resource_id=target_resource_id)
+ api_version = "2018-09-01-preview"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self._create_or_update_initial.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(association, 'Association')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('Association', pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize('Association', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ _create_or_update_initial.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ def begin_create_or_update(
+ self,
+ scope, # type: str
+ association_name, # type: str
+ target_resource_id=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> LROPoller["models.Association"]
+ """Create or update an association.
+
+ :param scope: The scope of the association. The scope can be any valid REST resource instance.
+ For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-
+ name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.
+ :type scope: str
+ :param association_name: The name of the association.
+ :type association_name: str
+ :param target_resource_id: The REST resource instance of the target resource for this
+ association.
+ :type target_resource_id: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of LROPoller that returns either Association or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~customproviders.models.Association]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Association"]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = self._create_or_update_initial(
+ scope=scope,
+ association_name=association_name,
+ target_resource_id=target_resource_id,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize('Association', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+
+ if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = NoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ def _delete_initial(
+ self,
+ scope, # type: str
+ association_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ # Construct URL
+ url = self._delete_initial.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ _delete_initial.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ def begin_delete(
+ self,
+ scope, # type: str
+ association_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> LROPoller[None]
+ """Delete an association.
+
+ :param scope: The scope of the association.
+ :type scope: str
+ :param association_name: The name of the association.
+ :type association_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = self._delete_initial(
+ scope=scope,
+ association_name=association_name,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+
+ if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = NoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_delete.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ def get(
+ self,
+ scope, # type: str
+ association_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.Association"
+ """Get an association.
+
+ :param scope: The scope of the association.
+ :type scope: str
+ :param association_name: The name of the association.
+ :type association_name: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: Association, or the result of cls(response)
+ :rtype: ~customproviders.models.Association
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.Association"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ 'associationName': self._serialize.url("association_name", association_name, 'str'),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('Association', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} # type: ignore
+
+ def list_all(
+ self,
+ scope, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.AssociationsList"]
+ """Gets all association for the given scope.
+
+ :param scope: The scope of the association.
+ :type scope: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either AssociationsList or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~customproviders.models.AssociationsList]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.AssociationsList"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list_all.metadata['url'] # type: ignore
+ path_format_arguments = {
+ 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('AssociationsList', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ list_all.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations'} # type: ignore
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/_custom_resource_provider_operations.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/_custom_resource_provider_operations.py
new file mode 100644
index 00000000000..7f68e73a18d
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/_custom_resource_provider_operations.py
@@ -0,0 +1,583 @@
+# 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 typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class CustomResourceProviderOperations(object):
+ """CustomResourceProviderOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~customproviders.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def _create_or_update_initial(
+ self,
+ resource_group_name, # type: str
+ resource_provider_name, # type: str
+ location, # type: str
+ tags=None, # type: Optional[Dict[str, str]]
+ actions=None, # type: Optional[List["models.CustomRPActionRouteDefinition"]]
+ resource_types=None, # type: Optional[List["models.CustomRPResourceTypeRouteDefinition"]]
+ validations=None, # type: Optional[List["models.CustomRPValidations"]]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CustomRPManifest"
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+
+ resource_provider = models.CustomRPManifest(location=location, tags=tags, actions=actions, resource_types=resource_types, validations=validations)
+ api_version = "2018-09-01-preview"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self._create_or_update_initial.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(resource_provider, 'CustomRPManifest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if response.status_code == 201:
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ def begin_create_or_update(
+ self,
+ resource_group_name, # type: str
+ resource_provider_name, # type: str
+ location, # type: str
+ tags=None, # type: Optional[Dict[str, str]]
+ actions=None, # type: Optional[List["models.CustomRPActionRouteDefinition"]]
+ resource_types=None, # type: Optional[List["models.CustomRPResourceTypeRouteDefinition"]]
+ validations=None, # type: Optional[List["models.CustomRPValidations"]]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> LROPoller["models.CustomRPManifest"]
+ """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 location: 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[~customproviders.models.CustomRPActionRouteDefinition]
+ :param resource_types: A list of resource types that the custom resource provider implements.
+ :type resource_types: list[~customproviders.models.CustomRPResourceTypeRouteDefinition]
+ :param validations: A list of validations to run on the custom resource provider's requests.
+ :type validations: list[~customproviders.models.CustomRPValidations]
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of LROPoller that returns either CustomRPManifest or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~customproviders.models.CustomRPManifest]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CustomRPManifest"]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_name=resource_provider_name,
+ location=location,
+ tags=tags,
+ actions=actions,
+ resource_types=resource_types,
+ validations=validations,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ 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),
+ }
+
+ if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = NoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ def _delete_initial(
+ self,
+ resource_group_name, # type: str
+ resource_provider_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ # Construct URL
+ url = self._delete_initial.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ def begin_delete(
+ self,
+ resource_group_name, # type: str
+ resource_provider_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> LROPoller[None]
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = self._delete_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_name=resource_provider_name,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ 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),
+ }
+
+ if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = NoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ def get(
+ self,
+ resource_group_name, # type: str
+ resource_provider_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CustomRPManifest"
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CustomRPManifest, or the result of cls(response)
+ :rtype: ~customproviders.models.CustomRPManifest
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ def update(
+ self,
+ resource_group_name, # type: str
+ resource_provider_name, # type: str
+ tags=None, # type: Optional[Dict[str, str]]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CustomRPManifest"
+ """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]
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CustomRPManifest, or the result of cls(response)
+ :rtype: ~customproviders.models.CustomRPManifest
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+
+ patchable_resource = models.ResourceProvidersUpdate(tags=tags)
+ api_version = "2018-09-01-preview"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.update.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(patchable_resource, 'ResourceProvidersUpdate')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('CustomRPManifest', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} # type: ignore
+
+ def list_by_resource_group(
+ self,
+ resource_group_name, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.ListByCustomRPManifest"]
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ListByCustomRPManifest or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~customproviders.models.ListByCustomRPManifest]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ListByCustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list_by_resource_group.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('ListByCustomRPManifest', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders'} # type: ignore
+
+ def list_by_subscription(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.ListByCustomRPManifest"]
+ """Gets all the custom resource providers within a subscription.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ListByCustomRPManifest or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~customproviders.models.ListByCustomRPManifest]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ListByCustomRPManifest"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list_by_subscription.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('ListByCustomRPManifest', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CustomProviders/resourceProviders'} # type: ignore
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/_operation_operations.py b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/_operation_operations.py
new file mode 100644
index 00000000000..f547b8881ff
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/operations/_operation_operations.py
@@ -0,0 +1,110 @@
+# 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 typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class OperationOperations(object):
+ """OperationOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~customproviders.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.ResourceProviderOperationList"]
+ """The list of operations provided by Microsoft CustomProviders.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~customproviders.models.ResourceProviderOperationList]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceProviderOperationList"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2018-09-01-preview"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ list.metadata = {'url': '/providers/Microsoft.CustomProviders/operations'} # type: ignore
diff --git a/src/customproviders/azext_customproviders/vendored_sdks/customproviders/py.typed b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/py.typed
new file mode 100644
index 00000000000..e5aff4f83af
--- /dev/null
+++ b/src/customproviders/azext_customproviders/vendored_sdks/customproviders/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/src/customproviders/report.md b/src/customproviders/report.md
new file mode 100644
index 00000000000..336cb79a70c
--- /dev/null
+++ b/src/customproviders/report.md
@@ -0,0 +1,172 @@
+# Azure CLI Module Creation Report
+
+## EXTENSION
+|CLI Extension|Command Groups|
+|---------|------------|
+|az customproviders|[groups](#CommandGroups)
+
+## GROUPS
+### Command groups in `az customproviders` extension
+|CLI Command Group|Group Swagger name|Commands|
+|---------|------------|--------|
+|az customproviders custom-resource-provider|CustomResourceProvider|[commands](#CommandsInCustomResourceProvider)|
+|az customproviders association|Associations|[commands](#CommandsInAssociations)|
+
+## COMMANDS
+### Commands in `az customproviders association` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az customproviders association show](#AssociationsGet)|Get|[Parameters](#ParametersAssociationsGet)|[Example](#ExamplesAssociationsGet)|
+|[az customproviders association create](#AssociationsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersAssociationsCreateOrUpdate#Create)|[Example](#ExamplesAssociationsCreateOrUpdate#Create)|
+|[az customproviders association update](#AssociationsCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersAssociationsCreateOrUpdate#Update)|Not Found|
+|[az customproviders association delete](#AssociationsDelete)|Delete|[Parameters](#ParametersAssociationsDelete)|[Example](#ExamplesAssociationsDelete)|
+|[az customproviders association list-all](#AssociationsListAll)|ListAll|[Parameters](#ParametersAssociationsListAll)|[Example](#ExamplesAssociationsListAll)|
+
+### Commands in `az customproviders custom-resource-provider` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az customproviders custom-resource-provider list](#CustomResourceProviderListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersCustomResourceProviderListByResourceGroup)|[Example](#ExamplesCustomResourceProviderListByResourceGroup)|
+|[az customproviders custom-resource-provider list](#CustomResourceProviderListBySubscription)|ListBySubscription|[Parameters](#ParametersCustomResourceProviderListBySubscription)|[Example](#ExamplesCustomResourceProviderListBySubscription)|
+|[az customproviders custom-resource-provider show](#CustomResourceProviderGet)|Get|[Parameters](#ParametersCustomResourceProviderGet)|[Example](#ExamplesCustomResourceProviderGet)|
+|[az customproviders custom-resource-provider create](#CustomResourceProviderCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersCustomResourceProviderCreateOrUpdate#Create)|[Example](#ExamplesCustomResourceProviderCreateOrUpdate#Create)|
+|[az customproviders custom-resource-provider update](#CustomResourceProviderUpdate)|Update|[Parameters](#ParametersCustomResourceProviderUpdate)|[Example](#ExamplesCustomResourceProviderUpdate)|
+|[az customproviders custom-resource-provider delete](#CustomResourceProviderDelete)|Delete|[Parameters](#ParametersCustomResourceProviderDelete)|[Example](#ExamplesCustomResourceProviderDelete)|
+
+
+## COMMAND DETAILS
+
+### group `az customproviders association`
+#### Command `az customproviders association show`
+
+##### Example
+```
+az customproviders association show --name "associationName" --scope "scope"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope of the association.|scope|scope|
+|**--association-name**|string|The name of the association.|association_name|associationName|
+
+#### Command `az customproviders association create`
+
+##### Example
+```
+az customproviders association create --target-resource-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourc\
+eGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" --name "associationName" --scope "scope"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope of the association. The scope can be any valid REST resource instance. For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.|scope|scope|
+|**--association-name**|string|The name of the association.|association_name|associationName|
+|**--target-resource-id**|string|The REST resource instance of the target resource for this association.|target_resource_id|targetResourceId|
+
+#### Command `az customproviders association update`
+
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope of the association. The scope can be any valid REST resource instance. For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.|scope|scope|
+|**--association-name**|string|The name of the association.|association_name|associationName|
+|**--target-resource-id**|string|The REST resource instance of the target resource for this association.|target_resource_id|targetResourceId|
+
+#### Command `az customproviders association delete`
+
+##### Example
+```
+az customproviders association delete --name "associationName" --scope "scope"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope of the association.|scope|scope|
+|**--association-name**|string|The name of the association.|association_name|associationName|
+
+#### Command `az customproviders association list-all`
+
+##### Example
+```
+az customproviders association list-all --scope "scope"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope of the association.|scope|scope|
+
+### group `az customproviders custom-resource-provider`
+#### Command `az customproviders custom-resource-provider list`
+
+##### Example
+```
+az customproviders custom-resource-provider list --resource-group "testRG"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName|
+
+#### Command `az customproviders custom-resource-provider list`
+
+##### Example
+```
+az customproviders custom-resource-provider list
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+#### Command `az customproviders custom-resource-provider show`
+
+##### Example
+```
+az customproviders custom-resource-provider show --resource-group "testRG" --resource-provider-name "newrp"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName|
+|**--resource-provider-name**|string|The name of the resource provider.|resource_provider_name|resourceProviderName|
+
+#### Command `az customproviders custom-resource-provider create`
+
+##### Example
+```
+az customproviders custom-resource-provider create --resource-group "testRG" --location "eastus" --actions \
+name="TestAction" endpoint="https://mytestendpoint/" routing-type="Proxy" --resource-types name="TestResource" \
+endpoint="https://mytestendpoint2/" routing-type="Proxy,Cache" --resource-provider-name "newrp"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName|
+|**--resource-provider-name**|string|The name of the resource provider.|resource_provider_name|resourceProviderName|
+|**--location**|string|Resource location|location|location|
+|**--tags**|dictionary|Resource tags|tags|tags|
+|**--actions**|array|A list of actions that the custom resource provider implements.|actions|actions|
+|**--resource-types**|array|A list of resource types that the custom resource provider implements.|resource_types|resourceTypes|
+|**--validations**|array|A list of validations to run on the custom resource provider's requests.|validations|validations|
+
+#### Command `az customproviders custom-resource-provider update`
+
+##### Example
+```
+az customproviders custom-resource-provider update --resource-group "testRG" --resource-provider-name "newrp"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName|
+|**--resource-provider-name**|string|The name of the resource provider.|resource_provider_name|resourceProviderName|
+|**--tags**|dictionary|Resource tags|tags|tags|
+
+#### Command `az customproviders custom-resource-provider delete`
+
+##### Example
+```
+az customproviders custom-resource-provider delete --resource-group "testRG" --resource-provider-name "newrp"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--resource-group-name**|string|The name of the resource group.|resource_group_name|resourceGroupName|
+|**--resource-provider-name**|string|The name of the resource provider.|resource_provider_name|resourceProviderName|
diff --git a/src/customproviders/setup.cfg b/src/customproviders/setup.cfg
new file mode 100644
index 00000000000..2fdd96e5d39
--- /dev/null
+++ b/src/customproviders/setup.cfg
@@ -0,0 +1 @@
+#setup.cfg
\ No newline at end of file
diff --git a/src/customproviders/setup.py b/src/customproviders/setup.py
new file mode 100644
index 00000000000..a7ad774cf48
--- /dev/null
+++ b/src/customproviders/setup.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+
+from codecs import open
+from setuptools import setup, find_packages
+
+# HISTORY.rst entry.
+VERSION = '0.1.0'
+try:
+ from azext_customproviders.manual.version import VERSION
+except ImportError:
+ pass
+
+# The full list of classifiers is available at
+# https://pypi.python.org/pypi?%3Aaction=list_classifiers
+CLASSIFIERS = [
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: System Administrators',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'License :: OSI Approved :: MIT License',
+]
+
+DEPENDENCIES = []
+
+try:
+ from azext_customproviders.manual.dependency import DEPENDENCIES
+except ImportError:
+ pass
+
+with open('README.md', 'r', encoding='utf-8') as f:
+ README = f.read()
+with open('HISTORY.rst', 'r', encoding='utf-8') as f:
+ HISTORY = f.read()
+
+setup(
+ name='customproviders',
+ version=VERSION,
+ description='Microsoft Azure Command-Line Tools Customproviders Extension',
+ author='Microsoft Corporation',
+ author_email='azpycli@microsoft.com',
+ url='https://github.com/Azure/azure-cli-extensions/tree/master/src/customproviders',
+ long_description=README + '\n\n' + HISTORY,
+ license='MIT',
+ classifiers=CLASSIFIERS,
+ packages=find_packages(),
+ install_requires=DEPENDENCIES,
+ package_data={'azext_customproviders': ['azext_metadata.json']},
+)