From ce1302c4cd8d8348700666585d473e0df5dcb9e5 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 24 Mar 2022 08:04:50 +0000 Subject: [PATCH] CodeGen from PR 18389 in Azure/azure-rest-api-specs Merge 8697f1ce58d423ad40f7fe82e06a6be37a6d8cfd into bc29e38e84a67ea7318887dea85b28b1a243f1d6 --- .../azure-mgmt-providerhub/CHANGELOG.md | 5 + .../azure-mgmt-providerhub/LICENSE | 21 + .../azure-mgmt-providerhub/MANIFEST.in | 6 + .../azure-mgmt-providerhub/README.md | 30 + .../azure-mgmt-providerhub/_meta.json | 11 + .../azure-mgmt-providerhub/azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../azure/mgmt/providerhub/__init__.py | 18 + .../azure/mgmt/providerhub/_configuration.py | 68 + .../azure/mgmt/providerhub/_metadata.json | 138 + .../azure/mgmt/providerhub/_patch.py | 31 + .../azure/mgmt/providerhub/_provider_hub.py | 114 + .../azure/mgmt/providerhub/_vendor.py | 27 + .../azure/mgmt/providerhub/_version.py | 9 + .../azure/mgmt/providerhub/aio/__init__.py | 15 + .../mgmt/providerhub/aio/_configuration.py | 67 + .../azure/mgmt/providerhub/aio/_patch.py | 31 + .../mgmt/providerhub/aio/_provider_hub.py | 111 + .../providerhub/aio/operations/__init__.py | 27 + .../operations/_custom_rollouts_operations.py | 230 + .../_default_rollouts_operations.py | 388 + .../_notification_registrations_operations.py | 279 + .../providerhub/aio/operations/_operations.py | 260 + .../operations/_provider_hub_operations.py | 130 + .../_provider_registrations_operations.py | 368 + ..._resource_type_registrations_operations.py | 342 + .../aio/operations/_skus_operations.py | 1141 +++ .../azure/mgmt/providerhub/models/__init__.py | 359 + .../mgmt/providerhub/models/_models_py3.py | 6419 +++++++++++++++++ .../providerhub/models/_provider_hub_enums.py | 282 + .../mgmt/providerhub/operations/__init__.py | 27 + .../operations/_custom_rollouts_operations.py | 344 + .../_default_rollouts_operations.py | 572 ++ .../_notification_registrations_operations.py | 428 ++ .../providerhub/operations/_operations.py | 389 + .../operations/_provider_hub_operations.py | 208 + .../_provider_registrations_operations.py | 542 ++ ..._resource_type_registrations_operations.py | 490 ++ .../operations/_skus_operations.py | 1811 +++++ .../azure/mgmt/providerhub/py.typed | 1 + .../azure-mgmt-providerhub/sdk_packaging.toml | 9 + .../azure-mgmt-providerhub/setup.py | 74 + sdk/providerhub/ci.yml | 33 + 43 files changed, 15857 insertions(+) create mode 100644 sdk/providerhub/azure-mgmt-providerhub/CHANGELOG.md create mode 100644 sdk/providerhub/azure-mgmt-providerhub/LICENSE create mode 100644 sdk/providerhub/azure-mgmt-providerhub/MANIFEST.in create mode 100644 sdk/providerhub/azure-mgmt-providerhub/README.md create mode 100644 sdk/providerhub/azure-mgmt-providerhub/_meta.json create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/__init__.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/__init__.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/__init__.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_configuration.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_metadata.json create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_patch.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_provider_hub.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_vendor.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_version.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/__init__.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_configuration.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_patch.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_provider_hub.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/__init__.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_custom_rollouts_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_default_rollouts_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_notification_registrations_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_provider_hub_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_provider_registrations_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_resource_type_registrations_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_skus_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/__init__.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/_models_py3.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/_provider_hub_enums.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/__init__.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_custom_rollouts_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_default_rollouts_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_notification_registrations_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_provider_hub_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_provider_registrations_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_resource_type_registrations_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_skus_operations.py create mode 100644 sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/py.typed create mode 100644 sdk/providerhub/azure-mgmt-providerhub/sdk_packaging.toml create mode 100644 sdk/providerhub/azure-mgmt-providerhub/setup.py create mode 100644 sdk/providerhub/ci.yml diff --git a/sdk/providerhub/azure-mgmt-providerhub/CHANGELOG.md b/sdk/providerhub/azure-mgmt-providerhub/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/providerhub/azure-mgmt-providerhub/LICENSE b/sdk/providerhub/azure-mgmt-providerhub/LICENSE new file mode 100644 index 000000000000..b2f52a2bad4e --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/providerhub/azure-mgmt-providerhub/MANIFEST.in b/sdk/providerhub/azure-mgmt-providerhub/MANIFEST.in new file mode 100644 index 000000000000..2c31e8da0cb1 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py +include LICENSE diff --git a/sdk/providerhub/azure-mgmt-providerhub/README.md b/sdk/providerhub/azure-mgmt-providerhub/README.md new file mode 100644 index 000000000000..d58debff7177 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/README.md @@ -0,0 +1,30 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 3.6+. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + +## _Disclaimer_ + +_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-providerhub%2FREADME.png) diff --git a/sdk/providerhub/azure-mgmt-providerhub/_meta.json b/sdk/providerhub/azure-mgmt-providerhub/_meta.json new file mode 100644 index 000000000000..3f14f54080fa --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.7.2", + "use": [ + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" + ], + "commit": "e0249c9945c29948111754f800eaa88f46a79254", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/providerhub/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "readme": "specification/providerhub/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/__init__.py b/sdk/providerhub/azure-mgmt-providerhub/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/__init__.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/__init__.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/__init__.py new file mode 100644 index 000000000000..4a261a49123d --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._provider_hub import ProviderHub +from ._version import VERSION + +__version__ = VERSION +__all__ = ['ProviderHub'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_configuration.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_configuration.py new file mode 100644 index 000000000000..a178b104ae6e --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_configuration.py @@ -0,0 +1,68 @@ +# 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 ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class ProviderHubConfiguration(Configuration): + """Configuration for ProviderHub. + + 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 ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ProviderHubConfiguration, self).__init__(**kwargs) + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-11-20" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-providerhub/{}'.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 = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_metadata.json b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_metadata.json new file mode 100644 index 000000000000..79bab39d0b34 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_metadata.json @@ -0,0 +1,138 @@ +{ + "chosen_version": "2020-11-20", + "total_api_version_list": ["2020-11-20"], + "client": { + "name": "ProviderHub", + "filename": "_provider_hub", + "description": "Microsoft ProviderHub.", + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ProviderHubConfiguration\"], \"._operations_mixin\": [\"ProviderHubOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ProviderHubConfiguration\"], \"._operations_mixin\": [\"ProviderHubOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "custom_rollouts": "CustomRolloutsOperations", + "default_rollouts": "DefaultRolloutsOperations", + "notification_registrations": "NotificationRegistrationsOperations", + "operations": "Operations", + "provider_registrations": "ProviderRegistrationsOperations", + "resource_type_registrations": "ResourceTypeRegistrationsOperations", + "skus": "SkusOperations" + }, + "operation_mixins": { + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "operations": { + "generate_manifest" : { + "sync": { + "signature": "def generate_manifest(\n self,\n provider_namespace, # type: str\n **kwargs # type: Any\n):\n # type: (...) -\u003e \"_models.ResourceProviderManifest\"\n", + "doc": "\"\"\"Generates the manifest for the given provider.\n\n:param provider_namespace: The name of the resource provider hosted within ProviderHub.\n:type provider_namespace: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceProviderManifest, or the result of cls(response)\n:rtype: ~azure.mgmt.providerhub.models.ResourceProviderManifest\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def generate_manifest(\n self,\n provider_namespace: str,\n **kwargs: Any\n) -\u003e \"_models.ResourceProviderManifest\":\n", + "doc": "\"\"\"Generates the manifest for the given provider.\n\n:param provider_namespace: The name of the resource provider hosted within ProviderHub.\n:type provider_namespace: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceProviderManifest, or the result of cls(response)\n:rtype: ~azure.mgmt.providerhub.models.ResourceProviderManifest\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "provider_namespace" + }, + "checkin_manifest" : { + "sync": { + "signature": "def checkin_manifest(\n self,\n provider_namespace, # type: str\n checkin_manifest_params, # type: \"_models.CheckinManifestParams\"\n **kwargs # type: Any\n):\n # type: (...) -\u003e \"_models.CheckinManifestInfo\"\n", + "doc": "\"\"\"Checkin the manifest.\n\n:param provider_namespace: The name of the resource provider hosted within ProviderHub.\n:type provider_namespace: str\n:param checkin_manifest_params: The required body parameters supplied to the checkin manifest\n operation.\n:type checkin_manifest_params: ~azure.mgmt.providerhub.models.CheckinManifestParams\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CheckinManifestInfo, or the result of cls(response)\n:rtype: ~azure.mgmt.providerhub.models.CheckinManifestInfo\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def checkin_manifest(\n self,\n provider_namespace: str,\n checkin_manifest_params: \"_models.CheckinManifestParams\",\n **kwargs: Any\n) -\u003e \"_models.CheckinManifestInfo\":\n", + "doc": "\"\"\"Checkin the manifest.\n\n:param provider_namespace: The name of the resource provider hosted within ProviderHub.\n:type provider_namespace: str\n:param checkin_manifest_params: The required body parameters supplied to the checkin manifest\n operation.\n:type checkin_manifest_params: ~azure.mgmt.providerhub.models.CheckinManifestParams\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: CheckinManifestInfo, or the result of cls(response)\n:rtype: ~azure.mgmt.providerhub.models.CheckinManifestInfo\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "provider_namespace, checkin_manifest_params" + } + } + } +} \ No newline at end of file diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_patch.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_provider_hub.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_provider_hub.py new file mode 100644 index 000000000000..c7b3ebf629cc --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_provider_hub.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. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +from . import models +from ._configuration import ProviderHubConfiguration +from .operations import CustomRolloutsOperations, DefaultRolloutsOperations, NotificationRegistrationsOperations, Operations, ProviderHubOperationsMixin, ProviderRegistrationsOperations, ResourceTypeRegistrationsOperations, SkusOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +class ProviderHub(ProviderHubOperationsMixin): + """Microsoft ProviderHub. + + :ivar custom_rollouts: CustomRolloutsOperations operations + :vartype custom_rollouts: azure.mgmt.providerhub.operations.CustomRolloutsOperations + :ivar default_rollouts: DefaultRolloutsOperations operations + :vartype default_rollouts: azure.mgmt.providerhub.operations.DefaultRolloutsOperations + :ivar notification_registrations: NotificationRegistrationsOperations operations + :vartype notification_registrations: + azure.mgmt.providerhub.operations.NotificationRegistrationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.providerhub.operations.Operations + :ivar provider_registrations: ProviderRegistrationsOperations operations + :vartype provider_registrations: + azure.mgmt.providerhub.operations.ProviderRegistrationsOperations + :ivar resource_type_registrations: ResourceTypeRegistrationsOperations operations + :vartype resource_type_registrations: + azure.mgmt.providerhub.operations.ResourceTypeRegistrationsOperations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.providerhub.operations.SkusOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ProviderHubConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.custom_rollouts = CustomRolloutsOperations(self._client, self._config, self._serialize, self._deserialize) + self.default_rollouts = DefaultRolloutsOperations(self._client, self._config, self._serialize, self._deserialize) + self.notification_registrations = NotificationRegistrationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.provider_registrations = ProviderRegistrationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.resource_type_registrations = ResourceTypeRegistrationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: Any + ) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ProviderHub + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_vendor.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_version.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_version.py new file mode 100644 index 000000000000..3273a861e01e --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2020-11-20T00:00:00.000Z" diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/__init__.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/__init__.py new file mode 100644 index 000000000000..b53b3d0293a3 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/__init__.py @@ -0,0 +1,15 @@ +# 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 ._provider_hub import ProviderHub +__all__ = ['ProviderHub'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_configuration.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_configuration.py new file mode 100644 index 000000000000..e4346e3ed353 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_configuration.py @@ -0,0 +1,67 @@ +# 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, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ProviderHubConfiguration(Configuration): + """Configuration for ProviderHub. + + 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 ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(ProviderHubConfiguration, self).__init__(**kwargs) + 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.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-11-20" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-providerhub/{}'.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 = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_patch.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_provider_hub.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_provider_hub.py new file mode 100644 index 000000000000..86f73df8c634 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/_provider_hub.py @@ -0,0 +1,111 @@ +# 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 copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from .. import models +from ._configuration import ProviderHubConfiguration +from .operations import CustomRolloutsOperations, DefaultRolloutsOperations, NotificationRegistrationsOperations, Operations, ProviderHubOperationsMixin, ProviderRegistrationsOperations, ResourceTypeRegistrationsOperations, SkusOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class ProviderHub(ProviderHubOperationsMixin): + """Microsoft ProviderHub. + + :ivar custom_rollouts: CustomRolloutsOperations operations + :vartype custom_rollouts: azure.mgmt.providerhub.aio.operations.CustomRolloutsOperations + :ivar default_rollouts: DefaultRolloutsOperations operations + :vartype default_rollouts: azure.mgmt.providerhub.aio.operations.DefaultRolloutsOperations + :ivar notification_registrations: NotificationRegistrationsOperations operations + :vartype notification_registrations: + azure.mgmt.providerhub.aio.operations.NotificationRegistrationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.providerhub.aio.operations.Operations + :ivar provider_registrations: ProviderRegistrationsOperations operations + :vartype provider_registrations: + azure.mgmt.providerhub.aio.operations.ProviderRegistrationsOperations + :ivar resource_type_registrations: ResourceTypeRegistrationsOperations operations + :vartype resource_type_registrations: + azure.mgmt.providerhub.aio.operations.ResourceTypeRegistrationsOperations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.providerhub.aio.operations.SkusOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :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: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ProviderHubConfiguration(credential=credential, subscription_id=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._serialize.client_side_validation = False + self.custom_rollouts = CustomRolloutsOperations(self._client, self._config, self._serialize, self._deserialize) + self.default_rollouts = DefaultRolloutsOperations(self._client, self._config, self._serialize, self._deserialize) + self.notification_registrations = NotificationRegistrationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.provider_registrations = ProviderRegistrationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.resource_type_registrations = ResourceTypeRegistrationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ProviderHub": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/__init__.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/__init__.py new file mode 100644 index 000000000000..2b800813b102 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._custom_rollouts_operations import CustomRolloutsOperations +from ._default_rollouts_operations import DefaultRolloutsOperations +from ._provider_hub_operations import ProviderHubOperationsMixin +from ._notification_registrations_operations import NotificationRegistrationsOperations +from ._operations import Operations +from ._provider_registrations_operations import ProviderRegistrationsOperations +from ._resource_type_registrations_operations import ResourceTypeRegistrationsOperations +from ._skus_operations import SkusOperations + +__all__ = [ + 'CustomRolloutsOperations', + 'DefaultRolloutsOperations', + 'ProviderHubOperationsMixin', + 'NotificationRegistrationsOperations', + 'Operations', + 'ProviderRegistrationsOperations', + 'ResourceTypeRegistrationsOperations', + 'SkusOperations', +] diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_custom_rollouts_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_custom_rollouts_operations.py new file mode 100644 index 000000000000..20a5c4470910 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_custom_rollouts_operations.py @@ -0,0 +1,230 @@ +# 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 functools +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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._custom_rollouts_operations import build_create_or_update_request, build_get_request, build_list_by_provider_registration_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CustomRolloutsOperations: + """CustomRolloutsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace_async + async def get( + self, + provider_namespace: str, + rollout_name: str, + **kwargs: Any + ) -> "_models.CustomRollout": + """Gets the custom rollout details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomRollout, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.CustomRollout + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRollout"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomRollout', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}'} # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + provider_namespace: str, + rollout_name: str, + properties: "_models.CustomRollout", + **kwargs: Any + ) -> "_models.CustomRollout": + """Creates or updates the rollout details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :param properties: The custom rollout properties supplied to the CreateOrUpdate operation. + :type properties: ~azure.mgmt.providerhub.models.CustomRollout + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomRollout, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.CustomRollout + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRollout"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'CustomRollout') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomRollout', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}'} # type: ignore + + + @distributed_trace + def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> AsyncIterable["_models.CustomRolloutArrayResponseWithContinuation"]: + """Gets the list of the custom rollouts for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CustomRolloutArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.CustomRolloutArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRolloutArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CustomRolloutArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts'} # type: ignore diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_default_rollouts_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_default_rollouts_operations.py new file mode 100644 index 000000000000..b9f37f238eff --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_default_rollouts_operations.py @@ -0,0 +1,388 @@ +# 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 functools +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 +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._default_rollouts_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_by_provider_registration_request, build_stop_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DefaultRolloutsOperations: + """DefaultRolloutsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace_async + async def get( + self, + provider_namespace: str, + rollout_name: str, + **kwargs: Any + ) -> "_models.DefaultRollout": + """Gets the default rollout details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultRollout, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.DefaultRollout + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultRollout"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultRollout', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}'} # type: ignore + + + @distributed_trace_async + async def delete( + self, + provider_namespace: str, + rollout_name: str, + **kwargs: Any + ) -> None: + """Deletes the rollout resource. Rollout must be in terminal state. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}'} # type: ignore + + + async def _create_or_update_initial( + self, + provider_namespace: str, + rollout_name: str, + properties: "_models.DefaultRollout", + **kwargs: Any + ) -> "_models.DefaultRollout": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultRollout"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'DefaultRollout') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DefaultRollout', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DefaultRollout', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + provider_namespace: str, + rollout_name: str, + properties: "_models.DefaultRollout", + **kwargs: Any + ) -> AsyncLROPoller["_models.DefaultRollout"]: + """Creates or updates the rollout details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :param properties: The Default rollout properties supplied to the CreateOrUpdate operation. + :type properties: ~azure.mgmt.providerhub.models.DefaultRollout + :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: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a 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 DefaultRollout or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.providerhub.models.DefaultRollout] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultRollout"] + 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( + provider_namespace=provider_namespace, + rollout_name=rollout_name, + properties=properties, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DefaultRollout', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}'} # type: ignore + + @distributed_trace + def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> AsyncIterable["_models.DefaultRolloutArrayResponseWithContinuation"]: + """Gets the list of the rollouts for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DefaultRolloutArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.DefaultRolloutArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultRolloutArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DefaultRolloutArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts'} # type: ignore + + @distributed_trace_async + async def stop( + self, + provider_namespace: str, + rollout_name: str, + **kwargs: Any + ) -> None: + """Stops or cancels the rollout, if in progress. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_stop_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + template_url=self.stop.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}/stop'} # type: ignore + diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_notification_registrations_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_notification_registrations_operations.py new file mode 100644 index 000000000000..26a53f55b950 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_notification_registrations_operations.py @@ -0,0 +1,279 @@ +# 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 functools +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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._notification_registrations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_provider_registration_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NotificationRegistrationsOperations: + """NotificationRegistrationsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace_async + async def get( + self, + provider_namespace: str, + notification_registration_name: str, + **kwargs: Any + ) -> "_models.NotificationRegistration": + """Gets the notification registration details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param notification_registration_name: The notification registration. + :type notification_registration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NotificationRegistration, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.NotificationRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + notification_registration_name=notification_registration_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NotificationRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}'} # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + provider_namespace: str, + notification_registration_name: str, + properties: "_models.NotificationRegistration", + **kwargs: Any + ) -> "_models.NotificationRegistration": + """Creates or updates a notification registration. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param notification_registration_name: The notification registration. + :type notification_registration_name: str + :param properties: The required body parameters supplied to the notification registration + operation. + :type properties: ~azure.mgmt.providerhub.models.NotificationRegistration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NotificationRegistration, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.NotificationRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'NotificationRegistration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + notification_registration_name=notification_registration_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NotificationRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}'} # type: ignore + + + @distributed_trace_async + async def delete( + self, + provider_namespace: str, + notification_registration_name: str, + **kwargs: Any + ) -> None: + """Deletes a notification registration. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param notification_registration_name: The notification registration. + :type notification_registration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + notification_registration_name=notification_registration_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}'} # type: ignore + + + @distributed_trace + def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> AsyncIterable["_models.NotificationRegistrationArrayResponseWithContinuation"]: + """Gets the list of the notification registrations for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either + NotificationRegistrationArrayResponseWithContinuation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.NotificationRegistrationArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationRegistrationArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NotificationRegistrationArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations'} # type: ignore diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_operations.py new file mode 100644 index 000000000000..eb8fd7d57be3 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_operations.py @@ -0,0 +1,260 @@ +# 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 functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, 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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_create_or_update_request, build_delete_request, build_list_by_provider_registration_request, build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationsDefinitionArrayResponseWithContinuation"]: + """Lists all the operations supported by Microsoft.ProviderHub. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationsDefinitionArrayResponseWithContinuation + or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.OperationsDefinitionArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsDefinitionArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationsDefinitionArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ProviderHub/operations'} # type: ignore + + @distributed_trace_async + async def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> List["_models.OperationsDefinition"]: + """Gets the operations supported by the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of OperationsDefinition, or the result of cls(response) + :rtype: list[~azure.mgmt.providerhub.models.OperationsDefinition] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.OperationsDefinition"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[OperationsDefinition]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default'} # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + provider_namespace: str, + operations_put_content: "_models.OperationsPutContent", + **kwargs: Any + ) -> "_models.OperationsContent": + """Creates or updates the operation supported by the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param operations_put_content: The operations content properties supplied to the CreateOrUpdate + operation. + :type operations_put_content: ~azure.mgmt.providerhub.models.OperationsPutContent + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationsContent, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.OperationsContent + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsContent"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(operations_put_content, 'OperationsPutContent') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationsContent', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default'} # type: ignore + + + @distributed_trace_async + async def delete( + self, + provider_namespace: str, + **kwargs: Any + ) -> None: + """Deletes an operation. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default'} # type: ignore + diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_provider_hub_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_provider_hub_operations.py new file mode 100644 index 000000000000..049e63ec0ce4 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_provider_hub_operations.py @@ -0,0 +1,130 @@ +# 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._provider_hub_operations import build_checkin_manifest_request, build_generate_manifest_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProviderHubOperationsMixin: + + @distributed_trace_async + async def generate_manifest( + self, + provider_namespace: str, + **kwargs: Any + ) -> "_models.ResourceProviderManifest": + """Generates the manifest for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceProviderManifest, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.ResourceProviderManifest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderManifest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_generate_manifest_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.generate_manifest.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceProviderManifest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + generate_manifest.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateManifest'} # type: ignore + + + @distributed_trace_async + async def checkin_manifest( + self, + provider_namespace: str, + checkin_manifest_params: "_models.CheckinManifestParams", + **kwargs: Any + ) -> "_models.CheckinManifestInfo": + """Checkin the manifest. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param checkin_manifest_params: The required body parameters supplied to the checkin manifest + operation. + :type checkin_manifest_params: ~azure.mgmt.providerhub.models.CheckinManifestParams + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckinManifestInfo, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.CheckinManifestInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckinManifestInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(checkin_manifest_params, 'CheckinManifestParams') + + request = build_checkin_manifest_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + content_type=content_type, + json=_json, + template_url=self.checkin_manifest.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckinManifestInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + checkin_manifest.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/checkinManifest'} # type: ignore + diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_provider_registrations_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_provider_registrations_operations.py new file mode 100644 index 000000000000..8c873e56776c --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_provider_registrations_operations.py @@ -0,0 +1,368 @@ +# 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 functools +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 +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._provider_registrations_operations import build_create_or_update_request_initial, build_delete_request, build_generate_operations_request, build_get_request, build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProviderRegistrationsOperations: + """ProviderRegistrationsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace_async + async def get( + self, + provider_namespace: str, + **kwargs: Any + ) -> "_models.ProviderRegistration": + """Gets the provider registration details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProviderRegistration, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.ProviderRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProviderRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProviderRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}'} # type: ignore + + + async def _create_or_update_initial( + self, + provider_namespace: str, + properties: "_models.ProviderRegistration", + **kwargs: Any + ) -> Optional["_models.ProviderRegistration"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProviderRegistration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'ProviderRegistration') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + provider_namespace: str, + properties: "_models.ProviderRegistration", + **kwargs: Any + ) -> AsyncLROPoller["_models.ProviderRegistration"]: + """Creates or updates the provider registration. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param properties: The provider registration properties supplied to the CreateOrUpdate + operation. + :type properties: ~azure.mgmt.providerhub.models.ProviderRegistration + :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: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a 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 ProviderRegistration or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.providerhub.models.ProviderRegistration] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProviderRegistration"] + 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( + provider_namespace=provider_namespace, + properties=properties, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ProviderRegistration', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}'} # type: ignore + + @distributed_trace_async + async def delete( + self, + provider_namespace: str, + **kwargs: Any + ) -> None: + """Deletes a provider registration. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}'} # type: ignore + + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.ProviderRegistrationArrayResponseWithContinuation"]: + """Gets the list of the provider registrations in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProviderRegistrationArrayResponseWithContinuation + or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.ProviderRegistrationArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProviderRegistrationArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ProviderRegistrationArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations'} # type: ignore + + @distributed_trace_async + async def generate_operations( + self, + provider_namespace: str, + **kwargs: Any + ) -> List["_models.OperationsDefinition"]: + """Generates the operations api for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of OperationsDefinition, or the result of cls(response) + :rtype: list[~azure.mgmt.providerhub.models.OperationsDefinition] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.OperationsDefinition"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_generate_operations_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.generate_operations.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[OperationsDefinition]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + generate_operations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateOperations'} # type: ignore + diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_resource_type_registrations_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_resource_type_registrations_operations.py new file mode 100644 index 000000000000..15349810aa2e --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_resource_type_registrations_operations.py @@ -0,0 +1,342 @@ +# 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 functools +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 +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._resource_type_registrations_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_by_provider_registration_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourceTypeRegistrationsOperations: + """ResourceTypeRegistrationsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace_async + async def get( + self, + provider_namespace: str, + resource_type: str, + **kwargs: Any + ) -> "_models.ResourceTypeRegistration": + """Gets a resource type details in the given subscription and provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceTypeRegistration, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.ResourceTypeRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceTypeRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceTypeRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}'} # type: ignore + + + async def _create_or_update_initial( + self, + provider_namespace: str, + resource_type: str, + properties: "_models.ResourceTypeRegistration", + **kwargs: Any + ) -> "_models.ResourceTypeRegistration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceTypeRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'ResourceTypeRegistration') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ResourceTypeRegistration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ResourceTypeRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + provider_namespace: str, + resource_type: str, + properties: "_models.ResourceTypeRegistration", + **kwargs: Any + ) -> AsyncLROPoller["_models.ResourceTypeRegistration"]: + """Creates or updates a resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param properties: The required request body parameters supplied to the resource type + registration CreateOrUpdate operation. + :type properties: ~azure.mgmt.providerhub.models.ResourceTypeRegistration + :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: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a 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 ResourceTypeRegistration or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceTypeRegistration"] + 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( + provider_namespace=provider_namespace, + resource_type=resource_type, + properties=properties, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ResourceTypeRegistration', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}'} # type: ignore + + @distributed_trace_async + async def delete( + self, + provider_namespace: str, + resource_type: str, + **kwargs: Any + ) -> None: + """Deletes a resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}'} # type: ignore + + + @distributed_trace + def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceTypeRegistrationArrayResponseWithContinuation"]: + """Gets the list of the resource types for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either + ResourceTypeRegistrationArrayResponseWithContinuation or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.ResourceTypeRegistrationArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceTypeRegistrationArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ResourceTypeRegistrationArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations'} # type: ignore diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_skus_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_skus_operations.py new file mode 100644 index 000000000000..8eea9faf6ac7 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/aio/operations/_skus_operations.py @@ -0,0 +1,1141 @@ +# 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 functools +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 +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._skus_operations import build_create_or_update_nested_resource_type_first_request, build_create_or_update_nested_resource_type_second_request, build_create_or_update_nested_resource_type_third_request, build_create_or_update_request, build_delete_nested_resource_type_first_request, build_delete_nested_resource_type_second_request, build_delete_nested_resource_type_third_request, build_delete_request, build_get_nested_resource_type_first_request, build_get_nested_resource_type_second_request, build_get_nested_resource_type_third_request, build_get_request, build_list_by_resource_type_registrations_nested_resource_type_first_request, build_list_by_resource_type_registrations_nested_resource_type_second_request, build_list_by_resource_type_registrations_nested_resource_type_third_request, build_list_by_resource_type_registrations_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SkusOperations: + """SkusOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace_async + async def get( + self, + provider_namespace: str, + resource_type: str, + sku: str, + **kwargs: Any + ) -> "_models.SkuResource": + """Gets the sku details for the given resource type and sku name. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + sku=sku, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + provider_namespace: str, + resource_type: str, + sku: str, + properties: "_models.SkuResource", + **kwargs: Any + ) -> "_models.SkuResource": + """Creates or updates the resource type skus in the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param sku: The SKU. + :type sku: str + :param properties: The required body parameters supplied to the resource sku operation. + :type properties: ~azure.mgmt.providerhub.models.SkuResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'SkuResource') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + sku=sku, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def delete( + self, + provider_namespace: str, + resource_type: str, + sku: str, + **kwargs: Any + ) -> None: + """Deletes a resource type sku. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + sku=sku, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def get_nested_resource_type_first( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + sku: str, + **kwargs: Any + ) -> "_models.SkuResource": + """Gets the sku details for the given resource type and sku name. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + sku=sku, + template_url=self.get_nested_resource_type_first.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_nested_resource_type_first.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def create_or_update_nested_resource_type_first( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + sku: str, + properties: "_models.SkuResource", + **kwargs: Any + ) -> "_models.SkuResource": + """Creates or updates the resource type skus in the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param sku: The SKU. + :type sku: str + :param properties: The required body parameters supplied to the resource sku operation. + :type properties: ~azure.mgmt.providerhub.models.SkuResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'SkuResource') + + request = build_create_or_update_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + sku=sku, + content_type=content_type, + json=_json, + template_url=self.create_or_update_nested_resource_type_first.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update_nested_resource_type_first.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def delete_nested_resource_type_first( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + sku: str, + **kwargs: Any + ) -> None: + """Deletes a resource type sku. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + sku=sku, + template_url=self.delete_nested_resource_type_first.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_nested_resource_type_first.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def get_nested_resource_type_second( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + sku: str, + **kwargs: Any + ) -> "_models.SkuResource": + """Gets the sku details for the given resource type and sku name. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + sku=sku, + template_url=self.get_nested_resource_type_second.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_nested_resource_type_second.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def create_or_update_nested_resource_type_second( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + sku: str, + properties: "_models.SkuResource", + **kwargs: Any + ) -> "_models.SkuResource": + """Creates or updates the resource type skus in the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param sku: The SKU. + :type sku: str + :param properties: The required body parameters supplied to the resource sku operation. + :type properties: ~azure.mgmt.providerhub.models.SkuResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'SkuResource') + + request = build_create_or_update_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + sku=sku, + content_type=content_type, + json=_json, + template_url=self.create_or_update_nested_resource_type_second.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update_nested_resource_type_second.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def delete_nested_resource_type_second( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + sku: str, + **kwargs: Any + ) -> None: + """Deletes a resource type sku. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + sku=sku, + template_url=self.delete_nested_resource_type_second.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_nested_resource_type_second.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def get_nested_resource_type_third( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + sku: str, + **kwargs: Any + ) -> "_models.SkuResource": + """Gets the sku details for the given resource type and sku name. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param nested_resource_type_third: The third child resource type. + :type nested_resource_type_third: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + sku=sku, + template_url=self.get_nested_resource_type_third.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_nested_resource_type_third.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def create_or_update_nested_resource_type_third( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + sku: str, + properties: "_models.SkuResource", + **kwargs: Any + ) -> "_models.SkuResource": + """Creates or updates the resource type skus in the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param nested_resource_type_third: The third child resource type. + :type nested_resource_type_third: str + :param sku: The SKU. + :type sku: str + :param properties: The required body parameters supplied to the resource sku operation. + :type properties: ~azure.mgmt.providerhub.models.SkuResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'SkuResource') + + request = build_create_or_update_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + sku=sku, + content_type=content_type, + json=_json, + template_url=self.create_or_update_nested_resource_type_third.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update_nested_resource_type_third.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}'} # type: ignore + + + @distributed_trace_async + async def delete_nested_resource_type_third( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + sku: str, + **kwargs: Any + ) -> None: + """Deletes a resource type sku. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param nested_resource_type_third: The third child resource type. + :type nested_resource_type_third: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + sku=sku, + template_url=self.delete_nested_resource_type_third.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_nested_resource_type_third.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}'} # type: ignore + + + @distributed_trace + def list_by_resource_type_registrations( + self, + provider_namespace: str, + resource_type: str, + **kwargs: Any + ) -> AsyncIterable["_models.SkuResourceArrayResponseWithContinuation"]: + """Gets the list of skus for the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuResourceArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.SkuResourceArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_type_registrations_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + template_url=self.list_by_resource_type_registrations.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_type_registrations_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SkuResourceArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_type_registrations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus'} # type: ignore + + @distributed_trace + def list_by_resource_type_registrations_nested_resource_type_first( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + **kwargs: Any + ) -> AsyncIterable["_models.SkuResourceArrayResponseWithContinuation"]: + """Gets the list of skus for the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuResourceArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.SkuResourceArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_type_registrations_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + template_url=self.list_by_resource_type_registrations_nested_resource_type_first.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_type_registrations_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SkuResourceArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_type_registrations_nested_resource_type_first.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus'} # type: ignore + + @distributed_trace + def list_by_resource_type_registrations_nested_resource_type_second( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + **kwargs: Any + ) -> AsyncIterable["_models.SkuResourceArrayResponseWithContinuation"]: + """Gets the list of skus for the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuResourceArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.SkuResourceArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_type_registrations_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + template_url=self.list_by_resource_type_registrations_nested_resource_type_second.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_type_registrations_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SkuResourceArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_type_registrations_nested_resource_type_second.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus'} # type: ignore + + @distributed_trace + def list_by_resource_type_registrations_nested_resource_type_third( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + **kwargs: Any + ) -> AsyncIterable["_models.SkuResourceArrayResponseWithContinuation"]: + """Gets the list of skus for the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param nested_resource_type_third: The third child resource type. + :type nested_resource_type_third: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuResourceArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.providerhub.models.SkuResourceArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_type_registrations_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + template_url=self.list_by_resource_type_registrations_nested_resource_type_third.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_type_registrations_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SkuResourceArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_type_registrations_nested_resource_type_third.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus'} # type: ignore diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/__init__.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/__init__.py new file mode 100644 index 000000000000..fb5ef00917fc --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/__init__.py @@ -0,0 +1,359 @@ +# 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 ._models_py3 import AuthorizationActionMapping +from ._models_py3 import CanaryTrafficRegionRolloutConfiguration +from ._models_py3 import CheckNameAvailabilitySpecifications +from ._models_py3 import CheckinManifestInfo +from ._models_py3 import CheckinManifestParams +from ._models_py3 import CustomRollout +from ._models_py3 import CustomRolloutArrayResponseWithContinuation +from ._models_py3 import CustomRolloutProperties +from ._models_py3 import CustomRolloutPropertiesAutoGenerated +from ._models_py3 import CustomRolloutPropertiesSpecification +from ._models_py3 import CustomRolloutPropertiesStatus +from ._models_py3 import CustomRolloutSpecification +from ._models_py3 import CustomRolloutSpecificationCanary +from ._models_py3 import CustomRolloutSpecificationProviderRegistration +from ._models_py3 import CustomRolloutStatus +from ._models_py3 import DefaultRollout +from ._models_py3 import DefaultRolloutArrayResponseWithContinuation +from ._models_py3 import DefaultRolloutProperties +from ._models_py3 import DefaultRolloutPropertiesAutoGenerated +from ._models_py3 import DefaultRolloutPropertiesSpecification +from ._models_py3 import DefaultRolloutPropertiesStatus +from ._models_py3 import DefaultRolloutSpecification +from ._models_py3 import DefaultRolloutSpecificationCanary +from ._models_py3 import DefaultRolloutSpecificationHighTraffic +from ._models_py3 import DefaultRolloutSpecificationLowTraffic +from ._models_py3 import DefaultRolloutSpecificationMediumTraffic +from ._models_py3 import DefaultRolloutSpecificationProviderRegistration +from ._models_py3 import DefaultRolloutSpecificationRestOfTheWorldGroupOne +from ._models_py3 import DefaultRolloutSpecificationRestOfTheWorldGroupTwo +from ._models_py3 import DefaultRolloutStatus +from ._models_py3 import Error +from ._models_py3 import ErrorInnerError +from ._models_py3 import ErrorResponse +from ._models_py3 import ErrorResponseError +from ._models_py3 import ExtendedErrorInfo +from ._models_py3 import ExtendedLocationOptions +from ._models_py3 import ExtensionOptions +from ._models_py3 import FeaturesRule +from ._models_py3 import IdentityManagement +from ._models_py3 import IdentityManagementProperties +from ._models_py3 import InnerError +from ._models_py3 import LightHouseAuthorization +from ._models_py3 import LinkedAccessCheck +from ._models_py3 import LinkedOperationRule +from ._models_py3 import LoggingHiddenPropertyPath +from ._models_py3 import LoggingRule +from ._models_py3 import LoggingRuleHiddenPropertyPaths +from ._models_py3 import NotificationEndpoint +from ._models_py3 import NotificationRegistration +from ._models_py3 import NotificationRegistrationArrayResponseWithContinuation +from ._models_py3 import NotificationRegistrationProperties +from ._models_py3 import NotificationRegistrationPropertiesAutoGenerated +from ._models_py3 import OperationsContent +from ._models_py3 import OperationsDefinition +from ._models_py3 import OperationsDefinitionArrayResponseWithContinuation +from ._models_py3 import OperationsDefinitionDisplay +from ._models_py3 import OperationsDisplayDefinition +from ._models_py3 import OperationsPutContent +from ._models_py3 import ProviderHubMetadata +from ._models_py3 import ProviderHubMetadataProviderAuthentication +from ._models_py3 import ProviderHubMetadataThirdPartyProviderAuthorization +from ._models_py3 import ProviderRegistration +from ._models_py3 import ProviderRegistrationArrayResponseWithContinuation +from ._models_py3 import ProviderRegistrationProperties +from ._models_py3 import ProviderRegistrationPropertiesAutoGenerated +from ._models_py3 import ProviderRegistrationPropertiesProviderHubMetadata +from ._models_py3 import ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications +from ._models_py3 import ProxyResource +from ._models_py3 import ReRegisterSubscriptionMetadata +from ._models_py3 import RequestHeaderOptions +from ._models_py3 import Resource +from ._models_py3 import ResourceMovePolicy +from ._models_py3 import ResourceProviderAuthentication +from ._models_py3 import ResourceProviderAuthorization +from ._models_py3 import ResourceProviderCapabilities +from ._models_py3 import ResourceProviderEndpoint +from ._models_py3 import ResourceProviderEndpointFeaturesRule +from ._models_py3 import ResourceProviderManagement +from ._models_py3 import ResourceProviderManifest +from ._models_py3 import ResourceProviderManifestFeaturesRule +from ._models_py3 import ResourceProviderManifestManagement +from ._models_py3 import ResourceProviderManifestProperties +from ._models_py3 import ResourceProviderManifestPropertiesFeaturesRule +from ._models_py3 import ResourceProviderManifestPropertiesManagement +from ._models_py3 import ResourceProviderManifestPropertiesProviderAuthentication +from ._models_py3 import ResourceProviderManifestPropertiesRequestHeaderOptions +from ._models_py3 import ResourceProviderManifestPropertiesTemplateDeploymentOptions +from ._models_py3 import ResourceProviderManifestProviderAuthentication +from ._models_py3 import ResourceProviderManifestReRegisterSubscriptionMetadata +from ._models_py3 import ResourceProviderManifestRequestHeaderOptions +from ._models_py3 import ResourceType +from ._models_py3 import ResourceTypeEndpoint +from ._models_py3 import ResourceTypeEndpointFeaturesRule +from ._models_py3 import ResourceTypeExtension +from ._models_py3 import ResourceTypeExtensionOptions +from ._models_py3 import ResourceTypeExtensionOptionsResourceCreationBegin +from ._models_py3 import ResourceTypeFeaturesRule +from ._models_py3 import ResourceTypeIdentityManagement +from ._models_py3 import ResourceTypeRegistration +from ._models_py3 import ResourceTypeRegistrationArrayResponseWithContinuation +from ._models_py3 import ResourceTypeRegistrationProperties +from ._models_py3 import ResourceTypeRegistrationPropertiesAutoGenerated +from ._models_py3 import ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications +from ._models_py3 import ResourceTypeRegistrationPropertiesExtensionOptions +from ._models_py3 import ResourceTypeRegistrationPropertiesFeaturesRule +from ._models_py3 import ResourceTypeRegistrationPropertiesIdentityManagement +from ._models_py3 import ResourceTypeRegistrationPropertiesRequestHeaderOptions +from ._models_py3 import ResourceTypeRegistrationPropertiesResourceMovePolicy +from ._models_py3 import ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications +from ._models_py3 import ResourceTypeRegistrationPropertiesTemplateDeploymentOptions +from ._models_py3 import ResourceTypeRequestHeaderOptions +from ._models_py3 import ResourceTypeSku +from ._models_py3 import ResourceTypeTemplateDeploymentPolicy +from ._models_py3 import RolloutStatusBase +from ._models_py3 import ServiceTreeInfo +from ._models_py3 import SkuCapability +from ._models_py3 import SkuCapacity +from ._models_py3 import SkuCost +from ._models_py3 import SkuLocationInfo +from ._models_py3 import SkuResource +from ._models_py3 import SkuResourceArrayResponseWithContinuation +from ._models_py3 import SkuResourceProperties +from ._models_py3 import SkuSetting +from ._models_py3 import SkuSettingCapacity +from ._models_py3 import SkuZoneDetail +from ._models_py3 import SubscriptionLifecycleNotificationSpecifications +from ._models_py3 import SubscriptionStateOverrideAction +from ._models_py3 import SubscriptionStateRule +from ._models_py3 import SwaggerSpecification +from ._models_py3 import TemplateDeploymentOptions +from ._models_py3 import TemplateDeploymentPolicy +from ._models_py3 import ThirdPartyProviderAuthorization +from ._models_py3 import ThrottlingMetric +from ._models_py3 import ThrottlingRule +from ._models_py3 import TrafficRegionRolloutConfiguration +from ._models_py3 import TrafficRegions +from ._models_py3 import TypedErrorInfo + + +from ._provider_hub_enums import ( + ExtensionCategory, + ExtensionOptionType, + FeaturesPolicy, + IdentityManagementTypes, + LinkedAction, + LinkedOperation, + LoggingDetails, + LoggingDirections, + ManifestResourceDeletionPolicy, + MessageScope, + NotificationMode, + OperationsDefinitionActionType, + OperationsDefinitionOrigin, + OptInHeaderType, + PreflightOption, + ProvisioningState, + Regionality, + ResourceDeletionPolicy, + ResourceProviderCapabilitiesEffect, + ResourceProviderManagementResourceAccessPolicy, + ResourceProviderType, + ResourceTypeMarketplaceType, + ResourceTypeRegistrationPropertiesMarketplaceType, + ResourceValidation, + RoutingType, + SkuLocationInfoType, + SkuScaleType, + SubscriptionNotificationOperation, + SubscriptionReregistrationResult, + SubscriptionState, + SubscriptionTransitioningState, + TemplateDeploymentCapabilities, + TemplateDeploymentPreflightOptions, + ThrottlingMetricType, + TrafficRegionCategory, +) + +__all__ = [ + 'AuthorizationActionMapping', + 'CanaryTrafficRegionRolloutConfiguration', + 'CheckNameAvailabilitySpecifications', + 'CheckinManifestInfo', + 'CheckinManifestParams', + 'CustomRollout', + 'CustomRolloutArrayResponseWithContinuation', + 'CustomRolloutProperties', + 'CustomRolloutPropertiesAutoGenerated', + 'CustomRolloutPropertiesSpecification', + 'CustomRolloutPropertiesStatus', + 'CustomRolloutSpecification', + 'CustomRolloutSpecificationCanary', + 'CustomRolloutSpecificationProviderRegistration', + 'CustomRolloutStatus', + 'DefaultRollout', + 'DefaultRolloutArrayResponseWithContinuation', + 'DefaultRolloutProperties', + 'DefaultRolloutPropertiesAutoGenerated', + 'DefaultRolloutPropertiesSpecification', + 'DefaultRolloutPropertiesStatus', + 'DefaultRolloutSpecification', + 'DefaultRolloutSpecificationCanary', + 'DefaultRolloutSpecificationHighTraffic', + 'DefaultRolloutSpecificationLowTraffic', + 'DefaultRolloutSpecificationMediumTraffic', + 'DefaultRolloutSpecificationProviderRegistration', + 'DefaultRolloutSpecificationRestOfTheWorldGroupOne', + 'DefaultRolloutSpecificationRestOfTheWorldGroupTwo', + 'DefaultRolloutStatus', + 'Error', + 'ErrorInnerError', + 'ErrorResponse', + 'ErrorResponseError', + 'ExtendedErrorInfo', + 'ExtendedLocationOptions', + 'ExtensionOptions', + 'FeaturesRule', + 'IdentityManagement', + 'IdentityManagementProperties', + 'InnerError', + 'LightHouseAuthorization', + 'LinkedAccessCheck', + 'LinkedOperationRule', + 'LoggingHiddenPropertyPath', + 'LoggingRule', + 'LoggingRuleHiddenPropertyPaths', + 'NotificationEndpoint', + 'NotificationRegistration', + 'NotificationRegistrationArrayResponseWithContinuation', + 'NotificationRegistrationProperties', + 'NotificationRegistrationPropertiesAutoGenerated', + 'OperationsContent', + 'OperationsDefinition', + 'OperationsDefinitionArrayResponseWithContinuation', + 'OperationsDefinitionDisplay', + 'OperationsDisplayDefinition', + 'OperationsPutContent', + 'ProviderHubMetadata', + 'ProviderHubMetadataProviderAuthentication', + 'ProviderHubMetadataThirdPartyProviderAuthorization', + 'ProviderRegistration', + 'ProviderRegistrationArrayResponseWithContinuation', + 'ProviderRegistrationProperties', + 'ProviderRegistrationPropertiesAutoGenerated', + 'ProviderRegistrationPropertiesProviderHubMetadata', + 'ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications', + 'ProxyResource', + 'ReRegisterSubscriptionMetadata', + 'RequestHeaderOptions', + 'Resource', + 'ResourceMovePolicy', + 'ResourceProviderAuthentication', + 'ResourceProviderAuthorization', + 'ResourceProviderCapabilities', + 'ResourceProviderEndpoint', + 'ResourceProviderEndpointFeaturesRule', + 'ResourceProviderManagement', + 'ResourceProviderManifest', + 'ResourceProviderManifestFeaturesRule', + 'ResourceProviderManifestManagement', + 'ResourceProviderManifestProperties', + 'ResourceProviderManifestPropertiesFeaturesRule', + 'ResourceProviderManifestPropertiesManagement', + 'ResourceProviderManifestPropertiesProviderAuthentication', + 'ResourceProviderManifestPropertiesRequestHeaderOptions', + 'ResourceProviderManifestPropertiesTemplateDeploymentOptions', + 'ResourceProviderManifestProviderAuthentication', + 'ResourceProviderManifestReRegisterSubscriptionMetadata', + 'ResourceProviderManifestRequestHeaderOptions', + 'ResourceType', + 'ResourceTypeEndpoint', + 'ResourceTypeEndpointFeaturesRule', + 'ResourceTypeExtension', + 'ResourceTypeExtensionOptions', + 'ResourceTypeExtensionOptionsResourceCreationBegin', + 'ResourceTypeFeaturesRule', + 'ResourceTypeIdentityManagement', + 'ResourceTypeRegistration', + 'ResourceTypeRegistrationArrayResponseWithContinuation', + 'ResourceTypeRegistrationProperties', + 'ResourceTypeRegistrationPropertiesAutoGenerated', + 'ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications', + 'ResourceTypeRegistrationPropertiesExtensionOptions', + 'ResourceTypeRegistrationPropertiesFeaturesRule', + 'ResourceTypeRegistrationPropertiesIdentityManagement', + 'ResourceTypeRegistrationPropertiesRequestHeaderOptions', + 'ResourceTypeRegistrationPropertiesResourceMovePolicy', + 'ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications', + 'ResourceTypeRegistrationPropertiesTemplateDeploymentOptions', + 'ResourceTypeRequestHeaderOptions', + 'ResourceTypeSku', + 'ResourceTypeTemplateDeploymentPolicy', + 'RolloutStatusBase', + 'ServiceTreeInfo', + 'SkuCapability', + 'SkuCapacity', + 'SkuCost', + 'SkuLocationInfo', + 'SkuResource', + 'SkuResourceArrayResponseWithContinuation', + 'SkuResourceProperties', + 'SkuSetting', + 'SkuSettingCapacity', + 'SkuZoneDetail', + 'SubscriptionLifecycleNotificationSpecifications', + 'SubscriptionStateOverrideAction', + 'SubscriptionStateRule', + 'SwaggerSpecification', + 'TemplateDeploymentOptions', + 'TemplateDeploymentPolicy', + 'ThirdPartyProviderAuthorization', + 'ThrottlingMetric', + 'ThrottlingRule', + 'TrafficRegionRolloutConfiguration', + 'TrafficRegions', + 'TypedErrorInfo', + 'ExtensionCategory', + 'ExtensionOptionType', + 'FeaturesPolicy', + 'IdentityManagementTypes', + 'LinkedAction', + 'LinkedOperation', + 'LoggingDetails', + 'LoggingDirections', + 'ManifestResourceDeletionPolicy', + 'MessageScope', + 'NotificationMode', + 'OperationsDefinitionActionType', + 'OperationsDefinitionOrigin', + 'OptInHeaderType', + 'PreflightOption', + 'ProvisioningState', + 'Regionality', + 'ResourceDeletionPolicy', + 'ResourceProviderCapabilitiesEffect', + 'ResourceProviderManagementResourceAccessPolicy', + 'ResourceProviderType', + 'ResourceTypeMarketplaceType', + 'ResourceTypeRegistrationPropertiesMarketplaceType', + 'ResourceValidation', + 'RoutingType', + 'SkuLocationInfoType', + 'SkuScaleType', + 'SubscriptionNotificationOperation', + 'SubscriptionReregistrationResult', + 'SubscriptionState', + 'SubscriptionTransitioningState', + 'TemplateDeploymentCapabilities', + 'TemplateDeploymentPreflightOptions', + 'ThrottlingMetricType', + 'TrafficRegionCategory', +] diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/_models_py3.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/_models_py3.py new file mode 100644 index 000000000000..c7aeec44bfcf --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/_models_py3.py @@ -0,0 +1,6419 @@ +# 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 datetime +from typing import Any, Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._provider_hub_enums import * + + +class AuthorizationActionMapping(msrest.serialization.Model): + """AuthorizationActionMapping. + + :ivar original: + :vartype original: str + :ivar desired: + :vartype desired: str + """ + + _attribute_map = { + 'original': {'key': 'original', 'type': 'str'}, + 'desired': {'key': 'desired', 'type': 'str'}, + } + + def __init__( + self, + *, + original: Optional[str] = None, + desired: Optional[str] = None, + **kwargs + ): + """ + :keyword original: + :paramtype original: str + :keyword desired: + :paramtype desired: str + """ + super(AuthorizationActionMapping, self).__init__(**kwargs) + self.original = original + self.desired = desired + + +class CanaryTrafficRegionRolloutConfiguration(msrest.serialization.Model): + """CanaryTrafficRegionRolloutConfiguration. + + :ivar skip_regions: + :vartype skip_regions: list[str] + :ivar regions: + :vartype regions: list[str] + """ + + _attribute_map = { + 'skip_regions': {'key': 'skipRegions', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[str]'}, + } + + def __init__( + self, + *, + skip_regions: Optional[List[str]] = None, + regions: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword skip_regions: + :paramtype skip_regions: list[str] + :keyword regions: + :paramtype regions: list[str] + """ + super(CanaryTrafficRegionRolloutConfiguration, self).__init__(**kwargs) + self.skip_regions = skip_regions + self.regions = regions + + +class CheckinManifestInfo(msrest.serialization.Model): + """CheckinManifestInfo. + + All required parameters must be populated in order to send to Azure. + + :ivar is_checked_in: Required. + :vartype is_checked_in: bool + :ivar status_message: Required. + :vartype status_message: str + :ivar pull_request: + :vartype pull_request: str + :ivar commit_id: + :vartype commit_id: str + """ + + _validation = { + 'is_checked_in': {'required': True}, + 'status_message': {'required': True}, + } + + _attribute_map = { + 'is_checked_in': {'key': 'isCheckedIn', 'type': 'bool'}, + 'status_message': {'key': 'statusMessage', 'type': 'str'}, + 'pull_request': {'key': 'pullRequest', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + } + + def __init__( + self, + *, + is_checked_in: bool, + status_message: str, + pull_request: Optional[str] = None, + commit_id: Optional[str] = None, + **kwargs + ): + """ + :keyword is_checked_in: Required. + :paramtype is_checked_in: bool + :keyword status_message: Required. + :paramtype status_message: str + :keyword pull_request: + :paramtype pull_request: str + :keyword commit_id: + :paramtype commit_id: str + """ + super(CheckinManifestInfo, self).__init__(**kwargs) + self.is_checked_in = is_checked_in + self.status_message = status_message + self.pull_request = pull_request + self.commit_id = commit_id + + +class CheckinManifestParams(msrest.serialization.Model): + """CheckinManifestParams. + + All required parameters must be populated in order to send to Azure. + + :ivar environment: Required. The environment supplied to the checkin manifest operation. + :vartype environment: str + :ivar baseline_arm_manifest_location: Required. The baseline ARM manifest location supplied to + the checkin manifest operation. + :vartype baseline_arm_manifest_location: str + """ + + _validation = { + 'environment': {'required': True}, + 'baseline_arm_manifest_location': {'required': True}, + } + + _attribute_map = { + 'environment': {'key': 'environment', 'type': 'str'}, + 'baseline_arm_manifest_location': {'key': 'baselineArmManifestLocation', 'type': 'str'}, + } + + def __init__( + self, + *, + environment: str, + baseline_arm_manifest_location: str, + **kwargs + ): + """ + :keyword environment: Required. The environment supplied to the checkin manifest operation. + :paramtype environment: str + :keyword baseline_arm_manifest_location: Required. The baseline ARM manifest location supplied + to the checkin manifest operation. + :paramtype baseline_arm_manifest_location: str + """ + super(CheckinManifestParams, self).__init__(**kwargs) + self.environment = environment + self.baseline_arm_manifest_location = baseline_arm_manifest_location + + +class CheckNameAvailabilitySpecifications(msrest.serialization.Model): + """CheckNameAvailabilitySpecifications. + + :ivar enable_default_validation: + :vartype enable_default_validation: bool + :ivar resource_types_with_custom_validation: + :vartype resource_types_with_custom_validation: list[str] + """ + + _attribute_map = { + 'enable_default_validation': {'key': 'enableDefaultValidation', 'type': 'bool'}, + 'resource_types_with_custom_validation': {'key': 'resourceTypesWithCustomValidation', 'type': '[str]'}, + } + + def __init__( + self, + *, + enable_default_validation: Optional[bool] = None, + resource_types_with_custom_validation: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword enable_default_validation: + :paramtype enable_default_validation: bool + :keyword resource_types_with_custom_validation: + :paramtype resource_types_with_custom_validation: list[str] + """ + super(CheckNameAvailabilitySpecifications, self).__init__(**kwargs) + self.enable_default_validation = enable_default_validation + self.resource_types_with_custom_validation = resource_types_with_custom_validation + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyResource, self).__init__(**kwargs) + + +class CustomRollout(ProxyResource): + """Rollout details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar properties: Required. Properties of the rollout. + :vartype properties: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesAutoGenerated + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CustomRolloutPropertiesAutoGenerated'}, + } + + def __init__( + self, + *, + properties: "CustomRolloutPropertiesAutoGenerated", + **kwargs + ): + """ + :keyword properties: Required. Properties of the rollout. + :paramtype properties: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesAutoGenerated + """ + super(CustomRollout, self).__init__(**kwargs) + self.properties = properties + + +class CustomRolloutArrayResponseWithContinuation(msrest.serialization.Model): + """CustomRolloutArrayResponseWithContinuation. + + :ivar value: + :vartype value: list[~azure.mgmt.providerhub.models.CustomRollout] + :ivar next_link: The URL to get to the next set of results, if there are any. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CustomRollout]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["CustomRollout"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.providerhub.models.CustomRollout] + :keyword next_link: The URL to get to the next set of results, if there are any. + :paramtype next_link: str + """ + super(CustomRolloutArrayResponseWithContinuation, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CustomRolloutProperties(msrest.serialization.Model): + """CustomRolloutProperties. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :ivar specification: Required. + :vartype specification: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesSpecification + :ivar status: + :vartype status: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesStatus + """ + + _validation = { + 'specification': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'specification': {'key': 'specification', 'type': 'CustomRolloutPropertiesSpecification'}, + 'status': {'key': 'status', 'type': 'CustomRolloutPropertiesStatus'}, + } + + def __init__( + self, + *, + specification: "CustomRolloutPropertiesSpecification", + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + status: Optional["CustomRolloutPropertiesStatus"] = None, + **kwargs + ): + """ + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :keyword specification: Required. + :paramtype specification: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesSpecification + :keyword status: + :paramtype status: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesStatus + """ + super(CustomRolloutProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.specification = specification + self.status = status + + +class CustomRolloutPropertiesAutoGenerated(CustomRolloutProperties): + """Properties of the rollout. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :ivar specification: Required. + :vartype specification: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesSpecification + :ivar status: + :vartype status: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesStatus + """ + + _validation = { + 'specification': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'specification': {'key': 'specification', 'type': 'CustomRolloutPropertiesSpecification'}, + 'status': {'key': 'status', 'type': 'CustomRolloutPropertiesStatus'}, + } + + def __init__( + self, + *, + specification: "CustomRolloutPropertiesSpecification", + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + status: Optional["CustomRolloutPropertiesStatus"] = None, + **kwargs + ): + """ + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :keyword specification: Required. + :paramtype specification: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesSpecification + :keyword status: + :paramtype status: ~azure.mgmt.providerhub.models.CustomRolloutPropertiesStatus + """ + super(CustomRolloutPropertiesAutoGenerated, self).__init__(provisioning_state=provisioning_state, specification=specification, status=status, **kwargs) + + +class CustomRolloutSpecification(msrest.serialization.Model): + """CustomRolloutSpecification. + + All required parameters must be populated in order to send to Azure. + + :ivar canary: Required. + :vartype canary: ~azure.mgmt.providerhub.models.CustomRolloutSpecificationCanary + :ivar provider_registration: + :vartype provider_registration: + ~azure.mgmt.providerhub.models.CustomRolloutSpecificationProviderRegistration + :ivar resource_type_registrations: + :vartype resource_type_registrations: + list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + """ + + _validation = { + 'canary': {'required': True}, + } + + _attribute_map = { + 'canary': {'key': 'canary', 'type': 'CustomRolloutSpecificationCanary'}, + 'provider_registration': {'key': 'providerRegistration', 'type': 'CustomRolloutSpecificationProviderRegistration'}, + 'resource_type_registrations': {'key': 'resourceTypeRegistrations', 'type': '[ResourceTypeRegistration]'}, + } + + def __init__( + self, + *, + canary: "CustomRolloutSpecificationCanary", + provider_registration: Optional["CustomRolloutSpecificationProviderRegistration"] = None, + resource_type_registrations: Optional[List["ResourceTypeRegistration"]] = None, + **kwargs + ): + """ + :keyword canary: Required. + :paramtype canary: ~azure.mgmt.providerhub.models.CustomRolloutSpecificationCanary + :keyword provider_registration: + :paramtype provider_registration: + ~azure.mgmt.providerhub.models.CustomRolloutSpecificationProviderRegistration + :keyword resource_type_registrations: + :paramtype resource_type_registrations: + list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + """ + super(CustomRolloutSpecification, self).__init__(**kwargs) + self.canary = canary + self.provider_registration = provider_registration + self.resource_type_registrations = resource_type_registrations + + +class CustomRolloutPropertiesSpecification(CustomRolloutSpecification): + """CustomRolloutPropertiesSpecification. + + All required parameters must be populated in order to send to Azure. + + :ivar canary: Required. + :vartype canary: ~azure.mgmt.providerhub.models.CustomRolloutSpecificationCanary + :ivar provider_registration: + :vartype provider_registration: + ~azure.mgmt.providerhub.models.CustomRolloutSpecificationProviderRegistration + :ivar resource_type_registrations: + :vartype resource_type_registrations: + list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + """ + + _validation = { + 'canary': {'required': True}, + } + + _attribute_map = { + 'canary': {'key': 'canary', 'type': 'CustomRolloutSpecificationCanary'}, + 'provider_registration': {'key': 'providerRegistration', 'type': 'CustomRolloutSpecificationProviderRegistration'}, + 'resource_type_registrations': {'key': 'resourceTypeRegistrations', 'type': '[ResourceTypeRegistration]'}, + } + + def __init__( + self, + *, + canary: "CustomRolloutSpecificationCanary", + provider_registration: Optional["CustomRolloutSpecificationProviderRegistration"] = None, + resource_type_registrations: Optional[List["ResourceTypeRegistration"]] = None, + **kwargs + ): + """ + :keyword canary: Required. + :paramtype canary: ~azure.mgmt.providerhub.models.CustomRolloutSpecificationCanary + :keyword provider_registration: + :paramtype provider_registration: + ~azure.mgmt.providerhub.models.CustomRolloutSpecificationProviderRegistration + :keyword resource_type_registrations: + :paramtype resource_type_registrations: + list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + """ + super(CustomRolloutPropertiesSpecification, self).__init__(canary=canary, provider_registration=provider_registration, resource_type_registrations=resource_type_registrations, **kwargs) + + +class CustomRolloutStatus(msrest.serialization.Model): + """CustomRolloutStatus. + + :ivar completed_regions: + :vartype completed_regions: list[str] + :ivar failed_or_skipped_regions: Dictionary of :code:``. + :vartype failed_or_skipped_regions: dict[str, ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + """ + + _attribute_map = { + 'completed_regions': {'key': 'completedRegions', 'type': '[str]'}, + 'failed_or_skipped_regions': {'key': 'failedOrSkippedRegions', 'type': '{ExtendedErrorInfo}'}, + } + + def __init__( + self, + *, + completed_regions: Optional[List[str]] = None, + failed_or_skipped_regions: Optional[Dict[str, "ExtendedErrorInfo"]] = None, + **kwargs + ): + """ + :keyword completed_regions: + :paramtype completed_regions: list[str] + :keyword failed_or_skipped_regions: Dictionary of :code:``. + :paramtype failed_or_skipped_regions: dict[str, + ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + """ + super(CustomRolloutStatus, self).__init__(**kwargs) + self.completed_regions = completed_regions + self.failed_or_skipped_regions = failed_or_skipped_regions + + +class CustomRolloutPropertiesStatus(CustomRolloutStatus): + """CustomRolloutPropertiesStatus. + + :ivar completed_regions: + :vartype completed_regions: list[str] + :ivar failed_or_skipped_regions: Dictionary of :code:``. + :vartype failed_or_skipped_regions: dict[str, ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + """ + + _attribute_map = { + 'completed_regions': {'key': 'completedRegions', 'type': '[str]'}, + 'failed_or_skipped_regions': {'key': 'failedOrSkippedRegions', 'type': '{ExtendedErrorInfo}'}, + } + + def __init__( + self, + *, + completed_regions: Optional[List[str]] = None, + failed_or_skipped_regions: Optional[Dict[str, "ExtendedErrorInfo"]] = None, + **kwargs + ): + """ + :keyword completed_regions: + :paramtype completed_regions: list[str] + :keyword failed_or_skipped_regions: Dictionary of :code:``. + :paramtype failed_or_skipped_regions: dict[str, + ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + """ + super(CustomRolloutPropertiesStatus, self).__init__(completed_regions=completed_regions, failed_or_skipped_regions=failed_or_skipped_regions, **kwargs) + + +class TrafficRegions(msrest.serialization.Model): + """TrafficRegions. + + :ivar regions: + :vartype regions: list[str] + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[str]'}, + } + + def __init__( + self, + *, + regions: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword regions: + :paramtype regions: list[str] + """ + super(TrafficRegions, self).__init__(**kwargs) + self.regions = regions + + +class CustomRolloutSpecificationCanary(TrafficRegions): + """CustomRolloutSpecificationCanary. + + :ivar regions: + :vartype regions: list[str] + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[str]'}, + } + + def __init__( + self, + *, + regions: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword regions: + :paramtype regions: list[str] + """ + super(CustomRolloutSpecificationCanary, self).__init__(regions=regions, **kwargs) + + +class ProviderRegistration(ProxyResource): + """ProviderRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar properties: + :vartype properties: ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesAutoGenerated + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProviderRegistrationPropertiesAutoGenerated'}, + } + + def __init__( + self, + *, + properties: Optional["ProviderRegistrationPropertiesAutoGenerated"] = None, + **kwargs + ): + """ + :keyword properties: + :paramtype properties: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesAutoGenerated + """ + super(ProviderRegistration, self).__init__(**kwargs) + self.properties = properties + + +class CustomRolloutSpecificationProviderRegistration(ProviderRegistration): + """CustomRolloutSpecificationProviderRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar properties: + :vartype properties: ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesAutoGenerated + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProviderRegistrationPropertiesAutoGenerated'}, + } + + def __init__( + self, + *, + properties: Optional["ProviderRegistrationPropertiesAutoGenerated"] = None, + **kwargs + ): + """ + :keyword properties: + :paramtype properties: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesAutoGenerated + """ + super(CustomRolloutSpecificationProviderRegistration, self).__init__(properties=properties, **kwargs) + + +class DefaultRollout(ProxyResource): + """Default rollout definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar properties: Properties of the rollout. + :vartype properties: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesAutoGenerated + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DefaultRolloutPropertiesAutoGenerated'}, + } + + def __init__( + self, + *, + properties: Optional["DefaultRolloutPropertiesAutoGenerated"] = None, + **kwargs + ): + """ + :keyword properties: Properties of the rollout. + :paramtype properties: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesAutoGenerated + """ + super(DefaultRollout, self).__init__(**kwargs) + self.properties = properties + + +class DefaultRolloutArrayResponseWithContinuation(msrest.serialization.Model): + """DefaultRolloutArrayResponseWithContinuation. + + :ivar value: + :vartype value: list[~azure.mgmt.providerhub.models.DefaultRollout] + :ivar next_link: The URL to get to the next set of results, if there are any. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DefaultRollout]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["DefaultRollout"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.providerhub.models.DefaultRollout] + :keyword next_link: The URL to get to the next set of results, if there are any. + :paramtype next_link: str + """ + super(DefaultRolloutArrayResponseWithContinuation, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DefaultRolloutProperties(msrest.serialization.Model): + """DefaultRolloutProperties. + + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :ivar specification: + :vartype specification: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesSpecification + :ivar status: + :vartype status: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesStatus + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'specification': {'key': 'specification', 'type': 'DefaultRolloutPropertiesSpecification'}, + 'status': {'key': 'status', 'type': 'DefaultRolloutPropertiesStatus'}, + } + + def __init__( + self, + *, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + specification: Optional["DefaultRolloutPropertiesSpecification"] = None, + status: Optional["DefaultRolloutPropertiesStatus"] = None, + **kwargs + ): + """ + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :keyword specification: + :paramtype specification: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesSpecification + :keyword status: + :paramtype status: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesStatus + """ + super(DefaultRolloutProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.specification = specification + self.status = status + + +class DefaultRolloutPropertiesAutoGenerated(DefaultRolloutProperties): + """Properties of the rollout. + + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :ivar specification: + :vartype specification: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesSpecification + :ivar status: + :vartype status: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesStatus + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'specification': {'key': 'specification', 'type': 'DefaultRolloutPropertiesSpecification'}, + 'status': {'key': 'status', 'type': 'DefaultRolloutPropertiesStatus'}, + } + + def __init__( + self, + *, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + specification: Optional["DefaultRolloutPropertiesSpecification"] = None, + status: Optional["DefaultRolloutPropertiesStatus"] = None, + **kwargs + ): + """ + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :keyword specification: + :paramtype specification: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesSpecification + :keyword status: + :paramtype status: ~azure.mgmt.providerhub.models.DefaultRolloutPropertiesStatus + """ + super(DefaultRolloutPropertiesAutoGenerated, self).__init__(provisioning_state=provisioning_state, specification=specification, status=status, **kwargs) + + +class DefaultRolloutSpecification(msrest.serialization.Model): + """DefaultRolloutSpecification. + + :ivar canary: + :vartype canary: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationCanary + :ivar low_traffic: + :vartype low_traffic: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationLowTraffic + :ivar medium_traffic: + :vartype medium_traffic: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationMediumTraffic + :ivar high_traffic: + :vartype high_traffic: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationHighTraffic + :ivar rest_of_the_world_group_one: + :vartype rest_of_the_world_group_one: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationRestOfTheWorldGroupOne + :ivar rest_of_the_world_group_two: + :vartype rest_of_the_world_group_two: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationRestOfTheWorldGroupTwo + :ivar provider_registration: + :vartype provider_registration: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationProviderRegistration + :ivar resource_type_registrations: + :vartype resource_type_registrations: + list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + """ + + _attribute_map = { + 'canary': {'key': 'canary', 'type': 'DefaultRolloutSpecificationCanary'}, + 'low_traffic': {'key': 'lowTraffic', 'type': 'DefaultRolloutSpecificationLowTraffic'}, + 'medium_traffic': {'key': 'mediumTraffic', 'type': 'DefaultRolloutSpecificationMediumTraffic'}, + 'high_traffic': {'key': 'highTraffic', 'type': 'DefaultRolloutSpecificationHighTraffic'}, + 'rest_of_the_world_group_one': {'key': 'restOfTheWorldGroupOne', 'type': 'DefaultRolloutSpecificationRestOfTheWorldGroupOne'}, + 'rest_of_the_world_group_two': {'key': 'restOfTheWorldGroupTwo', 'type': 'DefaultRolloutSpecificationRestOfTheWorldGroupTwo'}, + 'provider_registration': {'key': 'providerRegistration', 'type': 'DefaultRolloutSpecificationProviderRegistration'}, + 'resource_type_registrations': {'key': 'resourceTypeRegistrations', 'type': '[ResourceTypeRegistration]'}, + } + + def __init__( + self, + *, + canary: Optional["DefaultRolloutSpecificationCanary"] = None, + low_traffic: Optional["DefaultRolloutSpecificationLowTraffic"] = None, + medium_traffic: Optional["DefaultRolloutSpecificationMediumTraffic"] = None, + high_traffic: Optional["DefaultRolloutSpecificationHighTraffic"] = None, + rest_of_the_world_group_one: Optional["DefaultRolloutSpecificationRestOfTheWorldGroupOne"] = None, + rest_of_the_world_group_two: Optional["DefaultRolloutSpecificationRestOfTheWorldGroupTwo"] = None, + provider_registration: Optional["DefaultRolloutSpecificationProviderRegistration"] = None, + resource_type_registrations: Optional[List["ResourceTypeRegistration"]] = None, + **kwargs + ): + """ + :keyword canary: + :paramtype canary: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationCanary + :keyword low_traffic: + :paramtype low_traffic: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationLowTraffic + :keyword medium_traffic: + :paramtype medium_traffic: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationMediumTraffic + :keyword high_traffic: + :paramtype high_traffic: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationHighTraffic + :keyword rest_of_the_world_group_one: + :paramtype rest_of_the_world_group_one: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationRestOfTheWorldGroupOne + :keyword rest_of_the_world_group_two: + :paramtype rest_of_the_world_group_two: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationRestOfTheWorldGroupTwo + :keyword provider_registration: + :paramtype provider_registration: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationProviderRegistration + :keyword resource_type_registrations: + :paramtype resource_type_registrations: + list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + """ + super(DefaultRolloutSpecification, self).__init__(**kwargs) + self.canary = canary + self.low_traffic = low_traffic + self.medium_traffic = medium_traffic + self.high_traffic = high_traffic + self.rest_of_the_world_group_one = rest_of_the_world_group_one + self.rest_of_the_world_group_two = rest_of_the_world_group_two + self.provider_registration = provider_registration + self.resource_type_registrations = resource_type_registrations + + +class DefaultRolloutPropertiesSpecification(DefaultRolloutSpecification): + """DefaultRolloutPropertiesSpecification. + + :ivar canary: + :vartype canary: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationCanary + :ivar low_traffic: + :vartype low_traffic: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationLowTraffic + :ivar medium_traffic: + :vartype medium_traffic: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationMediumTraffic + :ivar high_traffic: + :vartype high_traffic: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationHighTraffic + :ivar rest_of_the_world_group_one: + :vartype rest_of_the_world_group_one: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationRestOfTheWorldGroupOne + :ivar rest_of_the_world_group_two: + :vartype rest_of_the_world_group_two: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationRestOfTheWorldGroupTwo + :ivar provider_registration: + :vartype provider_registration: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationProviderRegistration + :ivar resource_type_registrations: + :vartype resource_type_registrations: + list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + """ + + _attribute_map = { + 'canary': {'key': 'canary', 'type': 'DefaultRolloutSpecificationCanary'}, + 'low_traffic': {'key': 'lowTraffic', 'type': 'DefaultRolloutSpecificationLowTraffic'}, + 'medium_traffic': {'key': 'mediumTraffic', 'type': 'DefaultRolloutSpecificationMediumTraffic'}, + 'high_traffic': {'key': 'highTraffic', 'type': 'DefaultRolloutSpecificationHighTraffic'}, + 'rest_of_the_world_group_one': {'key': 'restOfTheWorldGroupOne', 'type': 'DefaultRolloutSpecificationRestOfTheWorldGroupOne'}, + 'rest_of_the_world_group_two': {'key': 'restOfTheWorldGroupTwo', 'type': 'DefaultRolloutSpecificationRestOfTheWorldGroupTwo'}, + 'provider_registration': {'key': 'providerRegistration', 'type': 'DefaultRolloutSpecificationProviderRegistration'}, + 'resource_type_registrations': {'key': 'resourceTypeRegistrations', 'type': '[ResourceTypeRegistration]'}, + } + + def __init__( + self, + *, + canary: Optional["DefaultRolloutSpecificationCanary"] = None, + low_traffic: Optional["DefaultRolloutSpecificationLowTraffic"] = None, + medium_traffic: Optional["DefaultRolloutSpecificationMediumTraffic"] = None, + high_traffic: Optional["DefaultRolloutSpecificationHighTraffic"] = None, + rest_of_the_world_group_one: Optional["DefaultRolloutSpecificationRestOfTheWorldGroupOne"] = None, + rest_of_the_world_group_two: Optional["DefaultRolloutSpecificationRestOfTheWorldGroupTwo"] = None, + provider_registration: Optional["DefaultRolloutSpecificationProviderRegistration"] = None, + resource_type_registrations: Optional[List["ResourceTypeRegistration"]] = None, + **kwargs + ): + """ + :keyword canary: + :paramtype canary: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationCanary + :keyword low_traffic: + :paramtype low_traffic: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationLowTraffic + :keyword medium_traffic: + :paramtype medium_traffic: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationMediumTraffic + :keyword high_traffic: + :paramtype high_traffic: ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationHighTraffic + :keyword rest_of_the_world_group_one: + :paramtype rest_of_the_world_group_one: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationRestOfTheWorldGroupOne + :keyword rest_of_the_world_group_two: + :paramtype rest_of_the_world_group_two: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationRestOfTheWorldGroupTwo + :keyword provider_registration: + :paramtype provider_registration: + ~azure.mgmt.providerhub.models.DefaultRolloutSpecificationProviderRegistration + :keyword resource_type_registrations: + :paramtype resource_type_registrations: + list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + """ + super(DefaultRolloutPropertiesSpecification, self).__init__(canary=canary, low_traffic=low_traffic, medium_traffic=medium_traffic, high_traffic=high_traffic, rest_of_the_world_group_one=rest_of_the_world_group_one, rest_of_the_world_group_two=rest_of_the_world_group_two, provider_registration=provider_registration, resource_type_registrations=resource_type_registrations, **kwargs) + + +class RolloutStatusBase(msrest.serialization.Model): + """RolloutStatusBase. + + :ivar completed_regions: + :vartype completed_regions: list[str] + :ivar failed_or_skipped_regions: Dictionary of :code:``. + :vartype failed_or_skipped_regions: dict[str, ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + """ + + _attribute_map = { + 'completed_regions': {'key': 'completedRegions', 'type': '[str]'}, + 'failed_or_skipped_regions': {'key': 'failedOrSkippedRegions', 'type': '{ExtendedErrorInfo}'}, + } + + def __init__( + self, + *, + completed_regions: Optional[List[str]] = None, + failed_or_skipped_regions: Optional[Dict[str, "ExtendedErrorInfo"]] = None, + **kwargs + ): + """ + :keyword completed_regions: + :paramtype completed_regions: list[str] + :keyword failed_or_skipped_regions: Dictionary of :code:``. + :paramtype failed_or_skipped_regions: dict[str, + ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + """ + super(RolloutStatusBase, self).__init__(**kwargs) + self.completed_regions = completed_regions + self.failed_or_skipped_regions = failed_or_skipped_regions + + +class DefaultRolloutStatus(RolloutStatusBase): + """DefaultRolloutStatus. + + :ivar completed_regions: + :vartype completed_regions: list[str] + :ivar failed_or_skipped_regions: Dictionary of :code:``. + :vartype failed_or_skipped_regions: dict[str, ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + :ivar next_traffic_region: Possible values include: "NotSpecified", "Canary", "LowTraffic", + "MediumTraffic", "HighTraffic", "None", "RestOfTheWorldGroupOne", "RestOfTheWorldGroupTwo". + :vartype next_traffic_region: str or ~azure.mgmt.providerhub.models.TrafficRegionCategory + :ivar next_traffic_region_scheduled_time: + :vartype next_traffic_region_scheduled_time: ~datetime.datetime + :ivar subscription_reregistration_result: Possible values include: "NotApplicable", + "ConditionalUpdate", "ForcedUpdate", "Failed". + :vartype subscription_reregistration_result: str or + ~azure.mgmt.providerhub.models.SubscriptionReregistrationResult + """ + + _attribute_map = { + 'completed_regions': {'key': 'completedRegions', 'type': '[str]'}, + 'failed_or_skipped_regions': {'key': 'failedOrSkippedRegions', 'type': '{ExtendedErrorInfo}'}, + 'next_traffic_region': {'key': 'nextTrafficRegion', 'type': 'str'}, + 'next_traffic_region_scheduled_time': {'key': 'nextTrafficRegionScheduledTime', 'type': 'iso-8601'}, + 'subscription_reregistration_result': {'key': 'subscriptionReregistrationResult', 'type': 'str'}, + } + + def __init__( + self, + *, + completed_regions: Optional[List[str]] = None, + failed_or_skipped_regions: Optional[Dict[str, "ExtendedErrorInfo"]] = None, + next_traffic_region: Optional[Union[str, "TrafficRegionCategory"]] = None, + next_traffic_region_scheduled_time: Optional[datetime.datetime] = None, + subscription_reregistration_result: Optional[Union[str, "SubscriptionReregistrationResult"]] = None, + **kwargs + ): + """ + :keyword completed_regions: + :paramtype completed_regions: list[str] + :keyword failed_or_skipped_regions: Dictionary of :code:``. + :paramtype failed_or_skipped_regions: dict[str, + ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + :keyword next_traffic_region: Possible values include: "NotSpecified", "Canary", "LowTraffic", + "MediumTraffic", "HighTraffic", "None", "RestOfTheWorldGroupOne", "RestOfTheWorldGroupTwo". + :paramtype next_traffic_region: str or ~azure.mgmt.providerhub.models.TrafficRegionCategory + :keyword next_traffic_region_scheduled_time: + :paramtype next_traffic_region_scheduled_time: ~datetime.datetime + :keyword subscription_reregistration_result: Possible values include: "NotApplicable", + "ConditionalUpdate", "ForcedUpdate", "Failed". + :paramtype subscription_reregistration_result: str or + ~azure.mgmt.providerhub.models.SubscriptionReregistrationResult + """ + super(DefaultRolloutStatus, self).__init__(completed_regions=completed_regions, failed_or_skipped_regions=failed_or_skipped_regions, **kwargs) + self.next_traffic_region = next_traffic_region + self.next_traffic_region_scheduled_time = next_traffic_region_scheduled_time + self.subscription_reregistration_result = subscription_reregistration_result + + +class DefaultRolloutPropertiesStatus(DefaultRolloutStatus): + """DefaultRolloutPropertiesStatus. + + :ivar completed_regions: + :vartype completed_regions: list[str] + :ivar failed_or_skipped_regions: Dictionary of :code:``. + :vartype failed_or_skipped_regions: dict[str, ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + :ivar next_traffic_region: Possible values include: "NotSpecified", "Canary", "LowTraffic", + "MediumTraffic", "HighTraffic", "None", "RestOfTheWorldGroupOne", "RestOfTheWorldGroupTwo". + :vartype next_traffic_region: str or ~azure.mgmt.providerhub.models.TrafficRegionCategory + :ivar next_traffic_region_scheduled_time: + :vartype next_traffic_region_scheduled_time: ~datetime.datetime + :ivar subscription_reregistration_result: Possible values include: "NotApplicable", + "ConditionalUpdate", "ForcedUpdate", "Failed". + :vartype subscription_reregistration_result: str or + ~azure.mgmt.providerhub.models.SubscriptionReregistrationResult + """ + + _attribute_map = { + 'completed_regions': {'key': 'completedRegions', 'type': '[str]'}, + 'failed_or_skipped_regions': {'key': 'failedOrSkippedRegions', 'type': '{ExtendedErrorInfo}'}, + 'next_traffic_region': {'key': 'nextTrafficRegion', 'type': 'str'}, + 'next_traffic_region_scheduled_time': {'key': 'nextTrafficRegionScheduledTime', 'type': 'iso-8601'}, + 'subscription_reregistration_result': {'key': 'subscriptionReregistrationResult', 'type': 'str'}, + } + + def __init__( + self, + *, + completed_regions: Optional[List[str]] = None, + failed_or_skipped_regions: Optional[Dict[str, "ExtendedErrorInfo"]] = None, + next_traffic_region: Optional[Union[str, "TrafficRegionCategory"]] = None, + next_traffic_region_scheduled_time: Optional[datetime.datetime] = None, + subscription_reregistration_result: Optional[Union[str, "SubscriptionReregistrationResult"]] = None, + **kwargs + ): + """ + :keyword completed_regions: + :paramtype completed_regions: list[str] + :keyword failed_or_skipped_regions: Dictionary of :code:``. + :paramtype failed_or_skipped_regions: dict[str, + ~azure.mgmt.providerhub.models.ExtendedErrorInfo] + :keyword next_traffic_region: Possible values include: "NotSpecified", "Canary", "LowTraffic", + "MediumTraffic", "HighTraffic", "None", "RestOfTheWorldGroupOne", "RestOfTheWorldGroupTwo". + :paramtype next_traffic_region: str or ~azure.mgmt.providerhub.models.TrafficRegionCategory + :keyword next_traffic_region_scheduled_time: + :paramtype next_traffic_region_scheduled_time: ~datetime.datetime + :keyword subscription_reregistration_result: Possible values include: "NotApplicable", + "ConditionalUpdate", "ForcedUpdate", "Failed". + :paramtype subscription_reregistration_result: str or + ~azure.mgmt.providerhub.models.SubscriptionReregistrationResult + """ + super(DefaultRolloutPropertiesStatus, self).__init__(completed_regions=completed_regions, failed_or_skipped_regions=failed_or_skipped_regions, next_traffic_region=next_traffic_region, next_traffic_region_scheduled_time=next_traffic_region_scheduled_time, subscription_reregistration_result=subscription_reregistration_result, **kwargs) + + +class DefaultRolloutSpecificationCanary(CanaryTrafficRegionRolloutConfiguration): + """DefaultRolloutSpecificationCanary. + + :ivar skip_regions: + :vartype skip_regions: list[str] + :ivar regions: + :vartype regions: list[str] + """ + + _attribute_map = { + 'skip_regions': {'key': 'skipRegions', 'type': '[str]'}, + 'regions': {'key': 'regions', 'type': '[str]'}, + } + + def __init__( + self, + *, + skip_regions: Optional[List[str]] = None, + regions: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword skip_regions: + :paramtype skip_regions: list[str] + :keyword regions: + :paramtype regions: list[str] + """ + super(DefaultRolloutSpecificationCanary, self).__init__(skip_regions=skip_regions, regions=regions, **kwargs) + + +class TrafficRegionRolloutConfiguration(TrafficRegions): + """TrafficRegionRolloutConfiguration. + + :ivar regions: + :vartype regions: list[str] + :ivar wait_duration: + :vartype wait_duration: ~datetime.timedelta + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[str]'}, + 'wait_duration': {'key': 'waitDuration', 'type': 'duration'}, + } + + def __init__( + self, + *, + regions: Optional[List[str]] = None, + wait_duration: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword regions: + :paramtype regions: list[str] + :keyword wait_duration: + :paramtype wait_duration: ~datetime.timedelta + """ + super(TrafficRegionRolloutConfiguration, self).__init__(regions=regions, **kwargs) + self.wait_duration = wait_duration + + +class DefaultRolloutSpecificationHighTraffic(TrafficRegionRolloutConfiguration): + """DefaultRolloutSpecificationHighTraffic. + + :ivar regions: + :vartype regions: list[str] + :ivar wait_duration: + :vartype wait_duration: ~datetime.timedelta + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[str]'}, + 'wait_duration': {'key': 'waitDuration', 'type': 'duration'}, + } + + def __init__( + self, + *, + regions: Optional[List[str]] = None, + wait_duration: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword regions: + :paramtype regions: list[str] + :keyword wait_duration: + :paramtype wait_duration: ~datetime.timedelta + """ + super(DefaultRolloutSpecificationHighTraffic, self).__init__(regions=regions, wait_duration=wait_duration, **kwargs) + + +class DefaultRolloutSpecificationLowTraffic(TrafficRegionRolloutConfiguration): + """DefaultRolloutSpecificationLowTraffic. + + :ivar regions: + :vartype regions: list[str] + :ivar wait_duration: + :vartype wait_duration: ~datetime.timedelta + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[str]'}, + 'wait_duration': {'key': 'waitDuration', 'type': 'duration'}, + } + + def __init__( + self, + *, + regions: Optional[List[str]] = None, + wait_duration: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword regions: + :paramtype regions: list[str] + :keyword wait_duration: + :paramtype wait_duration: ~datetime.timedelta + """ + super(DefaultRolloutSpecificationLowTraffic, self).__init__(regions=regions, wait_duration=wait_duration, **kwargs) + + +class DefaultRolloutSpecificationMediumTraffic(TrafficRegionRolloutConfiguration): + """DefaultRolloutSpecificationMediumTraffic. + + :ivar regions: + :vartype regions: list[str] + :ivar wait_duration: + :vartype wait_duration: ~datetime.timedelta + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[str]'}, + 'wait_duration': {'key': 'waitDuration', 'type': 'duration'}, + } + + def __init__( + self, + *, + regions: Optional[List[str]] = None, + wait_duration: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword regions: + :paramtype regions: list[str] + :keyword wait_duration: + :paramtype wait_duration: ~datetime.timedelta + """ + super(DefaultRolloutSpecificationMediumTraffic, self).__init__(regions=regions, wait_duration=wait_duration, **kwargs) + + +class DefaultRolloutSpecificationProviderRegistration(ProviderRegistration): + """DefaultRolloutSpecificationProviderRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar properties: + :vartype properties: ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesAutoGenerated + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProviderRegistrationPropertiesAutoGenerated'}, + } + + def __init__( + self, + *, + properties: Optional["ProviderRegistrationPropertiesAutoGenerated"] = None, + **kwargs + ): + """ + :keyword properties: + :paramtype properties: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesAutoGenerated + """ + super(DefaultRolloutSpecificationProviderRegistration, self).__init__(properties=properties, **kwargs) + + +class DefaultRolloutSpecificationRestOfTheWorldGroupOne(TrafficRegionRolloutConfiguration): + """DefaultRolloutSpecificationRestOfTheWorldGroupOne. + + :ivar regions: + :vartype regions: list[str] + :ivar wait_duration: + :vartype wait_duration: ~datetime.timedelta + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[str]'}, + 'wait_duration': {'key': 'waitDuration', 'type': 'duration'}, + } + + def __init__( + self, + *, + regions: Optional[List[str]] = None, + wait_duration: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword regions: + :paramtype regions: list[str] + :keyword wait_duration: + :paramtype wait_duration: ~datetime.timedelta + """ + super(DefaultRolloutSpecificationRestOfTheWorldGroupOne, self).__init__(regions=regions, wait_duration=wait_duration, **kwargs) + + +class DefaultRolloutSpecificationRestOfTheWorldGroupTwo(TrafficRegionRolloutConfiguration): + """DefaultRolloutSpecificationRestOfTheWorldGroupTwo. + + :ivar regions: + :vartype regions: list[str] + :ivar wait_duration: + :vartype wait_duration: ~datetime.timedelta + """ + + _attribute_map = { + 'regions': {'key': 'regions', 'type': '[str]'}, + 'wait_duration': {'key': 'waitDuration', 'type': 'duration'}, + } + + def __init__( + self, + *, + regions: Optional[List[str]] = None, + wait_duration: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword regions: + :paramtype regions: list[str] + :keyword wait_duration: + :paramtype wait_duration: ~datetime.timedelta + """ + super(DefaultRolloutSpecificationRestOfTheWorldGroupTwo, self).__init__(regions=regions, wait_duration=wait_duration, **kwargs) + + +class Error(msrest.serialization.Model): + """Standard error object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Server-defined set of error codes. + :vartype code: str + :ivar message: Human-readable representation of the error. + :vartype message: str + :ivar target: Target of the error. + :vartype target: str + :ivar details: Array of details about specific errors that led to this reported error. + :vartype details: list[~azure.mgmt.providerhub.models.Error] + :ivar inner_error: Object containing more specific information than the current object about + the error. + :vartype inner_error: ~azure.mgmt.providerhub.models.ErrorInnerError + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Error]'}, + 'inner_error': {'key': 'innerError', 'type': 'ErrorInnerError'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Error, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.inner_error = None + + +class InnerError(msrest.serialization.Model): + """Inner error containing list of errors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar additional_properties: Unmatched properties from the message are deserialized to this + collection. + :vartype additional_properties: dict[str, any] + :ivar code: Specific error code than was provided by the containing error. + :vartype code: str + :ivar inner_error: Object containing more specific information than the current object about + the error. + :vartype inner_error: any + """ + + _validation = { + 'code': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'code': {'key': 'code', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'object'}, + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + **kwargs + ): + """ + :keyword additional_properties: Unmatched properties from the message are deserialized to this + collection. + :paramtype additional_properties: dict[str, any] + """ + super(InnerError, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.code = None + self.inner_error = None + + +class ErrorInnerError(InnerError): + """Object containing more specific information than the current object about the error. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar additional_properties: Unmatched properties from the message are deserialized to this + collection. + :vartype additional_properties: dict[str, any] + :ivar code: Specific error code than was provided by the containing error. + :vartype code: str + :ivar inner_error: Object containing more specific information than the current object about + the error. + :vartype inner_error: any + """ + + _validation = { + 'code': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'code': {'key': 'code', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'object'}, + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + **kwargs + ): + """ + :keyword additional_properties: Unmatched properties from the message are deserialized to this + collection. + :paramtype additional_properties: dict[str, any] + """ + super(ErrorInnerError, self).__init__(additional_properties=additional_properties, **kwargs) + + +class ErrorResponse(msrest.serialization.Model): + """Standard error response. + + :ivar error: Standard error object. + :vartype error: ~azure.mgmt.providerhub.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponseError"] = None, + **kwargs + ): + """ + :keyword error: Standard error object. + :paramtype error: ~azure.mgmt.providerhub.models.ErrorResponseError + """ + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseError(Error): + """Standard error object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Server-defined set of error codes. + :vartype code: str + :ivar message: Human-readable representation of the error. + :vartype message: str + :ivar target: Target of the error. + :vartype target: str + :ivar details: Array of details about specific errors that led to this reported error. + :vartype details: list[~azure.mgmt.providerhub.models.Error] + :ivar inner_error: Object containing more specific information than the current object about + the error. + :vartype inner_error: ~azure.mgmt.providerhub.models.ErrorInnerError + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Error]'}, + 'inner_error': {'key': 'innerError', 'type': 'ErrorInnerError'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorResponseError, self).__init__(**kwargs) + + +class ExtendedErrorInfo(msrest.serialization.Model): + """ExtendedErrorInfo. + + :ivar code: + :vartype code: str + :ivar target: + :vartype target: str + :ivar message: + :vartype message: str + :ivar details: + :vartype details: list[~azure.mgmt.providerhub.models.ExtendedErrorInfo] + :ivar additional_info: + :vartype additional_info: list[~azure.mgmt.providerhub.models.TypedErrorInfo] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ExtendedErrorInfo]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[TypedErrorInfo]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + details: Optional[List["ExtendedErrorInfo"]] = None, + additional_info: Optional[List["TypedErrorInfo"]] = None, + **kwargs + ): + """ + :keyword code: + :paramtype code: str + :keyword target: + :paramtype target: str + :keyword message: + :paramtype message: str + :keyword details: + :paramtype details: list[~azure.mgmt.providerhub.models.ExtendedErrorInfo] + :keyword additional_info: + :paramtype additional_info: list[~azure.mgmt.providerhub.models.TypedErrorInfo] + """ + super(ExtendedErrorInfo, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message + self.details = details + self.additional_info = additional_info + + +class ExtendedLocationOptions(msrest.serialization.Model): + """ExtendedLocationOptions. + + :ivar type: + :vartype type: str + :ivar supported_policy: + :vartype supported_policy: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'supported_policy': {'key': 'supportedPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + supported_policy: Optional[str] = None, + **kwargs + ): + """ + :keyword type: + :paramtype type: str + :keyword supported_policy: + :paramtype supported_policy: str + """ + super(ExtendedLocationOptions, self).__init__(**kwargs) + self.type = type + self.supported_policy = supported_policy + + +class ExtensionOptions(msrest.serialization.Model): + """ExtensionOptions. + + :ivar request: + :vartype request: list[str or ~azure.mgmt.providerhub.models.ExtensionOptionType] + :ivar response: + :vartype response: list[str or ~azure.mgmt.providerhub.models.ExtensionOptionType] + """ + + _attribute_map = { + 'request': {'key': 'request', 'type': '[str]'}, + 'response': {'key': 'response', 'type': '[str]'}, + } + + def __init__( + self, + *, + request: Optional[List[Union[str, "ExtensionOptionType"]]] = None, + response: Optional[List[Union[str, "ExtensionOptionType"]]] = None, + **kwargs + ): + """ + :keyword request: + :paramtype request: list[str or ~azure.mgmt.providerhub.models.ExtensionOptionType] + :keyword response: + :paramtype response: list[str or ~azure.mgmt.providerhub.models.ExtensionOptionType] + """ + super(ExtensionOptions, self).__init__(**kwargs) + self.request = request + self.response = response + + +class FeaturesRule(msrest.serialization.Model): + """FeaturesRule. + + All required parameters must be populated in order to send to Azure. + + :ivar required_features_policy: Required. Possible values include: "Any", "All". + :vartype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + + _validation = { + 'required_features_policy': {'required': True}, + } + + _attribute_map = { + 'required_features_policy': {'key': 'requiredFeaturesPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + required_features_policy: Union[str, "FeaturesPolicy"], + **kwargs + ): + """ + :keyword required_features_policy: Required. Possible values include: "Any", "All". + :paramtype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + super(FeaturesRule, self).__init__(**kwargs) + self.required_features_policy = required_features_policy + + +class IdentityManagement(msrest.serialization.Model): + """IdentityManagement. + + :ivar type: Possible values include: "NotSpecified", "SystemAssigned", "UserAssigned", "Actor", + "DelegatedResourceIdentity". + :vartype type: str or ~azure.mgmt.providerhub.models.IdentityManagementTypes + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "IdentityManagementTypes"]] = None, + **kwargs + ): + """ + :keyword type: Possible values include: "NotSpecified", "SystemAssigned", "UserAssigned", + "Actor", "DelegatedResourceIdentity". + :paramtype type: str or ~azure.mgmt.providerhub.models.IdentityManagementTypes + """ + super(IdentityManagement, self).__init__(**kwargs) + self.type = type + + +class IdentityManagementProperties(msrest.serialization.Model): + """IdentityManagementProperties. + + :ivar type: Possible values include: "NotSpecified", "SystemAssigned", "UserAssigned", "Actor", + "DelegatedResourceIdentity". + :vartype type: str or ~azure.mgmt.providerhub.models.IdentityManagementTypes + :ivar application_id: + :vartype application_id: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "IdentityManagementTypes"]] = None, + application_id: Optional[str] = None, + **kwargs + ): + """ + :keyword type: Possible values include: "NotSpecified", "SystemAssigned", "UserAssigned", + "Actor", "DelegatedResourceIdentity". + :paramtype type: str or ~azure.mgmt.providerhub.models.IdentityManagementTypes + :keyword application_id: + :paramtype application_id: str + """ + super(IdentityManagementProperties, self).__init__(**kwargs) + self.type = type + self.application_id = application_id + + +class LightHouseAuthorization(msrest.serialization.Model): + """LightHouseAuthorization. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: Required. + :vartype principal_id: str + :ivar role_definition_id: Required. + :vartype role_definition_id: str + """ + + _validation = { + 'principal_id': {'required': True}, + 'role_definition_id': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + } + + def __init__( + self, + *, + principal_id: str, + role_definition_id: str, + **kwargs + ): + """ + :keyword principal_id: Required. + :paramtype principal_id: str + :keyword role_definition_id: Required. + :paramtype role_definition_id: str + """ + super(LightHouseAuthorization, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id + + +class LinkedAccessCheck(msrest.serialization.Model): + """LinkedAccessCheck. + + :ivar action_name: + :vartype action_name: str + :ivar linked_property: + :vartype linked_property: str + :ivar linked_action: + :vartype linked_action: str + :ivar linked_action_verb: + :vartype linked_action_verb: str + :ivar linked_type: + :vartype linked_type: str + """ + + _attribute_map = { + 'action_name': {'key': 'actionName', 'type': 'str'}, + 'linked_property': {'key': 'linkedProperty', 'type': 'str'}, + 'linked_action': {'key': 'linkedAction', 'type': 'str'}, + 'linked_action_verb': {'key': 'linkedActionVerb', 'type': 'str'}, + 'linked_type': {'key': 'linkedType', 'type': 'str'}, + } + + def __init__( + self, + *, + action_name: Optional[str] = None, + linked_property: Optional[str] = None, + linked_action: Optional[str] = None, + linked_action_verb: Optional[str] = None, + linked_type: Optional[str] = None, + **kwargs + ): + """ + :keyword action_name: + :paramtype action_name: str + :keyword linked_property: + :paramtype linked_property: str + :keyword linked_action: + :paramtype linked_action: str + :keyword linked_action_verb: + :paramtype linked_action_verb: str + :keyword linked_type: + :paramtype linked_type: str + """ + super(LinkedAccessCheck, self).__init__(**kwargs) + self.action_name = action_name + self.linked_property = linked_property + self.linked_action = linked_action + self.linked_action_verb = linked_action_verb + self.linked_type = linked_type + + +class LinkedOperationRule(msrest.serialization.Model): + """LinkedOperationRule. + + All required parameters must be populated in order to send to Azure. + + :ivar linked_operation: Required. Possible values include: "None", + "CrossResourceGroupResourceMove", "CrossSubscriptionResourceMove". + :vartype linked_operation: str or ~azure.mgmt.providerhub.models.LinkedOperation + :ivar linked_action: Required. Possible values include: "NotSpecified", "Blocked", "Validate", + "Enabled". + :vartype linked_action: str or ~azure.mgmt.providerhub.models.LinkedAction + """ + + _validation = { + 'linked_operation': {'required': True}, + 'linked_action': {'required': True}, + } + + _attribute_map = { + 'linked_operation': {'key': 'linkedOperation', 'type': 'str'}, + 'linked_action': {'key': 'linkedAction', 'type': 'str'}, + } + + def __init__( + self, + *, + linked_operation: Union[str, "LinkedOperation"], + linked_action: Union[str, "LinkedAction"], + **kwargs + ): + """ + :keyword linked_operation: Required. Possible values include: "None", + "CrossResourceGroupResourceMove", "CrossSubscriptionResourceMove". + :paramtype linked_operation: str or ~azure.mgmt.providerhub.models.LinkedOperation + :keyword linked_action: Required. Possible values include: "NotSpecified", "Blocked", + "Validate", "Enabled". + :paramtype linked_action: str or ~azure.mgmt.providerhub.models.LinkedAction + """ + super(LinkedOperationRule, self).__init__(**kwargs) + self.linked_operation = linked_operation + self.linked_action = linked_action + + +class LoggingHiddenPropertyPath(msrest.serialization.Model): + """LoggingHiddenPropertyPath. + + :ivar hidden_paths_on_request: + :vartype hidden_paths_on_request: list[str] + :ivar hidden_paths_on_response: + :vartype hidden_paths_on_response: list[str] + """ + + _attribute_map = { + 'hidden_paths_on_request': {'key': 'hiddenPathsOnRequest', 'type': '[str]'}, + 'hidden_paths_on_response': {'key': 'hiddenPathsOnResponse', 'type': '[str]'}, + } + + def __init__( + self, + *, + hidden_paths_on_request: Optional[List[str]] = None, + hidden_paths_on_response: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword hidden_paths_on_request: + :paramtype hidden_paths_on_request: list[str] + :keyword hidden_paths_on_response: + :paramtype hidden_paths_on_response: list[str] + """ + super(LoggingHiddenPropertyPath, self).__init__(**kwargs) + self.hidden_paths_on_request = hidden_paths_on_request + self.hidden_paths_on_response = hidden_paths_on_response + + +class LoggingRule(msrest.serialization.Model): + """LoggingRule. + + All required parameters must be populated in order to send to Azure. + + :ivar action: Required. + :vartype action: str + :ivar direction: Required. Possible values include: "None", "Request", "Response". + :vartype direction: str or ~azure.mgmt.providerhub.models.LoggingDirections + :ivar detail_level: Required. Possible values include: "None", "Body". + :vartype detail_level: str or ~azure.mgmt.providerhub.models.LoggingDetails + :ivar hidden_property_paths: + :vartype hidden_property_paths: ~azure.mgmt.providerhub.models.LoggingRuleHiddenPropertyPaths + """ + + _validation = { + 'action': {'required': True}, + 'direction': {'required': True}, + 'detail_level': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'detail_level': {'key': 'detailLevel', 'type': 'str'}, + 'hidden_property_paths': {'key': 'hiddenPropertyPaths', 'type': 'LoggingRuleHiddenPropertyPaths'}, + } + + def __init__( + self, + *, + action: str, + direction: Union[str, "LoggingDirections"], + detail_level: Union[str, "LoggingDetails"], + hidden_property_paths: Optional["LoggingRuleHiddenPropertyPaths"] = None, + **kwargs + ): + """ + :keyword action: Required. + :paramtype action: str + :keyword direction: Required. Possible values include: "None", "Request", "Response". + :paramtype direction: str or ~azure.mgmt.providerhub.models.LoggingDirections + :keyword detail_level: Required. Possible values include: "None", "Body". + :paramtype detail_level: str or ~azure.mgmt.providerhub.models.LoggingDetails + :keyword hidden_property_paths: + :paramtype hidden_property_paths: ~azure.mgmt.providerhub.models.LoggingRuleHiddenPropertyPaths + """ + super(LoggingRule, self).__init__(**kwargs) + self.action = action + self.direction = direction + self.detail_level = detail_level + self.hidden_property_paths = hidden_property_paths + + +class LoggingRuleHiddenPropertyPaths(LoggingHiddenPropertyPath): + """LoggingRuleHiddenPropertyPaths. + + :ivar hidden_paths_on_request: + :vartype hidden_paths_on_request: list[str] + :ivar hidden_paths_on_response: + :vartype hidden_paths_on_response: list[str] + """ + + _attribute_map = { + 'hidden_paths_on_request': {'key': 'hiddenPathsOnRequest', 'type': '[str]'}, + 'hidden_paths_on_response': {'key': 'hiddenPathsOnResponse', 'type': '[str]'}, + } + + def __init__( + self, + *, + hidden_paths_on_request: Optional[List[str]] = None, + hidden_paths_on_response: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword hidden_paths_on_request: + :paramtype hidden_paths_on_request: list[str] + :keyword hidden_paths_on_response: + :paramtype hidden_paths_on_response: list[str] + """ + super(LoggingRuleHiddenPropertyPaths, self).__init__(hidden_paths_on_request=hidden_paths_on_request, hidden_paths_on_response=hidden_paths_on_response, **kwargs) + + +class NotificationEndpoint(msrest.serialization.Model): + """NotificationEndpoint. + + :ivar notification_destination: + :vartype notification_destination: str + :ivar locations: + :vartype locations: list[str] + """ + + _attribute_map = { + 'notification_destination': {'key': 'notificationDestination', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + } + + def __init__( + self, + *, + notification_destination: Optional[str] = None, + locations: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword notification_destination: + :paramtype notification_destination: str + :keyword locations: + :paramtype locations: list[str] + """ + super(NotificationEndpoint, self).__init__(**kwargs) + self.notification_destination = notification_destination + self.locations = locations + + +class NotificationRegistration(Resource): + """The notification registration definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar properties: + :vartype properties: + ~azure.mgmt.providerhub.models.NotificationRegistrationPropertiesAutoGenerated + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'NotificationRegistrationPropertiesAutoGenerated'}, + } + + def __init__( + self, + *, + properties: Optional["NotificationRegistrationPropertiesAutoGenerated"] = None, + **kwargs + ): + """ + :keyword properties: + :paramtype properties: + ~azure.mgmt.providerhub.models.NotificationRegistrationPropertiesAutoGenerated + """ + super(NotificationRegistration, self).__init__(**kwargs) + self.properties = properties + + +class NotificationRegistrationArrayResponseWithContinuation(msrest.serialization.Model): + """NotificationRegistrationArrayResponseWithContinuation. + + :ivar value: + :vartype value: list[~azure.mgmt.providerhub.models.NotificationRegistration] + :ivar next_link: The URL to get to the next set of results, if there are any. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NotificationRegistration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NotificationRegistration"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.providerhub.models.NotificationRegistration] + :keyword next_link: The URL to get to the next set of results, if there are any. + :paramtype next_link: str + """ + super(NotificationRegistrationArrayResponseWithContinuation, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NotificationRegistrationProperties(msrest.serialization.Model): + """NotificationRegistrationProperties. + + :ivar notification_mode: Possible values include: "NotSpecified", "EventHub", "WebHook". + :vartype notification_mode: str or ~azure.mgmt.providerhub.models.NotificationMode + :ivar message_scope: Possible values include: "NotSpecified", "RegisteredSubscriptions". + :vartype message_scope: str or ~azure.mgmt.providerhub.models.MessageScope + :ivar included_events: + :vartype included_events: list[str] + :ivar notification_endpoints: + :vartype notification_endpoints: list[~azure.mgmt.providerhub.models.NotificationEndpoint] + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + """ + + _attribute_map = { + 'notification_mode': {'key': 'notificationMode', 'type': 'str'}, + 'message_scope': {'key': 'messageScope', 'type': 'str'}, + 'included_events': {'key': 'includedEvents', 'type': '[str]'}, + 'notification_endpoints': {'key': 'notificationEndpoints', 'type': '[NotificationEndpoint]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + notification_mode: Optional[Union[str, "NotificationMode"]] = None, + message_scope: Optional[Union[str, "MessageScope"]] = None, + included_events: Optional[List[str]] = None, + notification_endpoints: Optional[List["NotificationEndpoint"]] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + **kwargs + ): + """ + :keyword notification_mode: Possible values include: "NotSpecified", "EventHub", "WebHook". + :paramtype notification_mode: str or ~azure.mgmt.providerhub.models.NotificationMode + :keyword message_scope: Possible values include: "NotSpecified", "RegisteredSubscriptions". + :paramtype message_scope: str or ~azure.mgmt.providerhub.models.MessageScope + :keyword included_events: + :paramtype included_events: list[str] + :keyword notification_endpoints: + :paramtype notification_endpoints: list[~azure.mgmt.providerhub.models.NotificationEndpoint] + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + """ + super(NotificationRegistrationProperties, self).__init__(**kwargs) + self.notification_mode = notification_mode + self.message_scope = message_scope + self.included_events = included_events + self.notification_endpoints = notification_endpoints + self.provisioning_state = provisioning_state + + +class NotificationRegistrationPropertiesAutoGenerated(NotificationRegistrationProperties): + """NotificationRegistrationPropertiesAutoGenerated. + + :ivar notification_mode: Possible values include: "NotSpecified", "EventHub", "WebHook". + :vartype notification_mode: str or ~azure.mgmt.providerhub.models.NotificationMode + :ivar message_scope: Possible values include: "NotSpecified", "RegisteredSubscriptions". + :vartype message_scope: str or ~azure.mgmt.providerhub.models.MessageScope + :ivar included_events: + :vartype included_events: list[str] + :ivar notification_endpoints: + :vartype notification_endpoints: list[~azure.mgmt.providerhub.models.NotificationEndpoint] + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + """ + + _attribute_map = { + 'notification_mode': {'key': 'notificationMode', 'type': 'str'}, + 'message_scope': {'key': 'messageScope', 'type': 'str'}, + 'included_events': {'key': 'includedEvents', 'type': '[str]'}, + 'notification_endpoints': {'key': 'notificationEndpoints', 'type': '[NotificationEndpoint]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + notification_mode: Optional[Union[str, "NotificationMode"]] = None, + message_scope: Optional[Union[str, "MessageScope"]] = None, + included_events: Optional[List[str]] = None, + notification_endpoints: Optional[List["NotificationEndpoint"]] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + **kwargs + ): + """ + :keyword notification_mode: Possible values include: "NotSpecified", "EventHub", "WebHook". + :paramtype notification_mode: str or ~azure.mgmt.providerhub.models.NotificationMode + :keyword message_scope: Possible values include: "NotSpecified", "RegisteredSubscriptions". + :paramtype message_scope: str or ~azure.mgmt.providerhub.models.MessageScope + :keyword included_events: + :paramtype included_events: list[str] + :keyword notification_endpoints: + :paramtype notification_endpoints: list[~azure.mgmt.providerhub.models.NotificationEndpoint] + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + """ + super(NotificationRegistrationPropertiesAutoGenerated, self).__init__(notification_mode=notification_mode, message_scope=message_scope, included_events=included_events, notification_endpoints=notification_endpoints, provisioning_state=provisioning_state, **kwargs) + + +class OperationsContent(Resource): + """OperationsContent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar name_properties_name: Name of the operation. + :vartype name_properties_name: str + :ivar is_data_action: Indicates whether the operation applies to data-plane. + :vartype is_data_action: bool + :ivar origin: Possible values include: "NotSpecified", "User", "System". + :vartype origin: str or ~azure.mgmt.providerhub.models.OperationsDefinitionOrigin + :ivar display: Display information of the operation. + :vartype display: ~azure.mgmt.providerhub.models.OperationsDefinitionDisplay + :ivar action_type: Possible values include: "NotSpecified", "Internal". + :vartype action_type: str or ~azure.mgmt.providerhub.models.OperationsDefinitionActionType + :ivar properties: Anything. + :vartype properties: any + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'is_data_action': {'key': 'properties.isDataAction', 'type': 'bool'}, + 'origin': {'key': 'properties.origin', 'type': 'str'}, + 'display': {'key': 'properties.display', 'type': 'OperationsDefinitionDisplay'}, + 'action_type': {'key': 'properties.actionType', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': 'object'}, + } + + def __init__( + self, + *, + name_properties_name: Optional[str] = None, + is_data_action: Optional[bool] = None, + origin: Optional[Union[str, "OperationsDefinitionOrigin"]] = None, + display: Optional["OperationsDefinitionDisplay"] = None, + action_type: Optional[Union[str, "OperationsDefinitionActionType"]] = None, + properties: Optional[Any] = None, + **kwargs + ): + """ + :keyword name_properties_name: Name of the operation. + :paramtype name_properties_name: str + :keyword is_data_action: Indicates whether the operation applies to data-plane. + :paramtype is_data_action: bool + :keyword origin: Possible values include: "NotSpecified", "User", "System". + :paramtype origin: str or ~azure.mgmt.providerhub.models.OperationsDefinitionOrigin + :keyword display: Display information of the operation. + :paramtype display: ~azure.mgmt.providerhub.models.OperationsDefinitionDisplay + :keyword action_type: Possible values include: "NotSpecified", "Internal". + :paramtype action_type: str or ~azure.mgmt.providerhub.models.OperationsDefinitionActionType + :keyword properties: Anything. + :paramtype properties: any + """ + super(OperationsContent, self).__init__(**kwargs) + self.name_properties_name = name_properties_name + self.is_data_action = is_data_action + self.origin = origin + self.display = display + self.action_type = action_type + self.properties = properties + + +class OperationsDefinition(msrest.serialization.Model): + """Properties of an Operation. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. Name of the operation. + :vartype name: str + :ivar is_data_action: Indicates whether the operation applies to data-plane. + :vartype is_data_action: bool + :ivar origin: Possible values include: "NotSpecified", "User", "System". + :vartype origin: str or ~azure.mgmt.providerhub.models.OperationsDefinitionOrigin + :ivar display: Required. Display information of the operation. + :vartype display: ~azure.mgmt.providerhub.models.OperationsDefinitionDisplay + :ivar action_type: Possible values include: "NotSpecified", "Internal". + :vartype action_type: str or ~azure.mgmt.providerhub.models.OperationsDefinitionActionType + :ivar properties: Anything. + :vartype properties: any + """ + + _validation = { + 'name': {'required': True}, + 'display': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationsDefinitionDisplay'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + *, + name: str, + display: "OperationsDefinitionDisplay", + is_data_action: Optional[bool] = None, + origin: Optional[Union[str, "OperationsDefinitionOrigin"]] = None, + action_type: Optional[Union[str, "OperationsDefinitionActionType"]] = None, + properties: Optional[Any] = None, + **kwargs + ): + """ + :keyword name: Required. Name of the operation. + :paramtype name: str + :keyword is_data_action: Indicates whether the operation applies to data-plane. + :paramtype is_data_action: bool + :keyword origin: Possible values include: "NotSpecified", "User", "System". + :paramtype origin: str or ~azure.mgmt.providerhub.models.OperationsDefinitionOrigin + :keyword display: Required. Display information of the operation. + :paramtype display: ~azure.mgmt.providerhub.models.OperationsDefinitionDisplay + :keyword action_type: Possible values include: "NotSpecified", "Internal". + :paramtype action_type: str or ~azure.mgmt.providerhub.models.OperationsDefinitionActionType + :keyword properties: Anything. + :paramtype properties: any + """ + super(OperationsDefinition, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.origin = origin + self.display = display + self.action_type = action_type + self.properties = properties + + +class OperationsDefinitionArrayResponseWithContinuation(msrest.serialization.Model): + """OperationsDefinitionArrayResponseWithContinuation. + + :ivar value: + :vartype value: list[~azure.mgmt.providerhub.models.OperationsDefinition] + :ivar next_link: The URL to get to the next set of results, if there are any. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationsDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["OperationsDefinition"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.providerhub.models.OperationsDefinition] + :keyword next_link: The URL to get to the next set of results, if there are any. + :paramtype next_link: str + """ + super(OperationsDefinitionArrayResponseWithContinuation, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class OperationsDisplayDefinition(msrest.serialization.Model): + """OperationsDisplayDefinition. + + All required parameters must be populated in order to send to Azure. + + :ivar provider: Required. + :vartype provider: str + :ivar resource: Required. + :vartype resource: str + :ivar operation: Required. + :vartype operation: str + :ivar description: Required. + :vartype description: str + """ + + _validation = { + 'provider': {'required': True}, + 'resource': {'required': True}, + 'operation': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: str, + resource: str, + operation: str, + description: str, + **kwargs + ): + """ + :keyword provider: Required. + :paramtype provider: str + :keyword resource: Required. + :paramtype resource: str + :keyword operation: Required. + :paramtype operation: str + :keyword description: Required. + :paramtype description: str + """ + super(OperationsDisplayDefinition, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationsDefinitionDisplay(OperationsDisplayDefinition): + """Display information of the operation. + + All required parameters must be populated in order to send to Azure. + + :ivar provider: Required. + :vartype provider: str + :ivar resource: Required. + :vartype resource: str + :ivar operation: Required. + :vartype operation: str + :ivar description: Required. + :vartype description: str + """ + + _validation = { + 'provider': {'required': True}, + 'resource': {'required': True}, + 'operation': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: str, + resource: str, + operation: str, + description: str, + **kwargs + ): + """ + :keyword provider: Required. + :paramtype provider: str + :keyword resource: Required. + :paramtype resource: str + :keyword operation: Required. + :paramtype operation: str + :keyword description: Required. + :paramtype description: str + """ + super(OperationsDefinitionDisplay, self).__init__(provider=provider, resource=resource, operation=operation, description=description, **kwargs) + + +class OperationsPutContent(msrest.serialization.Model): + """OperationsPutContent. + + All required parameters must be populated in order to send to Azure. + + :ivar contents: Required. + :vartype contents: list[~azure.mgmt.providerhub.models.OperationsDefinition] + """ + + _validation = { + 'contents': {'required': True}, + } + + _attribute_map = { + 'contents': {'key': 'contents', 'type': '[OperationsDefinition]'}, + } + + def __init__( + self, + *, + contents: List["OperationsDefinition"], + **kwargs + ): + """ + :keyword contents: Required. + :paramtype contents: list[~azure.mgmt.providerhub.models.OperationsDefinition] + """ + super(OperationsPutContent, self).__init__(**kwargs) + self.contents = contents + + +class ProviderHubMetadata(msrest.serialization.Model): + """ProviderHubMetadata. + + :ivar provider_authorizations: + :vartype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :ivar provider_authentication: + :vartype provider_authentication: + ~azure.mgmt.providerhub.models.ProviderHubMetadataProviderAuthentication + :ivar third_party_provider_authorization: + :vartype third_party_provider_authorization: + ~azure.mgmt.providerhub.models.ProviderHubMetadataThirdPartyProviderAuthorization + """ + + _attribute_map = { + 'provider_authorizations': {'key': 'providerAuthorizations', 'type': '[ResourceProviderAuthorization]'}, + 'provider_authentication': {'key': 'providerAuthentication', 'type': 'ProviderHubMetadataProviderAuthentication'}, + 'third_party_provider_authorization': {'key': 'thirdPartyProviderAuthorization', 'type': 'ProviderHubMetadataThirdPartyProviderAuthorization'}, + } + + def __init__( + self, + *, + provider_authorizations: Optional[List["ResourceProviderAuthorization"]] = None, + provider_authentication: Optional["ProviderHubMetadataProviderAuthentication"] = None, + third_party_provider_authorization: Optional["ProviderHubMetadataThirdPartyProviderAuthorization"] = None, + **kwargs + ): + """ + :keyword provider_authorizations: + :paramtype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :keyword provider_authentication: + :paramtype provider_authentication: + ~azure.mgmt.providerhub.models.ProviderHubMetadataProviderAuthentication + :keyword third_party_provider_authorization: + :paramtype third_party_provider_authorization: + ~azure.mgmt.providerhub.models.ProviderHubMetadataThirdPartyProviderAuthorization + """ + super(ProviderHubMetadata, self).__init__(**kwargs) + self.provider_authorizations = provider_authorizations + self.provider_authentication = provider_authentication + self.third_party_provider_authorization = third_party_provider_authorization + + +class ResourceProviderAuthentication(msrest.serialization.Model): + """ResourceProviderAuthentication. + + All required parameters must be populated in order to send to Azure. + + :ivar allowed_audiences: Required. + :vartype allowed_audiences: list[str] + """ + + _validation = { + 'allowed_audiences': {'required': True}, + } + + _attribute_map = { + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + *, + allowed_audiences: List[str], + **kwargs + ): + """ + :keyword allowed_audiences: Required. + :paramtype allowed_audiences: list[str] + """ + super(ResourceProviderAuthentication, self).__init__(**kwargs) + self.allowed_audiences = allowed_audiences + + +class ProviderHubMetadataProviderAuthentication(ResourceProviderAuthentication): + """ProviderHubMetadataProviderAuthentication. + + All required parameters must be populated in order to send to Azure. + + :ivar allowed_audiences: Required. + :vartype allowed_audiences: list[str] + """ + + _validation = { + 'allowed_audiences': {'required': True}, + } + + _attribute_map = { + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + *, + allowed_audiences: List[str], + **kwargs + ): + """ + :keyword allowed_audiences: Required. + :paramtype allowed_audiences: list[str] + """ + super(ProviderHubMetadataProviderAuthentication, self).__init__(allowed_audiences=allowed_audiences, **kwargs) + + +class ThirdPartyProviderAuthorization(msrest.serialization.Model): + """ThirdPartyProviderAuthorization. + + :ivar authorizations: + :vartype authorizations: list[~azure.mgmt.providerhub.models.LightHouseAuthorization] + :ivar managed_by_tenant_id: + :vartype managed_by_tenant_id: str + """ + + _attribute_map = { + 'authorizations': {'key': 'authorizations', 'type': '[LightHouseAuthorization]'}, + 'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + authorizations: Optional[List["LightHouseAuthorization"]] = None, + managed_by_tenant_id: Optional[str] = None, + **kwargs + ): + """ + :keyword authorizations: + :paramtype authorizations: list[~azure.mgmt.providerhub.models.LightHouseAuthorization] + :keyword managed_by_tenant_id: + :paramtype managed_by_tenant_id: str + """ + super(ThirdPartyProviderAuthorization, self).__init__(**kwargs) + self.authorizations = authorizations + self.managed_by_tenant_id = managed_by_tenant_id + + +class ProviderHubMetadataThirdPartyProviderAuthorization(ThirdPartyProviderAuthorization): + """ProviderHubMetadataThirdPartyProviderAuthorization. + + :ivar authorizations: + :vartype authorizations: list[~azure.mgmt.providerhub.models.LightHouseAuthorization] + :ivar managed_by_tenant_id: + :vartype managed_by_tenant_id: str + """ + + _attribute_map = { + 'authorizations': {'key': 'authorizations', 'type': '[LightHouseAuthorization]'}, + 'managed_by_tenant_id': {'key': 'managedByTenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + authorizations: Optional[List["LightHouseAuthorization"]] = None, + managed_by_tenant_id: Optional[str] = None, + **kwargs + ): + """ + :keyword authorizations: + :paramtype authorizations: list[~azure.mgmt.providerhub.models.LightHouseAuthorization] + :keyword managed_by_tenant_id: + :paramtype managed_by_tenant_id: str + """ + super(ProviderHubMetadataThirdPartyProviderAuthorization, self).__init__(authorizations=authorizations, managed_by_tenant_id=managed_by_tenant_id, **kwargs) + + +class ProviderRegistrationArrayResponseWithContinuation(msrest.serialization.Model): + """ProviderRegistrationArrayResponseWithContinuation. + + :ivar value: + :vartype value: list[~azure.mgmt.providerhub.models.ProviderRegistration] + :ivar next_link: The URL to get to the next set of results, if there are any. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProviderRegistration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ProviderRegistration"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.providerhub.models.ProviderRegistration] + :keyword next_link: The URL to get to the next set of results, if there are any. + :paramtype next_link: str + """ + super(ProviderRegistrationArrayResponseWithContinuation, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ResourceProviderManifestProperties(msrest.serialization.Model): + """ResourceProviderManifestProperties. + + :ivar provider_authentication: + :vartype provider_authentication: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesProviderAuthentication + :ivar provider_authorizations: + :vartype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :ivar namespace: + :vartype namespace: str + :ivar provider_version: + :vartype provider_version: str + :ivar provider_type: Possible values include: "NotSpecified", "Internal", "External", "Hidden", + "RegistrationFree", "LegacyRegistrationRequired", "TenantOnly", "AuthorizationFree". + :vartype provider_type: str or ~azure.mgmt.providerhub.models.ResourceProviderType + :ivar required_features: + :vartype required_features: list[str] + :ivar features_rule: + :vartype features_rule: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesFeaturesRule + :ivar request_header_options: + :vartype request_header_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesRequestHeaderOptions + :ivar management: + :vartype management: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesManagement + :ivar capabilities: + :vartype capabilities: list[~azure.mgmt.providerhub.models.ResourceProviderCapabilities] + :ivar metadata: Anything. + :vartype metadata: any + :ivar template_deployment_options: + :vartype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesTemplateDeploymentOptions + """ + + _attribute_map = { + 'provider_authentication': {'key': 'providerAuthentication', 'type': 'ResourceProviderManifestPropertiesProviderAuthentication'}, + 'provider_authorizations': {'key': 'providerAuthorizations', 'type': '[ResourceProviderAuthorization]'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'provider_version': {'key': 'providerVersion', 'type': 'str'}, + 'provider_type': {'key': 'providerType', 'type': 'str'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'features_rule': {'key': 'featuresRule', 'type': 'ResourceProviderManifestPropertiesFeaturesRule'}, + 'request_header_options': {'key': 'requestHeaderOptions', 'type': 'ResourceProviderManifestPropertiesRequestHeaderOptions'}, + 'management': {'key': 'management', 'type': 'ResourceProviderManifestPropertiesManagement'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceProviderCapabilities]'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'template_deployment_options': {'key': 'templateDeploymentOptions', 'type': 'ResourceProviderManifestPropertiesTemplateDeploymentOptions'}, + } + + def __init__( + self, + *, + provider_authentication: Optional["ResourceProviderManifestPropertiesProviderAuthentication"] = None, + provider_authorizations: Optional[List["ResourceProviderAuthorization"]] = None, + namespace: Optional[str] = None, + provider_version: Optional[str] = None, + provider_type: Optional[Union[str, "ResourceProviderType"]] = None, + required_features: Optional[List[str]] = None, + features_rule: Optional["ResourceProviderManifestPropertiesFeaturesRule"] = None, + request_header_options: Optional["ResourceProviderManifestPropertiesRequestHeaderOptions"] = None, + management: Optional["ResourceProviderManifestPropertiesManagement"] = None, + capabilities: Optional[List["ResourceProviderCapabilities"]] = None, + metadata: Optional[Any] = None, + template_deployment_options: Optional["ResourceProviderManifestPropertiesTemplateDeploymentOptions"] = None, + **kwargs + ): + """ + :keyword provider_authentication: + :paramtype provider_authentication: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesProviderAuthentication + :keyword provider_authorizations: + :paramtype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :keyword namespace: + :paramtype namespace: str + :keyword provider_version: + :paramtype provider_version: str + :keyword provider_type: Possible values include: "NotSpecified", "Internal", "External", + "Hidden", "RegistrationFree", "LegacyRegistrationRequired", "TenantOnly", "AuthorizationFree". + :paramtype provider_type: str or ~azure.mgmt.providerhub.models.ResourceProviderType + :keyword required_features: + :paramtype required_features: list[str] + :keyword features_rule: + :paramtype features_rule: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesFeaturesRule + :keyword request_header_options: + :paramtype request_header_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesRequestHeaderOptions + :keyword management: + :paramtype management: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesManagement + :keyword capabilities: + :paramtype capabilities: list[~azure.mgmt.providerhub.models.ResourceProviderCapabilities] + :keyword metadata: Anything. + :paramtype metadata: any + :keyword template_deployment_options: + :paramtype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesTemplateDeploymentOptions + """ + super(ResourceProviderManifestProperties, self).__init__(**kwargs) + self.provider_authentication = provider_authentication + self.provider_authorizations = provider_authorizations + self.namespace = namespace + self.provider_version = provider_version + self.provider_type = provider_type + self.required_features = required_features + self.features_rule = features_rule + self.request_header_options = request_header_options + self.management = management + self.capabilities = capabilities + self.metadata = metadata + self.template_deployment_options = template_deployment_options + + +class ProviderRegistrationProperties(ResourceProviderManifestProperties): + """ProviderRegistrationProperties. + + :ivar provider_authentication: + :vartype provider_authentication: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesProviderAuthentication + :ivar provider_authorizations: + :vartype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :ivar namespace: + :vartype namespace: str + :ivar provider_version: + :vartype provider_version: str + :ivar provider_type: Possible values include: "NotSpecified", "Internal", "External", "Hidden", + "RegistrationFree", "LegacyRegistrationRequired", "TenantOnly", "AuthorizationFree". + :vartype provider_type: str or ~azure.mgmt.providerhub.models.ResourceProviderType + :ivar required_features: + :vartype required_features: list[str] + :ivar features_rule: + :vartype features_rule: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesFeaturesRule + :ivar request_header_options: + :vartype request_header_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesRequestHeaderOptions + :ivar management: + :vartype management: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesManagement + :ivar capabilities: + :vartype capabilities: list[~azure.mgmt.providerhub.models.ResourceProviderCapabilities] + :ivar metadata: Anything. + :vartype metadata: any + :ivar template_deployment_options: + :vartype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesTemplateDeploymentOptions + :ivar provider_hub_metadata: + :vartype provider_hub_metadata: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesProviderHubMetadata + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :ivar subscription_lifecycle_notification_specifications: + :vartype subscription_lifecycle_notification_specifications: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + """ + + _attribute_map = { + 'provider_authentication': {'key': 'providerAuthentication', 'type': 'ResourceProviderManifestPropertiesProviderAuthentication'}, + 'provider_authorizations': {'key': 'providerAuthorizations', 'type': '[ResourceProviderAuthorization]'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'provider_version': {'key': 'providerVersion', 'type': 'str'}, + 'provider_type': {'key': 'providerType', 'type': 'str'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'features_rule': {'key': 'featuresRule', 'type': 'ResourceProviderManifestPropertiesFeaturesRule'}, + 'request_header_options': {'key': 'requestHeaderOptions', 'type': 'ResourceProviderManifestPropertiesRequestHeaderOptions'}, + 'management': {'key': 'management', 'type': 'ResourceProviderManifestPropertiesManagement'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceProviderCapabilities]'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'template_deployment_options': {'key': 'templateDeploymentOptions', 'type': 'ResourceProviderManifestPropertiesTemplateDeploymentOptions'}, + 'provider_hub_metadata': {'key': 'providerHubMetadata', 'type': 'ProviderRegistrationPropertiesProviderHubMetadata'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'subscription_lifecycle_notification_specifications': {'key': 'subscriptionLifecycleNotificationSpecifications', 'type': 'ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications'}, + } + + def __init__( + self, + *, + provider_authentication: Optional["ResourceProviderManifestPropertiesProviderAuthentication"] = None, + provider_authorizations: Optional[List["ResourceProviderAuthorization"]] = None, + namespace: Optional[str] = None, + provider_version: Optional[str] = None, + provider_type: Optional[Union[str, "ResourceProviderType"]] = None, + required_features: Optional[List[str]] = None, + features_rule: Optional["ResourceProviderManifestPropertiesFeaturesRule"] = None, + request_header_options: Optional["ResourceProviderManifestPropertiesRequestHeaderOptions"] = None, + management: Optional["ResourceProviderManifestPropertiesManagement"] = None, + capabilities: Optional[List["ResourceProviderCapabilities"]] = None, + metadata: Optional[Any] = None, + template_deployment_options: Optional["ResourceProviderManifestPropertiesTemplateDeploymentOptions"] = None, + provider_hub_metadata: Optional["ProviderRegistrationPropertiesProviderHubMetadata"] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + subscription_lifecycle_notification_specifications: Optional["ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications"] = None, + **kwargs + ): + """ + :keyword provider_authentication: + :paramtype provider_authentication: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesProviderAuthentication + :keyword provider_authorizations: + :paramtype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :keyword namespace: + :paramtype namespace: str + :keyword provider_version: + :paramtype provider_version: str + :keyword provider_type: Possible values include: "NotSpecified", "Internal", "External", + "Hidden", "RegistrationFree", "LegacyRegistrationRequired", "TenantOnly", "AuthorizationFree". + :paramtype provider_type: str or ~azure.mgmt.providerhub.models.ResourceProviderType + :keyword required_features: + :paramtype required_features: list[str] + :keyword features_rule: + :paramtype features_rule: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesFeaturesRule + :keyword request_header_options: + :paramtype request_header_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesRequestHeaderOptions + :keyword management: + :paramtype management: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesManagement + :keyword capabilities: + :paramtype capabilities: list[~azure.mgmt.providerhub.models.ResourceProviderCapabilities] + :keyword metadata: Anything. + :paramtype metadata: any + :keyword template_deployment_options: + :paramtype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesTemplateDeploymentOptions + :keyword provider_hub_metadata: + :paramtype provider_hub_metadata: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesProviderHubMetadata + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :keyword subscription_lifecycle_notification_specifications: + :paramtype subscription_lifecycle_notification_specifications: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + """ + super(ProviderRegistrationProperties, self).__init__(provider_authentication=provider_authentication, provider_authorizations=provider_authorizations, namespace=namespace, provider_version=provider_version, provider_type=provider_type, required_features=required_features, features_rule=features_rule, request_header_options=request_header_options, management=management, capabilities=capabilities, metadata=metadata, template_deployment_options=template_deployment_options, **kwargs) + self.provider_hub_metadata = provider_hub_metadata + self.provisioning_state = provisioning_state + self.subscription_lifecycle_notification_specifications = subscription_lifecycle_notification_specifications + + +class ProviderRegistrationPropertiesAutoGenerated(ProviderRegistrationProperties): + """ProviderRegistrationPropertiesAutoGenerated. + + :ivar provider_authentication: + :vartype provider_authentication: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesProviderAuthentication + :ivar provider_authorizations: + :vartype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :ivar namespace: + :vartype namespace: str + :ivar provider_version: + :vartype provider_version: str + :ivar provider_type: Possible values include: "NotSpecified", "Internal", "External", "Hidden", + "RegistrationFree", "LegacyRegistrationRequired", "TenantOnly", "AuthorizationFree". + :vartype provider_type: str or ~azure.mgmt.providerhub.models.ResourceProviderType + :ivar required_features: + :vartype required_features: list[str] + :ivar features_rule: + :vartype features_rule: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesFeaturesRule + :ivar request_header_options: + :vartype request_header_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesRequestHeaderOptions + :ivar management: + :vartype management: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesManagement + :ivar capabilities: + :vartype capabilities: list[~azure.mgmt.providerhub.models.ResourceProviderCapabilities] + :ivar metadata: Anything. + :vartype metadata: any + :ivar template_deployment_options: + :vartype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesTemplateDeploymentOptions + :ivar provider_hub_metadata: + :vartype provider_hub_metadata: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesProviderHubMetadata + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :ivar subscription_lifecycle_notification_specifications: + :vartype subscription_lifecycle_notification_specifications: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + """ + + _attribute_map = { + 'provider_authentication': {'key': 'providerAuthentication', 'type': 'ResourceProviderManifestPropertiesProviderAuthentication'}, + 'provider_authorizations': {'key': 'providerAuthorizations', 'type': '[ResourceProviderAuthorization]'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'provider_version': {'key': 'providerVersion', 'type': 'str'}, + 'provider_type': {'key': 'providerType', 'type': 'str'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'features_rule': {'key': 'featuresRule', 'type': 'ResourceProviderManifestPropertiesFeaturesRule'}, + 'request_header_options': {'key': 'requestHeaderOptions', 'type': 'ResourceProviderManifestPropertiesRequestHeaderOptions'}, + 'management': {'key': 'management', 'type': 'ResourceProviderManifestPropertiesManagement'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceProviderCapabilities]'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'template_deployment_options': {'key': 'templateDeploymentOptions', 'type': 'ResourceProviderManifestPropertiesTemplateDeploymentOptions'}, + 'provider_hub_metadata': {'key': 'providerHubMetadata', 'type': 'ProviderRegistrationPropertiesProviderHubMetadata'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'subscription_lifecycle_notification_specifications': {'key': 'subscriptionLifecycleNotificationSpecifications', 'type': 'ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications'}, + } + + def __init__( + self, + *, + provider_authentication: Optional["ResourceProviderManifestPropertiesProviderAuthentication"] = None, + provider_authorizations: Optional[List["ResourceProviderAuthorization"]] = None, + namespace: Optional[str] = None, + provider_version: Optional[str] = None, + provider_type: Optional[Union[str, "ResourceProviderType"]] = None, + required_features: Optional[List[str]] = None, + features_rule: Optional["ResourceProviderManifestPropertiesFeaturesRule"] = None, + request_header_options: Optional["ResourceProviderManifestPropertiesRequestHeaderOptions"] = None, + management: Optional["ResourceProviderManifestPropertiesManagement"] = None, + capabilities: Optional[List["ResourceProviderCapabilities"]] = None, + metadata: Optional[Any] = None, + template_deployment_options: Optional["ResourceProviderManifestPropertiesTemplateDeploymentOptions"] = None, + provider_hub_metadata: Optional["ProviderRegistrationPropertiesProviderHubMetadata"] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + subscription_lifecycle_notification_specifications: Optional["ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications"] = None, + **kwargs + ): + """ + :keyword provider_authentication: + :paramtype provider_authentication: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesProviderAuthentication + :keyword provider_authorizations: + :paramtype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :keyword namespace: + :paramtype namespace: str + :keyword provider_version: + :paramtype provider_version: str + :keyword provider_type: Possible values include: "NotSpecified", "Internal", "External", + "Hidden", "RegistrationFree", "LegacyRegistrationRequired", "TenantOnly", "AuthorizationFree". + :paramtype provider_type: str or ~azure.mgmt.providerhub.models.ResourceProviderType + :keyword required_features: + :paramtype required_features: list[str] + :keyword features_rule: + :paramtype features_rule: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesFeaturesRule + :keyword request_header_options: + :paramtype request_header_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesRequestHeaderOptions + :keyword management: + :paramtype management: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesManagement + :keyword capabilities: + :paramtype capabilities: list[~azure.mgmt.providerhub.models.ResourceProviderCapabilities] + :keyword metadata: Anything. + :paramtype metadata: any + :keyword template_deployment_options: + :paramtype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestPropertiesTemplateDeploymentOptions + :keyword provider_hub_metadata: + :paramtype provider_hub_metadata: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesProviderHubMetadata + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :keyword subscription_lifecycle_notification_specifications: + :paramtype subscription_lifecycle_notification_specifications: + ~azure.mgmt.providerhub.models.ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + """ + super(ProviderRegistrationPropertiesAutoGenerated, self).__init__(provider_authentication=provider_authentication, provider_authorizations=provider_authorizations, namespace=namespace, provider_version=provider_version, provider_type=provider_type, required_features=required_features, features_rule=features_rule, request_header_options=request_header_options, management=management, capabilities=capabilities, metadata=metadata, template_deployment_options=template_deployment_options, provider_hub_metadata=provider_hub_metadata, provisioning_state=provisioning_state, subscription_lifecycle_notification_specifications=subscription_lifecycle_notification_specifications, **kwargs) + + +class ProviderRegistrationPropertiesProviderHubMetadata(ProviderHubMetadata): + """ProviderRegistrationPropertiesProviderHubMetadata. + + :ivar provider_authorizations: + :vartype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :ivar provider_authentication: + :vartype provider_authentication: + ~azure.mgmt.providerhub.models.ProviderHubMetadataProviderAuthentication + :ivar third_party_provider_authorization: + :vartype third_party_provider_authorization: + ~azure.mgmt.providerhub.models.ProviderHubMetadataThirdPartyProviderAuthorization + """ + + _attribute_map = { + 'provider_authorizations': {'key': 'providerAuthorizations', 'type': '[ResourceProviderAuthorization]'}, + 'provider_authentication': {'key': 'providerAuthentication', 'type': 'ProviderHubMetadataProviderAuthentication'}, + 'third_party_provider_authorization': {'key': 'thirdPartyProviderAuthorization', 'type': 'ProviderHubMetadataThirdPartyProviderAuthorization'}, + } + + def __init__( + self, + *, + provider_authorizations: Optional[List["ResourceProviderAuthorization"]] = None, + provider_authentication: Optional["ProviderHubMetadataProviderAuthentication"] = None, + third_party_provider_authorization: Optional["ProviderHubMetadataThirdPartyProviderAuthorization"] = None, + **kwargs + ): + """ + :keyword provider_authorizations: + :paramtype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :keyword provider_authentication: + :paramtype provider_authentication: + ~azure.mgmt.providerhub.models.ProviderHubMetadataProviderAuthentication + :keyword third_party_provider_authorization: + :paramtype third_party_provider_authorization: + ~azure.mgmt.providerhub.models.ProviderHubMetadataThirdPartyProviderAuthorization + """ + super(ProviderRegistrationPropertiesProviderHubMetadata, self).__init__(provider_authorizations=provider_authorizations, provider_authentication=provider_authentication, third_party_provider_authorization=third_party_provider_authorization, **kwargs) + + +class SubscriptionLifecycleNotificationSpecifications(msrest.serialization.Model): + """SubscriptionLifecycleNotificationSpecifications. + + :ivar subscription_state_override_actions: + :vartype subscription_state_override_actions: + list[~azure.mgmt.providerhub.models.SubscriptionStateOverrideAction] + :ivar soft_delete_ttl: + :vartype soft_delete_ttl: ~datetime.timedelta + """ + + _attribute_map = { + 'subscription_state_override_actions': {'key': 'subscriptionStateOverrideActions', 'type': '[SubscriptionStateOverrideAction]'}, + 'soft_delete_ttl': {'key': 'softDeleteTTL', 'type': 'duration'}, + } + + def __init__( + self, + *, + subscription_state_override_actions: Optional[List["SubscriptionStateOverrideAction"]] = None, + soft_delete_ttl: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword subscription_state_override_actions: + :paramtype subscription_state_override_actions: + list[~azure.mgmt.providerhub.models.SubscriptionStateOverrideAction] + :keyword soft_delete_ttl: + :paramtype soft_delete_ttl: ~datetime.timedelta + """ + super(SubscriptionLifecycleNotificationSpecifications, self).__init__(**kwargs) + self.subscription_state_override_actions = subscription_state_override_actions + self.soft_delete_ttl = soft_delete_ttl + + +class ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications(SubscriptionLifecycleNotificationSpecifications): + """ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications. + + :ivar subscription_state_override_actions: + :vartype subscription_state_override_actions: + list[~azure.mgmt.providerhub.models.SubscriptionStateOverrideAction] + :ivar soft_delete_ttl: + :vartype soft_delete_ttl: ~datetime.timedelta + """ + + _attribute_map = { + 'subscription_state_override_actions': {'key': 'subscriptionStateOverrideActions', 'type': '[SubscriptionStateOverrideAction]'}, + 'soft_delete_ttl': {'key': 'softDeleteTTL', 'type': 'duration'}, + } + + def __init__( + self, + *, + subscription_state_override_actions: Optional[List["SubscriptionStateOverrideAction"]] = None, + soft_delete_ttl: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword subscription_state_override_actions: + :paramtype subscription_state_override_actions: + list[~azure.mgmt.providerhub.models.SubscriptionStateOverrideAction] + :keyword soft_delete_ttl: + :paramtype soft_delete_ttl: ~datetime.timedelta + """ + super(ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications, self).__init__(subscription_state_override_actions=subscription_state_override_actions, soft_delete_ttl=soft_delete_ttl, **kwargs) + + +class RequestHeaderOptions(msrest.serialization.Model): + """RequestHeaderOptions. + + :ivar opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :vartype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + + _attribute_map = { + 'opt_in_headers': {'key': 'optInHeaders', 'type': 'str'}, + } + + def __init__( + self, + *, + opt_in_headers: Optional[Union[str, "OptInHeaderType"]] = None, + **kwargs + ): + """ + :keyword opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :paramtype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + super(RequestHeaderOptions, self).__init__(**kwargs) + self.opt_in_headers = opt_in_headers + + +class ReRegisterSubscriptionMetadata(msrest.serialization.Model): + """ReRegisterSubscriptionMetadata. + + All required parameters must be populated in order to send to Azure. + + :ivar enabled: Required. + :vartype enabled: bool + :ivar concurrency_limit: + :vartype concurrency_limit: int + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'concurrency_limit': {'key': 'concurrencyLimit', 'type': 'int'}, + } + + def __init__( + self, + *, + enabled: bool, + concurrency_limit: Optional[int] = None, + **kwargs + ): + """ + :keyword enabled: Required. + :paramtype enabled: bool + :keyword concurrency_limit: + :paramtype concurrency_limit: int + """ + super(ReRegisterSubscriptionMetadata, self).__init__(**kwargs) + self.enabled = enabled + self.concurrency_limit = concurrency_limit + + +class ResourceMovePolicy(msrest.serialization.Model): + """ResourceMovePolicy. + + :ivar validation_required: + :vartype validation_required: bool + :ivar cross_resource_group_move_enabled: + :vartype cross_resource_group_move_enabled: bool + :ivar cross_subscription_move_enabled: + :vartype cross_subscription_move_enabled: bool + """ + + _attribute_map = { + 'validation_required': {'key': 'validationRequired', 'type': 'bool'}, + 'cross_resource_group_move_enabled': {'key': 'crossResourceGroupMoveEnabled', 'type': 'bool'}, + 'cross_subscription_move_enabled': {'key': 'crossSubscriptionMoveEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + validation_required: Optional[bool] = None, + cross_resource_group_move_enabled: Optional[bool] = None, + cross_subscription_move_enabled: Optional[bool] = None, + **kwargs + ): + """ + :keyword validation_required: + :paramtype validation_required: bool + :keyword cross_resource_group_move_enabled: + :paramtype cross_resource_group_move_enabled: bool + :keyword cross_subscription_move_enabled: + :paramtype cross_subscription_move_enabled: bool + """ + super(ResourceMovePolicy, self).__init__(**kwargs) + self.validation_required = validation_required + self.cross_resource_group_move_enabled = cross_resource_group_move_enabled + self.cross_subscription_move_enabled = cross_subscription_move_enabled + + +class ResourceProviderAuthorization(msrest.serialization.Model): + """ResourceProviderAuthorization. + + :ivar application_id: + :vartype application_id: str + :ivar role_definition_id: + :vartype role_definition_id: str + :ivar managed_by_role_definition_id: + :vartype managed_by_role_definition_id: str + """ + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + 'managed_by_role_definition_id': {'key': 'managedByRoleDefinitionId', 'type': 'str'}, + } + + def __init__( + self, + *, + application_id: Optional[str] = None, + role_definition_id: Optional[str] = None, + managed_by_role_definition_id: Optional[str] = None, + **kwargs + ): + """ + :keyword application_id: + :paramtype application_id: str + :keyword role_definition_id: + :paramtype role_definition_id: str + :keyword managed_by_role_definition_id: + :paramtype managed_by_role_definition_id: str + """ + super(ResourceProviderAuthorization, self).__init__(**kwargs) + self.application_id = application_id + self.role_definition_id = role_definition_id + self.managed_by_role_definition_id = managed_by_role_definition_id + + +class ResourceProviderCapabilities(msrest.serialization.Model): + """ResourceProviderCapabilities. + + All required parameters must be populated in order to send to Azure. + + :ivar quota_id: Required. + :vartype quota_id: str + :ivar effect: Required. Possible values include: "NotSpecified", "Allow", "Disallow". + :vartype effect: str or ~azure.mgmt.providerhub.models.ResourceProviderCapabilitiesEffect + :ivar required_features: + :vartype required_features: list[str] + """ + + _validation = { + 'quota_id': {'required': True}, + 'effect': {'required': True}, + } + + _attribute_map = { + 'quota_id': {'key': 'quotaId', 'type': 'str'}, + 'effect': {'key': 'effect', 'type': 'str'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + *, + quota_id: str, + effect: Union[str, "ResourceProviderCapabilitiesEffect"], + required_features: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword quota_id: Required. + :paramtype quota_id: str + :keyword effect: Required. Possible values include: "NotSpecified", "Allow", "Disallow". + :paramtype effect: str or ~azure.mgmt.providerhub.models.ResourceProviderCapabilitiesEffect + :keyword required_features: + :paramtype required_features: list[str] + """ + super(ResourceProviderCapabilities, self).__init__(**kwargs) + self.quota_id = quota_id + self.effect = effect + self.required_features = required_features + + +class ResourceProviderEndpoint(msrest.serialization.Model): + """ResourceProviderEndpoint. + + :ivar enabled: + :vartype enabled: bool + :ivar api_versions: + :vartype api_versions: list[str] + :ivar endpoint_uri: + :vartype endpoint_uri: str + :ivar locations: + :vartype locations: list[str] + :ivar required_features: + :vartype required_features: list[str] + :ivar features_rule: + :vartype features_rule: ~azure.mgmt.providerhub.models.ResourceProviderEndpointFeaturesRule + :ivar timeout: + :vartype timeout: ~datetime.timedelta + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'features_rule': {'key': 'featuresRule', 'type': 'ResourceProviderEndpointFeaturesRule'}, + 'timeout': {'key': 'timeout', 'type': 'duration'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + api_versions: Optional[List[str]] = None, + endpoint_uri: Optional[str] = None, + locations: Optional[List[str]] = None, + required_features: Optional[List[str]] = None, + features_rule: Optional["ResourceProviderEndpointFeaturesRule"] = None, + timeout: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword enabled: + :paramtype enabled: bool + :keyword api_versions: + :paramtype api_versions: list[str] + :keyword endpoint_uri: + :paramtype endpoint_uri: str + :keyword locations: + :paramtype locations: list[str] + :keyword required_features: + :paramtype required_features: list[str] + :keyword features_rule: + :paramtype features_rule: ~azure.mgmt.providerhub.models.ResourceProviderEndpointFeaturesRule + :keyword timeout: + :paramtype timeout: ~datetime.timedelta + """ + super(ResourceProviderEndpoint, self).__init__(**kwargs) + self.enabled = enabled + self.api_versions = api_versions + self.endpoint_uri = endpoint_uri + self.locations = locations + self.required_features = required_features + self.features_rule = features_rule + self.timeout = timeout + + +class ResourceProviderEndpointFeaturesRule(FeaturesRule): + """ResourceProviderEndpointFeaturesRule. + + All required parameters must be populated in order to send to Azure. + + :ivar required_features_policy: Required. Possible values include: "Any", "All". + :vartype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + + _validation = { + 'required_features_policy': {'required': True}, + } + + _attribute_map = { + 'required_features_policy': {'key': 'requiredFeaturesPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + required_features_policy: Union[str, "FeaturesPolicy"], + **kwargs + ): + """ + :keyword required_features_policy: Required. Possible values include: "Any", "All". + :paramtype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + super(ResourceProviderEndpointFeaturesRule, self).__init__(required_features_policy=required_features_policy, **kwargs) + + +class ResourceProviderManagement(msrest.serialization.Model): + """ResourceProviderManagement. + + :ivar schema_owners: + :vartype schema_owners: list[str] + :ivar manifest_owners: + :vartype manifest_owners: list[str] + :ivar incident_routing_service: + :vartype incident_routing_service: str + :ivar incident_routing_team: + :vartype incident_routing_team: str + :ivar incident_contact_email: + :vartype incident_contact_email: str + :ivar service_tree_infos: + :vartype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :ivar resource_access_policy: Possible values include: "NotSpecified", "AcisReadAllowed", + "AcisActionAllowed". + :vartype resource_access_policy: str or + ~azure.mgmt.providerhub.models.ResourceProviderManagementResourceAccessPolicy + :ivar resource_access_roles: + :vartype resource_access_roles: list[any] + """ + + _attribute_map = { + 'schema_owners': {'key': 'schemaOwners', 'type': '[str]'}, + 'manifest_owners': {'key': 'manifestOwners', 'type': '[str]'}, + 'incident_routing_service': {'key': 'incidentRoutingService', 'type': 'str'}, + 'incident_routing_team': {'key': 'incidentRoutingTeam', 'type': 'str'}, + 'incident_contact_email': {'key': 'incidentContactEmail', 'type': 'str'}, + 'service_tree_infos': {'key': 'serviceTreeInfos', 'type': '[ServiceTreeInfo]'}, + 'resource_access_policy': {'key': 'resourceAccessPolicy', 'type': 'str'}, + 'resource_access_roles': {'key': 'resourceAccessRoles', 'type': '[object]'}, + } + + def __init__( + self, + *, + schema_owners: Optional[List[str]] = None, + manifest_owners: Optional[List[str]] = None, + incident_routing_service: Optional[str] = None, + incident_routing_team: Optional[str] = None, + incident_contact_email: Optional[str] = None, + service_tree_infos: Optional[List["ServiceTreeInfo"]] = None, + resource_access_policy: Optional[Union[str, "ResourceProviderManagementResourceAccessPolicy"]] = None, + resource_access_roles: Optional[List[Any]] = None, + **kwargs + ): + """ + :keyword schema_owners: + :paramtype schema_owners: list[str] + :keyword manifest_owners: + :paramtype manifest_owners: list[str] + :keyword incident_routing_service: + :paramtype incident_routing_service: str + :keyword incident_routing_team: + :paramtype incident_routing_team: str + :keyword incident_contact_email: + :paramtype incident_contact_email: str + :keyword service_tree_infos: + :paramtype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :keyword resource_access_policy: Possible values include: "NotSpecified", "AcisReadAllowed", + "AcisActionAllowed". + :paramtype resource_access_policy: str or + ~azure.mgmt.providerhub.models.ResourceProviderManagementResourceAccessPolicy + :keyword resource_access_roles: + :paramtype resource_access_roles: list[any] + """ + super(ResourceProviderManagement, self).__init__(**kwargs) + self.schema_owners = schema_owners + self.manifest_owners = manifest_owners + self.incident_routing_service = incident_routing_service + self.incident_routing_team = incident_routing_team + self.incident_contact_email = incident_contact_email + self.service_tree_infos = service_tree_infos + self.resource_access_policy = resource_access_policy + self.resource_access_roles = resource_access_roles + + +class ResourceProviderManifest(msrest.serialization.Model): + """ResourceProviderManifest. + + :ivar provider_authentication: + :vartype provider_authentication: + ~azure.mgmt.providerhub.models.ResourceProviderManifestProviderAuthentication + :ivar provider_authorizations: + :vartype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :ivar namespace: + :vartype namespace: str + :ivar provider_version: + :vartype provider_version: str + :ivar provider_type: Possible values include: "NotSpecified", "Internal", "External", "Hidden", + "RegistrationFree", "LegacyRegistrationRequired", "TenantOnly", "AuthorizationFree". + :vartype provider_type: str or ~azure.mgmt.providerhub.models.ResourceProviderType + :ivar required_features: + :vartype required_features: list[str] + :ivar features_rule: + :vartype features_rule: ~azure.mgmt.providerhub.models.ResourceProviderManifestFeaturesRule + :ivar request_header_options: + :vartype request_header_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestRequestHeaderOptions + :ivar resource_types: + :vartype resource_types: list[~azure.mgmt.providerhub.models.ResourceType] + :ivar management: + :vartype management: ~azure.mgmt.providerhub.models.ResourceProviderManifestManagement + :ivar capabilities: + :vartype capabilities: list[~azure.mgmt.providerhub.models.ResourceProviderCapabilities] + :ivar metadata: Anything. + :vartype metadata: any + :ivar global_notification_endpoints: + :vartype global_notification_endpoints: + list[~azure.mgmt.providerhub.models.ResourceProviderEndpoint] + :ivar re_register_subscription_metadata: + :vartype re_register_subscription_metadata: + ~azure.mgmt.providerhub.models.ResourceProviderManifestReRegisterSubscriptionMetadata + """ + + _attribute_map = { + 'provider_authentication': {'key': 'providerAuthentication', 'type': 'ResourceProviderManifestProviderAuthentication'}, + 'provider_authorizations': {'key': 'providerAuthorizations', 'type': '[ResourceProviderAuthorization]'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'provider_version': {'key': 'providerVersion', 'type': 'str'}, + 'provider_type': {'key': 'providerType', 'type': 'str'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'features_rule': {'key': 'featuresRule', 'type': 'ResourceProviderManifestFeaturesRule'}, + 'request_header_options': {'key': 'requestHeaderOptions', 'type': 'ResourceProviderManifestRequestHeaderOptions'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[ResourceType]'}, + 'management': {'key': 'management', 'type': 'ResourceProviderManifestManagement'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceProviderCapabilities]'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'global_notification_endpoints': {'key': 'globalNotificationEndpoints', 'type': '[ResourceProviderEndpoint]'}, + 're_register_subscription_metadata': {'key': 'reRegisterSubscriptionMetadata', 'type': 'ResourceProviderManifestReRegisterSubscriptionMetadata'}, + } + + def __init__( + self, + *, + provider_authentication: Optional["ResourceProviderManifestProviderAuthentication"] = None, + provider_authorizations: Optional[List["ResourceProviderAuthorization"]] = None, + namespace: Optional[str] = None, + provider_version: Optional[str] = None, + provider_type: Optional[Union[str, "ResourceProviderType"]] = None, + required_features: Optional[List[str]] = None, + features_rule: Optional["ResourceProviderManifestFeaturesRule"] = None, + request_header_options: Optional["ResourceProviderManifestRequestHeaderOptions"] = None, + resource_types: Optional[List["ResourceType"]] = None, + management: Optional["ResourceProviderManifestManagement"] = None, + capabilities: Optional[List["ResourceProviderCapabilities"]] = None, + metadata: Optional[Any] = None, + global_notification_endpoints: Optional[List["ResourceProviderEndpoint"]] = None, + re_register_subscription_metadata: Optional["ResourceProviderManifestReRegisterSubscriptionMetadata"] = None, + **kwargs + ): + """ + :keyword provider_authentication: + :paramtype provider_authentication: + ~azure.mgmt.providerhub.models.ResourceProviderManifestProviderAuthentication + :keyword provider_authorizations: + :paramtype provider_authorizations: + list[~azure.mgmt.providerhub.models.ResourceProviderAuthorization] + :keyword namespace: + :paramtype namespace: str + :keyword provider_version: + :paramtype provider_version: str + :keyword provider_type: Possible values include: "NotSpecified", "Internal", "External", + "Hidden", "RegistrationFree", "LegacyRegistrationRequired", "TenantOnly", "AuthorizationFree". + :paramtype provider_type: str or ~azure.mgmt.providerhub.models.ResourceProviderType + :keyword required_features: + :paramtype required_features: list[str] + :keyword features_rule: + :paramtype features_rule: ~azure.mgmt.providerhub.models.ResourceProviderManifestFeaturesRule + :keyword request_header_options: + :paramtype request_header_options: + ~azure.mgmt.providerhub.models.ResourceProviderManifestRequestHeaderOptions + :keyword resource_types: + :paramtype resource_types: list[~azure.mgmt.providerhub.models.ResourceType] + :keyword management: + :paramtype management: ~azure.mgmt.providerhub.models.ResourceProviderManifestManagement + :keyword capabilities: + :paramtype capabilities: list[~azure.mgmt.providerhub.models.ResourceProviderCapabilities] + :keyword metadata: Anything. + :paramtype metadata: any + :keyword global_notification_endpoints: + :paramtype global_notification_endpoints: + list[~azure.mgmt.providerhub.models.ResourceProviderEndpoint] + :keyword re_register_subscription_metadata: + :paramtype re_register_subscription_metadata: + ~azure.mgmt.providerhub.models.ResourceProviderManifestReRegisterSubscriptionMetadata + """ + super(ResourceProviderManifest, self).__init__(**kwargs) + self.provider_authentication = provider_authentication + self.provider_authorizations = provider_authorizations + self.namespace = namespace + self.provider_version = provider_version + self.provider_type = provider_type + self.required_features = required_features + self.features_rule = features_rule + self.request_header_options = request_header_options + self.resource_types = resource_types + self.management = management + self.capabilities = capabilities + self.metadata = metadata + self.global_notification_endpoints = global_notification_endpoints + self.re_register_subscription_metadata = re_register_subscription_metadata + + +class ResourceProviderManifestFeaturesRule(FeaturesRule): + """ResourceProviderManifestFeaturesRule. + + All required parameters must be populated in order to send to Azure. + + :ivar required_features_policy: Required. Possible values include: "Any", "All". + :vartype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + + _validation = { + 'required_features_policy': {'required': True}, + } + + _attribute_map = { + 'required_features_policy': {'key': 'requiredFeaturesPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + required_features_policy: Union[str, "FeaturesPolicy"], + **kwargs + ): + """ + :keyword required_features_policy: Required. Possible values include: "Any", "All". + :paramtype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + super(ResourceProviderManifestFeaturesRule, self).__init__(required_features_policy=required_features_policy, **kwargs) + + +class ResourceProviderManifestManagement(ResourceProviderManagement): + """ResourceProviderManifestManagement. + + :ivar schema_owners: + :vartype schema_owners: list[str] + :ivar manifest_owners: + :vartype manifest_owners: list[str] + :ivar incident_routing_service: + :vartype incident_routing_service: str + :ivar incident_routing_team: + :vartype incident_routing_team: str + :ivar incident_contact_email: + :vartype incident_contact_email: str + :ivar service_tree_infos: + :vartype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :ivar resource_access_policy: Possible values include: "NotSpecified", "AcisReadAllowed", + "AcisActionAllowed". + :vartype resource_access_policy: str or + ~azure.mgmt.providerhub.models.ResourceProviderManagementResourceAccessPolicy + :ivar resource_access_roles: + :vartype resource_access_roles: list[any] + """ + + _attribute_map = { + 'schema_owners': {'key': 'schemaOwners', 'type': '[str]'}, + 'manifest_owners': {'key': 'manifestOwners', 'type': '[str]'}, + 'incident_routing_service': {'key': 'incidentRoutingService', 'type': 'str'}, + 'incident_routing_team': {'key': 'incidentRoutingTeam', 'type': 'str'}, + 'incident_contact_email': {'key': 'incidentContactEmail', 'type': 'str'}, + 'service_tree_infos': {'key': 'serviceTreeInfos', 'type': '[ServiceTreeInfo]'}, + 'resource_access_policy': {'key': 'resourceAccessPolicy', 'type': 'str'}, + 'resource_access_roles': {'key': 'resourceAccessRoles', 'type': '[object]'}, + } + + def __init__( + self, + *, + schema_owners: Optional[List[str]] = None, + manifest_owners: Optional[List[str]] = None, + incident_routing_service: Optional[str] = None, + incident_routing_team: Optional[str] = None, + incident_contact_email: Optional[str] = None, + service_tree_infos: Optional[List["ServiceTreeInfo"]] = None, + resource_access_policy: Optional[Union[str, "ResourceProviderManagementResourceAccessPolicy"]] = None, + resource_access_roles: Optional[List[Any]] = None, + **kwargs + ): + """ + :keyword schema_owners: + :paramtype schema_owners: list[str] + :keyword manifest_owners: + :paramtype manifest_owners: list[str] + :keyword incident_routing_service: + :paramtype incident_routing_service: str + :keyword incident_routing_team: + :paramtype incident_routing_team: str + :keyword incident_contact_email: + :paramtype incident_contact_email: str + :keyword service_tree_infos: + :paramtype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :keyword resource_access_policy: Possible values include: "NotSpecified", "AcisReadAllowed", + "AcisActionAllowed". + :paramtype resource_access_policy: str or + ~azure.mgmt.providerhub.models.ResourceProviderManagementResourceAccessPolicy + :keyword resource_access_roles: + :paramtype resource_access_roles: list[any] + """ + super(ResourceProviderManifestManagement, self).__init__(schema_owners=schema_owners, manifest_owners=manifest_owners, incident_routing_service=incident_routing_service, incident_routing_team=incident_routing_team, incident_contact_email=incident_contact_email, service_tree_infos=service_tree_infos, resource_access_policy=resource_access_policy, resource_access_roles=resource_access_roles, **kwargs) + + +class ResourceProviderManifestPropertiesFeaturesRule(FeaturesRule): + """ResourceProviderManifestPropertiesFeaturesRule. + + All required parameters must be populated in order to send to Azure. + + :ivar required_features_policy: Required. Possible values include: "Any", "All". + :vartype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + + _validation = { + 'required_features_policy': {'required': True}, + } + + _attribute_map = { + 'required_features_policy': {'key': 'requiredFeaturesPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + required_features_policy: Union[str, "FeaturesPolicy"], + **kwargs + ): + """ + :keyword required_features_policy: Required. Possible values include: "Any", "All". + :paramtype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + super(ResourceProviderManifestPropertiesFeaturesRule, self).__init__(required_features_policy=required_features_policy, **kwargs) + + +class ResourceProviderManifestPropertiesManagement(ResourceProviderManagement): + """ResourceProviderManifestPropertiesManagement. + + :ivar schema_owners: + :vartype schema_owners: list[str] + :ivar manifest_owners: + :vartype manifest_owners: list[str] + :ivar incident_routing_service: + :vartype incident_routing_service: str + :ivar incident_routing_team: + :vartype incident_routing_team: str + :ivar incident_contact_email: + :vartype incident_contact_email: str + :ivar service_tree_infos: + :vartype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :ivar resource_access_policy: Possible values include: "NotSpecified", "AcisReadAllowed", + "AcisActionAllowed". + :vartype resource_access_policy: str or + ~azure.mgmt.providerhub.models.ResourceProviderManagementResourceAccessPolicy + :ivar resource_access_roles: + :vartype resource_access_roles: list[any] + """ + + _attribute_map = { + 'schema_owners': {'key': 'schemaOwners', 'type': '[str]'}, + 'manifest_owners': {'key': 'manifestOwners', 'type': '[str]'}, + 'incident_routing_service': {'key': 'incidentRoutingService', 'type': 'str'}, + 'incident_routing_team': {'key': 'incidentRoutingTeam', 'type': 'str'}, + 'incident_contact_email': {'key': 'incidentContactEmail', 'type': 'str'}, + 'service_tree_infos': {'key': 'serviceTreeInfos', 'type': '[ServiceTreeInfo]'}, + 'resource_access_policy': {'key': 'resourceAccessPolicy', 'type': 'str'}, + 'resource_access_roles': {'key': 'resourceAccessRoles', 'type': '[object]'}, + } + + def __init__( + self, + *, + schema_owners: Optional[List[str]] = None, + manifest_owners: Optional[List[str]] = None, + incident_routing_service: Optional[str] = None, + incident_routing_team: Optional[str] = None, + incident_contact_email: Optional[str] = None, + service_tree_infos: Optional[List["ServiceTreeInfo"]] = None, + resource_access_policy: Optional[Union[str, "ResourceProviderManagementResourceAccessPolicy"]] = None, + resource_access_roles: Optional[List[Any]] = None, + **kwargs + ): + """ + :keyword schema_owners: + :paramtype schema_owners: list[str] + :keyword manifest_owners: + :paramtype manifest_owners: list[str] + :keyword incident_routing_service: + :paramtype incident_routing_service: str + :keyword incident_routing_team: + :paramtype incident_routing_team: str + :keyword incident_contact_email: + :paramtype incident_contact_email: str + :keyword service_tree_infos: + :paramtype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :keyword resource_access_policy: Possible values include: "NotSpecified", "AcisReadAllowed", + "AcisActionAllowed". + :paramtype resource_access_policy: str or + ~azure.mgmt.providerhub.models.ResourceProviderManagementResourceAccessPolicy + :keyword resource_access_roles: + :paramtype resource_access_roles: list[any] + """ + super(ResourceProviderManifestPropertiesManagement, self).__init__(schema_owners=schema_owners, manifest_owners=manifest_owners, incident_routing_service=incident_routing_service, incident_routing_team=incident_routing_team, incident_contact_email=incident_contact_email, service_tree_infos=service_tree_infos, resource_access_policy=resource_access_policy, resource_access_roles=resource_access_roles, **kwargs) + + +class ResourceProviderManifestPropertiesProviderAuthentication(ResourceProviderAuthentication): + """ResourceProviderManifestPropertiesProviderAuthentication. + + All required parameters must be populated in order to send to Azure. + + :ivar allowed_audiences: Required. + :vartype allowed_audiences: list[str] + """ + + _validation = { + 'allowed_audiences': {'required': True}, + } + + _attribute_map = { + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + *, + allowed_audiences: List[str], + **kwargs + ): + """ + :keyword allowed_audiences: Required. + :paramtype allowed_audiences: list[str] + """ + super(ResourceProviderManifestPropertiesProviderAuthentication, self).__init__(allowed_audiences=allowed_audiences, **kwargs) + + +class ResourceProviderManifestPropertiesRequestHeaderOptions(RequestHeaderOptions): + """ResourceProviderManifestPropertiesRequestHeaderOptions. + + :ivar opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :vartype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + + _attribute_map = { + 'opt_in_headers': {'key': 'optInHeaders', 'type': 'str'}, + } + + def __init__( + self, + *, + opt_in_headers: Optional[Union[str, "OptInHeaderType"]] = None, + **kwargs + ): + """ + :keyword opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :paramtype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + super(ResourceProviderManifestPropertiesRequestHeaderOptions, self).__init__(opt_in_headers=opt_in_headers, **kwargs) + + +class TemplateDeploymentOptions(msrest.serialization.Model): + """TemplateDeploymentOptions. + + :ivar preflight_supported: + :vartype preflight_supported: bool + :ivar preflight_options: + :vartype preflight_options: list[str or ~azure.mgmt.providerhub.models.PreflightOption] + """ + + _attribute_map = { + 'preflight_supported': {'key': 'preflightSupported', 'type': 'bool'}, + 'preflight_options': {'key': 'preflightOptions', 'type': '[str]'}, + } + + def __init__( + self, + *, + preflight_supported: Optional[bool] = None, + preflight_options: Optional[List[Union[str, "PreflightOption"]]] = None, + **kwargs + ): + """ + :keyword preflight_supported: + :paramtype preflight_supported: bool + :keyword preflight_options: + :paramtype preflight_options: list[str or ~azure.mgmt.providerhub.models.PreflightOption] + """ + super(TemplateDeploymentOptions, self).__init__(**kwargs) + self.preflight_supported = preflight_supported + self.preflight_options = preflight_options + + +class ResourceProviderManifestPropertiesTemplateDeploymentOptions(TemplateDeploymentOptions): + """ResourceProviderManifestPropertiesTemplateDeploymentOptions. + + :ivar preflight_supported: + :vartype preflight_supported: bool + :ivar preflight_options: + :vartype preflight_options: list[str or ~azure.mgmt.providerhub.models.PreflightOption] + """ + + _attribute_map = { + 'preflight_supported': {'key': 'preflightSupported', 'type': 'bool'}, + 'preflight_options': {'key': 'preflightOptions', 'type': '[str]'}, + } + + def __init__( + self, + *, + preflight_supported: Optional[bool] = None, + preflight_options: Optional[List[Union[str, "PreflightOption"]]] = None, + **kwargs + ): + """ + :keyword preflight_supported: + :paramtype preflight_supported: bool + :keyword preflight_options: + :paramtype preflight_options: list[str or ~azure.mgmt.providerhub.models.PreflightOption] + """ + super(ResourceProviderManifestPropertiesTemplateDeploymentOptions, self).__init__(preflight_supported=preflight_supported, preflight_options=preflight_options, **kwargs) + + +class ResourceProviderManifestProviderAuthentication(ResourceProviderAuthentication): + """ResourceProviderManifestProviderAuthentication. + + All required parameters must be populated in order to send to Azure. + + :ivar allowed_audiences: Required. + :vartype allowed_audiences: list[str] + """ + + _validation = { + 'allowed_audiences': {'required': True}, + } + + _attribute_map = { + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + *, + allowed_audiences: List[str], + **kwargs + ): + """ + :keyword allowed_audiences: Required. + :paramtype allowed_audiences: list[str] + """ + super(ResourceProviderManifestProviderAuthentication, self).__init__(allowed_audiences=allowed_audiences, **kwargs) + + +class ResourceProviderManifestRequestHeaderOptions(RequestHeaderOptions): + """ResourceProviderManifestRequestHeaderOptions. + + :ivar opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :vartype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + + _attribute_map = { + 'opt_in_headers': {'key': 'optInHeaders', 'type': 'str'}, + } + + def __init__( + self, + *, + opt_in_headers: Optional[Union[str, "OptInHeaderType"]] = None, + **kwargs + ): + """ + :keyword opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :paramtype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + super(ResourceProviderManifestRequestHeaderOptions, self).__init__(opt_in_headers=opt_in_headers, **kwargs) + + +class ResourceProviderManifestReRegisterSubscriptionMetadata(ReRegisterSubscriptionMetadata): + """ResourceProviderManifestReRegisterSubscriptionMetadata. + + All required parameters must be populated in order to send to Azure. + + :ivar enabled: Required. + :vartype enabled: bool + :ivar concurrency_limit: + :vartype concurrency_limit: int + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'concurrency_limit': {'key': 'concurrencyLimit', 'type': 'int'}, + } + + def __init__( + self, + *, + enabled: bool, + concurrency_limit: Optional[int] = None, + **kwargs + ): + """ + :keyword enabled: Required. + :paramtype enabled: bool + :keyword concurrency_limit: + :paramtype concurrency_limit: int + """ + super(ResourceProviderManifestReRegisterSubscriptionMetadata, self).__init__(enabled=enabled, concurrency_limit=concurrency_limit, **kwargs) + + +class ResourceType(msrest.serialization.Model): + """ResourceType. + + :ivar name: + :vartype name: str + :ivar routing_type: Possible values include: "Default", "ProxyOnly", "HostBased", "Extension", + "Tenant", "Fanout", "LocationBased", "Failover", "CascadeExtension". + :vartype routing_type: str or ~azure.mgmt.providerhub.models.RoutingType + :ivar resource_validation: Possible values include: "NotSpecified", "ReservedWords", + "ProfaneWords". + :vartype resource_validation: str or ~azure.mgmt.providerhub.models.ResourceValidation + :ivar allowed_unauthorized_actions: + :vartype allowed_unauthorized_actions: list[str] + :ivar authorization_action_mappings: + :vartype authorization_action_mappings: + list[~azure.mgmt.providerhub.models.AuthorizationActionMapping] + :ivar linked_access_checks: + :vartype linked_access_checks: list[~azure.mgmt.providerhub.models.LinkedAccessCheck] + :ivar default_api_version: + :vartype default_api_version: str + :ivar logging_rules: + :vartype logging_rules: list[~azure.mgmt.providerhub.models.LoggingRule] + :ivar throttling_rules: + :vartype throttling_rules: list[~azure.mgmt.providerhub.models.ThrottlingRule] + :ivar endpoints: + :vartype endpoints: list[~azure.mgmt.providerhub.models.ResourceProviderEndpoint] + :ivar marketplace_type: Possible values include: "NotSpecified", "AddOn", "Bypass", "Store". + :vartype marketplace_type: str or ~azure.mgmt.providerhub.models.ResourceTypeMarketplaceType + :ivar identity_management: + :vartype identity_management: ~azure.mgmt.providerhub.models.ResourceTypeIdentityManagement + :ivar metadata: Anything. + :vartype metadata: any + :ivar required_features: + :vartype required_features: list[str] + :ivar features_rule: + :vartype features_rule: ~azure.mgmt.providerhub.models.ResourceTypeFeaturesRule + :ivar subscription_state_rules: + :vartype subscription_state_rules: list[~azure.mgmt.providerhub.models.SubscriptionStateRule] + :ivar service_tree_infos: + :vartype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :ivar request_header_options: + :vartype request_header_options: + ~azure.mgmt.providerhub.models.ResourceTypeRequestHeaderOptions + :ivar sku_link: + :vartype sku_link: str + :ivar disallowed_action_verbs: + :vartype disallowed_action_verbs: list[str] + :ivar template_deployment_policy: + :vartype template_deployment_policy: + ~azure.mgmt.providerhub.models.ResourceTypeTemplateDeploymentPolicy + :ivar extended_locations: + :vartype extended_locations: list[~azure.mgmt.providerhub.models.ExtendedLocationOptions] + :ivar linked_operation_rules: + :vartype linked_operation_rules: list[~azure.mgmt.providerhub.models.LinkedOperationRule] + :ivar resource_deletion_policy: Possible values include: "NotSpecified", "Cascade", "Force". + :vartype resource_deletion_policy: str or + ~azure.mgmt.providerhub.models.ManifestResourceDeletionPolicy + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'routing_type': {'key': 'routingType', 'type': 'str'}, + 'resource_validation': {'key': 'resourceValidation', 'type': 'str'}, + 'allowed_unauthorized_actions': {'key': 'allowedUnauthorizedActions', 'type': '[str]'}, + 'authorization_action_mappings': {'key': 'authorizationActionMappings', 'type': '[AuthorizationActionMapping]'}, + 'linked_access_checks': {'key': 'linkedAccessChecks', 'type': '[LinkedAccessCheck]'}, + 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'logging_rules': {'key': 'loggingRules', 'type': '[LoggingRule]'}, + 'throttling_rules': {'key': 'throttlingRules', 'type': '[ThrottlingRule]'}, + 'endpoints': {'key': 'endpoints', 'type': '[ResourceProviderEndpoint]'}, + 'marketplace_type': {'key': 'marketplaceType', 'type': 'str'}, + 'identity_management': {'key': 'identityManagement', 'type': 'ResourceTypeIdentityManagement'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'features_rule': {'key': 'featuresRule', 'type': 'ResourceTypeFeaturesRule'}, + 'subscription_state_rules': {'key': 'subscriptionStateRules', 'type': '[SubscriptionStateRule]'}, + 'service_tree_infos': {'key': 'serviceTreeInfos', 'type': '[ServiceTreeInfo]'}, + 'request_header_options': {'key': 'requestHeaderOptions', 'type': 'ResourceTypeRequestHeaderOptions'}, + 'sku_link': {'key': 'skuLink', 'type': 'str'}, + 'disallowed_action_verbs': {'key': 'disallowedActionVerbs', 'type': '[str]'}, + 'template_deployment_policy': {'key': 'templateDeploymentPolicy', 'type': 'ResourceTypeTemplateDeploymentPolicy'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[ExtendedLocationOptions]'}, + 'linked_operation_rules': {'key': 'linkedOperationRules', 'type': '[LinkedOperationRule]'}, + 'resource_deletion_policy': {'key': 'resourceDeletionPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + routing_type: Optional[Union[str, "RoutingType"]] = None, + resource_validation: Optional[Union[str, "ResourceValidation"]] = None, + allowed_unauthorized_actions: Optional[List[str]] = None, + authorization_action_mappings: Optional[List["AuthorizationActionMapping"]] = None, + linked_access_checks: Optional[List["LinkedAccessCheck"]] = None, + default_api_version: Optional[str] = None, + logging_rules: Optional[List["LoggingRule"]] = None, + throttling_rules: Optional[List["ThrottlingRule"]] = None, + endpoints: Optional[List["ResourceProviderEndpoint"]] = None, + marketplace_type: Optional[Union[str, "ResourceTypeMarketplaceType"]] = None, + identity_management: Optional["ResourceTypeIdentityManagement"] = None, + metadata: Optional[Any] = None, + required_features: Optional[List[str]] = None, + features_rule: Optional["ResourceTypeFeaturesRule"] = None, + subscription_state_rules: Optional[List["SubscriptionStateRule"]] = None, + service_tree_infos: Optional[List["ServiceTreeInfo"]] = None, + request_header_options: Optional["ResourceTypeRequestHeaderOptions"] = None, + sku_link: Optional[str] = None, + disallowed_action_verbs: Optional[List[str]] = None, + template_deployment_policy: Optional["ResourceTypeTemplateDeploymentPolicy"] = None, + extended_locations: Optional[List["ExtendedLocationOptions"]] = None, + linked_operation_rules: Optional[List["LinkedOperationRule"]] = None, + resource_deletion_policy: Optional[Union[str, "ManifestResourceDeletionPolicy"]] = None, + **kwargs + ): + """ + :keyword name: + :paramtype name: str + :keyword routing_type: Possible values include: "Default", "ProxyOnly", "HostBased", + "Extension", "Tenant", "Fanout", "LocationBased", "Failover", "CascadeExtension". + :paramtype routing_type: str or ~azure.mgmt.providerhub.models.RoutingType + :keyword resource_validation: Possible values include: "NotSpecified", "ReservedWords", + "ProfaneWords". + :paramtype resource_validation: str or ~azure.mgmt.providerhub.models.ResourceValidation + :keyword allowed_unauthorized_actions: + :paramtype allowed_unauthorized_actions: list[str] + :keyword authorization_action_mappings: + :paramtype authorization_action_mappings: + list[~azure.mgmt.providerhub.models.AuthorizationActionMapping] + :keyword linked_access_checks: + :paramtype linked_access_checks: list[~azure.mgmt.providerhub.models.LinkedAccessCheck] + :keyword default_api_version: + :paramtype default_api_version: str + :keyword logging_rules: + :paramtype logging_rules: list[~azure.mgmt.providerhub.models.LoggingRule] + :keyword throttling_rules: + :paramtype throttling_rules: list[~azure.mgmt.providerhub.models.ThrottlingRule] + :keyword endpoints: + :paramtype endpoints: list[~azure.mgmt.providerhub.models.ResourceProviderEndpoint] + :keyword marketplace_type: Possible values include: "NotSpecified", "AddOn", "Bypass", "Store". + :paramtype marketplace_type: str or ~azure.mgmt.providerhub.models.ResourceTypeMarketplaceType + :keyword identity_management: + :paramtype identity_management: ~azure.mgmt.providerhub.models.ResourceTypeIdentityManagement + :keyword metadata: Anything. + :paramtype metadata: any + :keyword required_features: + :paramtype required_features: list[str] + :keyword features_rule: + :paramtype features_rule: ~azure.mgmt.providerhub.models.ResourceTypeFeaturesRule + :keyword subscription_state_rules: + :paramtype subscription_state_rules: list[~azure.mgmt.providerhub.models.SubscriptionStateRule] + :keyword service_tree_infos: + :paramtype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :keyword request_header_options: + :paramtype request_header_options: + ~azure.mgmt.providerhub.models.ResourceTypeRequestHeaderOptions + :keyword sku_link: + :paramtype sku_link: str + :keyword disallowed_action_verbs: + :paramtype disallowed_action_verbs: list[str] + :keyword template_deployment_policy: + :paramtype template_deployment_policy: + ~azure.mgmt.providerhub.models.ResourceTypeTemplateDeploymentPolicy + :keyword extended_locations: + :paramtype extended_locations: list[~azure.mgmt.providerhub.models.ExtendedLocationOptions] + :keyword linked_operation_rules: + :paramtype linked_operation_rules: list[~azure.mgmt.providerhub.models.LinkedOperationRule] + :keyword resource_deletion_policy: Possible values include: "NotSpecified", "Cascade", "Force". + :paramtype resource_deletion_policy: str or + ~azure.mgmt.providerhub.models.ManifestResourceDeletionPolicy + """ + super(ResourceType, self).__init__(**kwargs) + self.name = name + self.routing_type = routing_type + self.resource_validation = resource_validation + self.allowed_unauthorized_actions = allowed_unauthorized_actions + self.authorization_action_mappings = authorization_action_mappings + self.linked_access_checks = linked_access_checks + self.default_api_version = default_api_version + self.logging_rules = logging_rules + self.throttling_rules = throttling_rules + self.endpoints = endpoints + self.marketplace_type = marketplace_type + self.identity_management = identity_management + self.metadata = metadata + self.required_features = required_features + self.features_rule = features_rule + self.subscription_state_rules = subscription_state_rules + self.service_tree_infos = service_tree_infos + self.request_header_options = request_header_options + self.sku_link = sku_link + self.disallowed_action_verbs = disallowed_action_verbs + self.template_deployment_policy = template_deployment_policy + self.extended_locations = extended_locations + self.linked_operation_rules = linked_operation_rules + self.resource_deletion_policy = resource_deletion_policy + + +class ResourceTypeEndpoint(msrest.serialization.Model): + """ResourceTypeEndpoint. + + :ivar enabled: + :vartype enabled: bool + :ivar api_versions: + :vartype api_versions: list[str] + :ivar locations: + :vartype locations: list[str] + :ivar required_features: + :vartype required_features: list[str] + :ivar features_rule: + :vartype features_rule: ~azure.mgmt.providerhub.models.ResourceTypeEndpointFeaturesRule + :ivar extensions: + :vartype extensions: list[~azure.mgmt.providerhub.models.ResourceTypeExtension] + :ivar timeout: + :vartype timeout: ~datetime.timedelta + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'features_rule': {'key': 'featuresRule', 'type': 'ResourceTypeEndpointFeaturesRule'}, + 'extensions': {'key': 'extensions', 'type': '[ResourceTypeExtension]'}, + 'timeout': {'key': 'timeout', 'type': 'duration'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + api_versions: Optional[List[str]] = None, + locations: Optional[List[str]] = None, + required_features: Optional[List[str]] = None, + features_rule: Optional["ResourceTypeEndpointFeaturesRule"] = None, + extensions: Optional[List["ResourceTypeExtension"]] = None, + timeout: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword enabled: + :paramtype enabled: bool + :keyword api_versions: + :paramtype api_versions: list[str] + :keyword locations: + :paramtype locations: list[str] + :keyword required_features: + :paramtype required_features: list[str] + :keyword features_rule: + :paramtype features_rule: ~azure.mgmt.providerhub.models.ResourceTypeEndpointFeaturesRule + :keyword extensions: + :paramtype extensions: list[~azure.mgmt.providerhub.models.ResourceTypeExtension] + :keyword timeout: + :paramtype timeout: ~datetime.timedelta + """ + super(ResourceTypeEndpoint, self).__init__(**kwargs) + self.enabled = enabled + self.api_versions = api_versions + self.locations = locations + self.required_features = required_features + self.features_rule = features_rule + self.extensions = extensions + self.timeout = timeout + + +class ResourceTypeEndpointFeaturesRule(FeaturesRule): + """ResourceTypeEndpointFeaturesRule. + + All required parameters must be populated in order to send to Azure. + + :ivar required_features_policy: Required. Possible values include: "Any", "All". + :vartype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + + _validation = { + 'required_features_policy': {'required': True}, + } + + _attribute_map = { + 'required_features_policy': {'key': 'requiredFeaturesPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + required_features_policy: Union[str, "FeaturesPolicy"], + **kwargs + ): + """ + :keyword required_features_policy: Required. Possible values include: "Any", "All". + :paramtype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + super(ResourceTypeEndpointFeaturesRule, self).__init__(required_features_policy=required_features_policy, **kwargs) + + +class ResourceTypeExtension(msrest.serialization.Model): + """ResourceTypeExtension. + + :ivar endpoint_uri: + :vartype endpoint_uri: str + :ivar extension_categories: + :vartype extension_categories: list[str or ~azure.mgmt.providerhub.models.ExtensionCategory] + :ivar timeout: + :vartype timeout: ~datetime.timedelta + """ + + _attribute_map = { + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + 'extension_categories': {'key': 'extensionCategories', 'type': '[str]'}, + 'timeout': {'key': 'timeout', 'type': 'duration'}, + } + + def __init__( + self, + *, + endpoint_uri: Optional[str] = None, + extension_categories: Optional[List[Union[str, "ExtensionCategory"]]] = None, + timeout: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword endpoint_uri: + :paramtype endpoint_uri: str + :keyword extension_categories: + :paramtype extension_categories: list[str or ~azure.mgmt.providerhub.models.ExtensionCategory] + :keyword timeout: + :paramtype timeout: ~datetime.timedelta + """ + super(ResourceTypeExtension, self).__init__(**kwargs) + self.endpoint_uri = endpoint_uri + self.extension_categories = extension_categories + self.timeout = timeout + + +class ResourceTypeExtensionOptions(msrest.serialization.Model): + """ResourceTypeExtensionOptions. + + :ivar resource_creation_begin: + :vartype resource_creation_begin: + ~azure.mgmt.providerhub.models.ResourceTypeExtensionOptionsResourceCreationBegin + """ + + _attribute_map = { + 'resource_creation_begin': {'key': 'resourceCreationBegin', 'type': 'ResourceTypeExtensionOptionsResourceCreationBegin'}, + } + + def __init__( + self, + *, + resource_creation_begin: Optional["ResourceTypeExtensionOptionsResourceCreationBegin"] = None, + **kwargs + ): + """ + :keyword resource_creation_begin: + :paramtype resource_creation_begin: + ~azure.mgmt.providerhub.models.ResourceTypeExtensionOptionsResourceCreationBegin + """ + super(ResourceTypeExtensionOptions, self).__init__(**kwargs) + self.resource_creation_begin = resource_creation_begin + + +class ResourceTypeExtensionOptionsResourceCreationBegin(ExtensionOptions): + """ResourceTypeExtensionOptionsResourceCreationBegin. + + :ivar request: + :vartype request: list[str or ~azure.mgmt.providerhub.models.ExtensionOptionType] + :ivar response: + :vartype response: list[str or ~azure.mgmt.providerhub.models.ExtensionOptionType] + """ + + _attribute_map = { + 'request': {'key': 'request', 'type': '[str]'}, + 'response': {'key': 'response', 'type': '[str]'}, + } + + def __init__( + self, + *, + request: Optional[List[Union[str, "ExtensionOptionType"]]] = None, + response: Optional[List[Union[str, "ExtensionOptionType"]]] = None, + **kwargs + ): + """ + :keyword request: + :paramtype request: list[str or ~azure.mgmt.providerhub.models.ExtensionOptionType] + :keyword response: + :paramtype response: list[str or ~azure.mgmt.providerhub.models.ExtensionOptionType] + """ + super(ResourceTypeExtensionOptionsResourceCreationBegin, self).__init__(request=request, response=response, **kwargs) + + +class ResourceTypeFeaturesRule(FeaturesRule): + """ResourceTypeFeaturesRule. + + All required parameters must be populated in order to send to Azure. + + :ivar required_features_policy: Required. Possible values include: "Any", "All". + :vartype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + + _validation = { + 'required_features_policy': {'required': True}, + } + + _attribute_map = { + 'required_features_policy': {'key': 'requiredFeaturesPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + required_features_policy: Union[str, "FeaturesPolicy"], + **kwargs + ): + """ + :keyword required_features_policy: Required. Possible values include: "Any", "All". + :paramtype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + super(ResourceTypeFeaturesRule, self).__init__(required_features_policy=required_features_policy, **kwargs) + + +class ResourceTypeIdentityManagement(IdentityManagement): + """ResourceTypeIdentityManagement. + + :ivar type: Possible values include: "NotSpecified", "SystemAssigned", "UserAssigned", "Actor", + "DelegatedResourceIdentity". + :vartype type: str or ~azure.mgmt.providerhub.models.IdentityManagementTypes + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "IdentityManagementTypes"]] = None, + **kwargs + ): + """ + :keyword type: Possible values include: "NotSpecified", "SystemAssigned", "UserAssigned", + "Actor", "DelegatedResourceIdentity". + :paramtype type: str or ~azure.mgmt.providerhub.models.IdentityManagementTypes + """ + super(ResourceTypeIdentityManagement, self).__init__(type=type, **kwargs) + + +class ResourceTypeRegistration(ProxyResource): + """ResourceTypeRegistration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar properties: + :vartype properties: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesAutoGenerated + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ResourceTypeRegistrationPropertiesAutoGenerated'}, + } + + def __init__( + self, + *, + properties: Optional["ResourceTypeRegistrationPropertiesAutoGenerated"] = None, + **kwargs + ): + """ + :keyword properties: + :paramtype properties: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesAutoGenerated + """ + super(ResourceTypeRegistration, self).__init__(**kwargs) + self.properties = properties + + +class ResourceTypeRegistrationArrayResponseWithContinuation(msrest.serialization.Model): + """ResourceTypeRegistrationArrayResponseWithContinuation. + + :ivar value: + :vartype value: list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + :ivar next_link: The URL to get to the next set of results, if there are any. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceTypeRegistration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ResourceTypeRegistration"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + :keyword next_link: The URL to get to the next set of results, if there are any. + :paramtype next_link: str + """ + super(ResourceTypeRegistrationArrayResponseWithContinuation, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ResourceTypeRegistrationProperties(msrest.serialization.Model): + """ResourceTypeRegistrationProperties. + + :ivar routing_type: Possible values include: "Default", "ProxyOnly", "HostBased", "Extension", + "Tenant", "Fanout", "LocationBased", "Failover", "CascadeExtension". + :vartype routing_type: str or ~azure.mgmt.providerhub.models.RoutingType + :ivar regionality: Possible values include: "NotSpecified", "Global", "Regional". + :vartype regionality: str or ~azure.mgmt.providerhub.models.Regionality + :ivar endpoints: + :vartype endpoints: list[~azure.mgmt.providerhub.models.ResourceTypeEndpoint] + :ivar extension_options: + :vartype extension_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesExtensionOptions + :ivar marketplace_type: Possible values include: "NotSpecified", "AddOn", "Bypass", "Store". + :vartype marketplace_type: str or + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesMarketplaceType + :ivar swagger_specifications: + :vartype swagger_specifications: list[~azure.mgmt.providerhub.models.SwaggerSpecification] + :ivar allowed_unauthorized_actions: + :vartype allowed_unauthorized_actions: list[str] + :ivar authorization_action_mappings: + :vartype authorization_action_mappings: + list[~azure.mgmt.providerhub.models.AuthorizationActionMapping] + :ivar linked_access_checks: + :vartype linked_access_checks: list[~azure.mgmt.providerhub.models.LinkedAccessCheck] + :ivar default_api_version: + :vartype default_api_version: str + :ivar logging_rules: + :vartype logging_rules: list[~azure.mgmt.providerhub.models.LoggingRule] + :ivar throttling_rules: + :vartype throttling_rules: list[~azure.mgmt.providerhub.models.ThrottlingRule] + :ivar required_features: + :vartype required_features: list[str] + :ivar features_rule: + :vartype features_rule: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesFeaturesRule + :ivar enable_async_operation: + :vartype enable_async_operation: bool + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :ivar enable_third_party_s2_s: + :vartype enable_third_party_s2_s: bool + :ivar subscription_lifecycle_notification_specifications: + :vartype subscription_lifecycle_notification_specifications: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + :ivar is_pure_proxy: + :vartype is_pure_proxy: bool + :ivar identity_management: + :vartype identity_management: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesIdentityManagement + :ivar check_name_availability_specifications: + :vartype check_name_availability_specifications: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications + :ivar disallowed_action_verbs: + :vartype disallowed_action_verbs: list[str] + :ivar service_tree_infos: + :vartype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :ivar request_header_options: + :vartype request_header_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesRequestHeaderOptions + :ivar subscription_state_rules: + :vartype subscription_state_rules: list[~azure.mgmt.providerhub.models.SubscriptionStateRule] + :ivar template_deployment_options: + :vartype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesTemplateDeploymentOptions + :ivar extended_locations: + :vartype extended_locations: list[~azure.mgmt.providerhub.models.ExtendedLocationOptions] + :ivar resource_move_policy: + :vartype resource_move_policy: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesResourceMovePolicy + :ivar resource_deletion_policy: Possible values include: "NotSpecified", "CascadeDeleteAll", + "CascadeDeleteProxyOnlyChildren". + :vartype resource_deletion_policy: str or ~azure.mgmt.providerhub.models.ResourceDeletionPolicy + """ + + _attribute_map = { + 'routing_type': {'key': 'routingType', 'type': 'str'}, + 'regionality': {'key': 'regionality', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[ResourceTypeEndpoint]'}, + 'extension_options': {'key': 'extensionOptions', 'type': 'ResourceTypeRegistrationPropertiesExtensionOptions'}, + 'marketplace_type': {'key': 'marketplaceType', 'type': 'str'}, + 'swagger_specifications': {'key': 'swaggerSpecifications', 'type': '[SwaggerSpecification]'}, + 'allowed_unauthorized_actions': {'key': 'allowedUnauthorizedActions', 'type': '[str]'}, + 'authorization_action_mappings': {'key': 'authorizationActionMappings', 'type': '[AuthorizationActionMapping]'}, + 'linked_access_checks': {'key': 'linkedAccessChecks', 'type': '[LinkedAccessCheck]'}, + 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'logging_rules': {'key': 'loggingRules', 'type': '[LoggingRule]'}, + 'throttling_rules': {'key': 'throttlingRules', 'type': '[ThrottlingRule]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'features_rule': {'key': 'featuresRule', 'type': 'ResourceTypeRegistrationPropertiesFeaturesRule'}, + 'enable_async_operation': {'key': 'enableAsyncOperation', 'type': 'bool'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'enable_third_party_s2_s': {'key': 'enableThirdPartyS2S', 'type': 'bool'}, + 'subscription_lifecycle_notification_specifications': {'key': 'subscriptionLifecycleNotificationSpecifications', 'type': 'ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications'}, + 'is_pure_proxy': {'key': 'isPureProxy', 'type': 'bool'}, + 'identity_management': {'key': 'identityManagement', 'type': 'ResourceTypeRegistrationPropertiesIdentityManagement'}, + 'check_name_availability_specifications': {'key': 'checkNameAvailabilitySpecifications', 'type': 'ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications'}, + 'disallowed_action_verbs': {'key': 'disallowedActionVerbs', 'type': '[str]'}, + 'service_tree_infos': {'key': 'serviceTreeInfos', 'type': '[ServiceTreeInfo]'}, + 'request_header_options': {'key': 'requestHeaderOptions', 'type': 'ResourceTypeRegistrationPropertiesRequestHeaderOptions'}, + 'subscription_state_rules': {'key': 'subscriptionStateRules', 'type': '[SubscriptionStateRule]'}, + 'template_deployment_options': {'key': 'templateDeploymentOptions', 'type': 'ResourceTypeRegistrationPropertiesTemplateDeploymentOptions'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[ExtendedLocationOptions]'}, + 'resource_move_policy': {'key': 'resourceMovePolicy', 'type': 'ResourceTypeRegistrationPropertiesResourceMovePolicy'}, + 'resource_deletion_policy': {'key': 'resourceDeletionPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + routing_type: Optional[Union[str, "RoutingType"]] = None, + regionality: Optional[Union[str, "Regionality"]] = None, + endpoints: Optional[List["ResourceTypeEndpoint"]] = None, + extension_options: Optional["ResourceTypeRegistrationPropertiesExtensionOptions"] = None, + marketplace_type: Optional[Union[str, "ResourceTypeRegistrationPropertiesMarketplaceType"]] = None, + swagger_specifications: Optional[List["SwaggerSpecification"]] = None, + allowed_unauthorized_actions: Optional[List[str]] = None, + authorization_action_mappings: Optional[List["AuthorizationActionMapping"]] = None, + linked_access_checks: Optional[List["LinkedAccessCheck"]] = None, + default_api_version: Optional[str] = None, + logging_rules: Optional[List["LoggingRule"]] = None, + throttling_rules: Optional[List["ThrottlingRule"]] = None, + required_features: Optional[List[str]] = None, + features_rule: Optional["ResourceTypeRegistrationPropertiesFeaturesRule"] = None, + enable_async_operation: Optional[bool] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + enable_third_party_s2_s: Optional[bool] = None, + subscription_lifecycle_notification_specifications: Optional["ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications"] = None, + is_pure_proxy: Optional[bool] = None, + identity_management: Optional["ResourceTypeRegistrationPropertiesIdentityManagement"] = None, + check_name_availability_specifications: Optional["ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications"] = None, + disallowed_action_verbs: Optional[List[str]] = None, + service_tree_infos: Optional[List["ServiceTreeInfo"]] = None, + request_header_options: Optional["ResourceTypeRegistrationPropertiesRequestHeaderOptions"] = None, + subscription_state_rules: Optional[List["SubscriptionStateRule"]] = None, + template_deployment_options: Optional["ResourceTypeRegistrationPropertiesTemplateDeploymentOptions"] = None, + extended_locations: Optional[List["ExtendedLocationOptions"]] = None, + resource_move_policy: Optional["ResourceTypeRegistrationPropertiesResourceMovePolicy"] = None, + resource_deletion_policy: Optional[Union[str, "ResourceDeletionPolicy"]] = None, + **kwargs + ): + """ + :keyword routing_type: Possible values include: "Default", "ProxyOnly", "HostBased", + "Extension", "Tenant", "Fanout", "LocationBased", "Failover", "CascadeExtension". + :paramtype routing_type: str or ~azure.mgmt.providerhub.models.RoutingType + :keyword regionality: Possible values include: "NotSpecified", "Global", "Regional". + :paramtype regionality: str or ~azure.mgmt.providerhub.models.Regionality + :keyword endpoints: + :paramtype endpoints: list[~azure.mgmt.providerhub.models.ResourceTypeEndpoint] + :keyword extension_options: + :paramtype extension_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesExtensionOptions + :keyword marketplace_type: Possible values include: "NotSpecified", "AddOn", "Bypass", "Store". + :paramtype marketplace_type: str or + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesMarketplaceType + :keyword swagger_specifications: + :paramtype swagger_specifications: list[~azure.mgmt.providerhub.models.SwaggerSpecification] + :keyword allowed_unauthorized_actions: + :paramtype allowed_unauthorized_actions: list[str] + :keyword authorization_action_mappings: + :paramtype authorization_action_mappings: + list[~azure.mgmt.providerhub.models.AuthorizationActionMapping] + :keyword linked_access_checks: + :paramtype linked_access_checks: list[~azure.mgmt.providerhub.models.LinkedAccessCheck] + :keyword default_api_version: + :paramtype default_api_version: str + :keyword logging_rules: + :paramtype logging_rules: list[~azure.mgmt.providerhub.models.LoggingRule] + :keyword throttling_rules: + :paramtype throttling_rules: list[~azure.mgmt.providerhub.models.ThrottlingRule] + :keyword required_features: + :paramtype required_features: list[str] + :keyword features_rule: + :paramtype features_rule: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesFeaturesRule + :keyword enable_async_operation: + :paramtype enable_async_operation: bool + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :keyword enable_third_party_s2_s: + :paramtype enable_third_party_s2_s: bool + :keyword subscription_lifecycle_notification_specifications: + :paramtype subscription_lifecycle_notification_specifications: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + :keyword is_pure_proxy: + :paramtype is_pure_proxy: bool + :keyword identity_management: + :paramtype identity_management: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesIdentityManagement + :keyword check_name_availability_specifications: + :paramtype check_name_availability_specifications: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications + :keyword disallowed_action_verbs: + :paramtype disallowed_action_verbs: list[str] + :keyword service_tree_infos: + :paramtype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :keyword request_header_options: + :paramtype request_header_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesRequestHeaderOptions + :keyword subscription_state_rules: + :paramtype subscription_state_rules: list[~azure.mgmt.providerhub.models.SubscriptionStateRule] + :keyword template_deployment_options: + :paramtype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesTemplateDeploymentOptions + :keyword extended_locations: + :paramtype extended_locations: list[~azure.mgmt.providerhub.models.ExtendedLocationOptions] + :keyword resource_move_policy: + :paramtype resource_move_policy: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesResourceMovePolicy + :keyword resource_deletion_policy: Possible values include: "NotSpecified", "CascadeDeleteAll", + "CascadeDeleteProxyOnlyChildren". + :paramtype resource_deletion_policy: str or + ~azure.mgmt.providerhub.models.ResourceDeletionPolicy + """ + super(ResourceTypeRegistrationProperties, self).__init__(**kwargs) + self.routing_type = routing_type + self.regionality = regionality + self.endpoints = endpoints + self.extension_options = extension_options + self.marketplace_type = marketplace_type + self.swagger_specifications = swagger_specifications + self.allowed_unauthorized_actions = allowed_unauthorized_actions + self.authorization_action_mappings = authorization_action_mappings + self.linked_access_checks = linked_access_checks + self.default_api_version = default_api_version + self.logging_rules = logging_rules + self.throttling_rules = throttling_rules + self.required_features = required_features + self.features_rule = features_rule + self.enable_async_operation = enable_async_operation + self.provisioning_state = provisioning_state + self.enable_third_party_s2_s = enable_third_party_s2_s + self.subscription_lifecycle_notification_specifications = subscription_lifecycle_notification_specifications + self.is_pure_proxy = is_pure_proxy + self.identity_management = identity_management + self.check_name_availability_specifications = check_name_availability_specifications + self.disallowed_action_verbs = disallowed_action_verbs + self.service_tree_infos = service_tree_infos + self.request_header_options = request_header_options + self.subscription_state_rules = subscription_state_rules + self.template_deployment_options = template_deployment_options + self.extended_locations = extended_locations + self.resource_move_policy = resource_move_policy + self.resource_deletion_policy = resource_deletion_policy + + +class ResourceTypeRegistrationPropertiesAutoGenerated(ResourceTypeRegistrationProperties): + """ResourceTypeRegistrationPropertiesAutoGenerated. + + :ivar routing_type: Possible values include: "Default", "ProxyOnly", "HostBased", "Extension", + "Tenant", "Fanout", "LocationBased", "Failover", "CascadeExtension". + :vartype routing_type: str or ~azure.mgmt.providerhub.models.RoutingType + :ivar regionality: Possible values include: "NotSpecified", "Global", "Regional". + :vartype regionality: str or ~azure.mgmt.providerhub.models.Regionality + :ivar endpoints: + :vartype endpoints: list[~azure.mgmt.providerhub.models.ResourceTypeEndpoint] + :ivar extension_options: + :vartype extension_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesExtensionOptions + :ivar marketplace_type: Possible values include: "NotSpecified", "AddOn", "Bypass", "Store". + :vartype marketplace_type: str or + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesMarketplaceType + :ivar swagger_specifications: + :vartype swagger_specifications: list[~azure.mgmt.providerhub.models.SwaggerSpecification] + :ivar allowed_unauthorized_actions: + :vartype allowed_unauthorized_actions: list[str] + :ivar authorization_action_mappings: + :vartype authorization_action_mappings: + list[~azure.mgmt.providerhub.models.AuthorizationActionMapping] + :ivar linked_access_checks: + :vartype linked_access_checks: list[~azure.mgmt.providerhub.models.LinkedAccessCheck] + :ivar default_api_version: + :vartype default_api_version: str + :ivar logging_rules: + :vartype logging_rules: list[~azure.mgmt.providerhub.models.LoggingRule] + :ivar throttling_rules: + :vartype throttling_rules: list[~azure.mgmt.providerhub.models.ThrottlingRule] + :ivar required_features: + :vartype required_features: list[str] + :ivar features_rule: + :vartype features_rule: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesFeaturesRule + :ivar enable_async_operation: + :vartype enable_async_operation: bool + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :ivar enable_third_party_s2_s: + :vartype enable_third_party_s2_s: bool + :ivar subscription_lifecycle_notification_specifications: + :vartype subscription_lifecycle_notification_specifications: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + :ivar is_pure_proxy: + :vartype is_pure_proxy: bool + :ivar identity_management: + :vartype identity_management: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesIdentityManagement + :ivar check_name_availability_specifications: + :vartype check_name_availability_specifications: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications + :ivar disallowed_action_verbs: + :vartype disallowed_action_verbs: list[str] + :ivar service_tree_infos: + :vartype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :ivar request_header_options: + :vartype request_header_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesRequestHeaderOptions + :ivar subscription_state_rules: + :vartype subscription_state_rules: list[~azure.mgmt.providerhub.models.SubscriptionStateRule] + :ivar template_deployment_options: + :vartype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesTemplateDeploymentOptions + :ivar extended_locations: + :vartype extended_locations: list[~azure.mgmt.providerhub.models.ExtendedLocationOptions] + :ivar resource_move_policy: + :vartype resource_move_policy: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesResourceMovePolicy + :ivar resource_deletion_policy: Possible values include: "NotSpecified", "CascadeDeleteAll", + "CascadeDeleteProxyOnlyChildren". + :vartype resource_deletion_policy: str or ~azure.mgmt.providerhub.models.ResourceDeletionPolicy + """ + + _attribute_map = { + 'routing_type': {'key': 'routingType', 'type': 'str'}, + 'regionality': {'key': 'regionality', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[ResourceTypeEndpoint]'}, + 'extension_options': {'key': 'extensionOptions', 'type': 'ResourceTypeRegistrationPropertiesExtensionOptions'}, + 'marketplace_type': {'key': 'marketplaceType', 'type': 'str'}, + 'swagger_specifications': {'key': 'swaggerSpecifications', 'type': '[SwaggerSpecification]'}, + 'allowed_unauthorized_actions': {'key': 'allowedUnauthorizedActions', 'type': '[str]'}, + 'authorization_action_mappings': {'key': 'authorizationActionMappings', 'type': '[AuthorizationActionMapping]'}, + 'linked_access_checks': {'key': 'linkedAccessChecks', 'type': '[LinkedAccessCheck]'}, + 'default_api_version': {'key': 'defaultApiVersion', 'type': 'str'}, + 'logging_rules': {'key': 'loggingRules', 'type': '[LoggingRule]'}, + 'throttling_rules': {'key': 'throttlingRules', 'type': '[ThrottlingRule]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'features_rule': {'key': 'featuresRule', 'type': 'ResourceTypeRegistrationPropertiesFeaturesRule'}, + 'enable_async_operation': {'key': 'enableAsyncOperation', 'type': 'bool'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'enable_third_party_s2_s': {'key': 'enableThirdPartyS2S', 'type': 'bool'}, + 'subscription_lifecycle_notification_specifications': {'key': 'subscriptionLifecycleNotificationSpecifications', 'type': 'ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications'}, + 'is_pure_proxy': {'key': 'isPureProxy', 'type': 'bool'}, + 'identity_management': {'key': 'identityManagement', 'type': 'ResourceTypeRegistrationPropertiesIdentityManagement'}, + 'check_name_availability_specifications': {'key': 'checkNameAvailabilitySpecifications', 'type': 'ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications'}, + 'disallowed_action_verbs': {'key': 'disallowedActionVerbs', 'type': '[str]'}, + 'service_tree_infos': {'key': 'serviceTreeInfos', 'type': '[ServiceTreeInfo]'}, + 'request_header_options': {'key': 'requestHeaderOptions', 'type': 'ResourceTypeRegistrationPropertiesRequestHeaderOptions'}, + 'subscription_state_rules': {'key': 'subscriptionStateRules', 'type': '[SubscriptionStateRule]'}, + 'template_deployment_options': {'key': 'templateDeploymentOptions', 'type': 'ResourceTypeRegistrationPropertiesTemplateDeploymentOptions'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[ExtendedLocationOptions]'}, + 'resource_move_policy': {'key': 'resourceMovePolicy', 'type': 'ResourceTypeRegistrationPropertiesResourceMovePolicy'}, + 'resource_deletion_policy': {'key': 'resourceDeletionPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + routing_type: Optional[Union[str, "RoutingType"]] = None, + regionality: Optional[Union[str, "Regionality"]] = None, + endpoints: Optional[List["ResourceTypeEndpoint"]] = None, + extension_options: Optional["ResourceTypeRegistrationPropertiesExtensionOptions"] = None, + marketplace_type: Optional[Union[str, "ResourceTypeRegistrationPropertiesMarketplaceType"]] = None, + swagger_specifications: Optional[List["SwaggerSpecification"]] = None, + allowed_unauthorized_actions: Optional[List[str]] = None, + authorization_action_mappings: Optional[List["AuthorizationActionMapping"]] = None, + linked_access_checks: Optional[List["LinkedAccessCheck"]] = None, + default_api_version: Optional[str] = None, + logging_rules: Optional[List["LoggingRule"]] = None, + throttling_rules: Optional[List["ThrottlingRule"]] = None, + required_features: Optional[List[str]] = None, + features_rule: Optional["ResourceTypeRegistrationPropertiesFeaturesRule"] = None, + enable_async_operation: Optional[bool] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + enable_third_party_s2_s: Optional[bool] = None, + subscription_lifecycle_notification_specifications: Optional["ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications"] = None, + is_pure_proxy: Optional[bool] = None, + identity_management: Optional["ResourceTypeRegistrationPropertiesIdentityManagement"] = None, + check_name_availability_specifications: Optional["ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications"] = None, + disallowed_action_verbs: Optional[List[str]] = None, + service_tree_infos: Optional[List["ServiceTreeInfo"]] = None, + request_header_options: Optional["ResourceTypeRegistrationPropertiesRequestHeaderOptions"] = None, + subscription_state_rules: Optional[List["SubscriptionStateRule"]] = None, + template_deployment_options: Optional["ResourceTypeRegistrationPropertiesTemplateDeploymentOptions"] = None, + extended_locations: Optional[List["ExtendedLocationOptions"]] = None, + resource_move_policy: Optional["ResourceTypeRegistrationPropertiesResourceMovePolicy"] = None, + resource_deletion_policy: Optional[Union[str, "ResourceDeletionPolicy"]] = None, + **kwargs + ): + """ + :keyword routing_type: Possible values include: "Default", "ProxyOnly", "HostBased", + "Extension", "Tenant", "Fanout", "LocationBased", "Failover", "CascadeExtension". + :paramtype routing_type: str or ~azure.mgmt.providerhub.models.RoutingType + :keyword regionality: Possible values include: "NotSpecified", "Global", "Regional". + :paramtype regionality: str or ~azure.mgmt.providerhub.models.Regionality + :keyword endpoints: + :paramtype endpoints: list[~azure.mgmt.providerhub.models.ResourceTypeEndpoint] + :keyword extension_options: + :paramtype extension_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesExtensionOptions + :keyword marketplace_type: Possible values include: "NotSpecified", "AddOn", "Bypass", "Store". + :paramtype marketplace_type: str or + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesMarketplaceType + :keyword swagger_specifications: + :paramtype swagger_specifications: list[~azure.mgmt.providerhub.models.SwaggerSpecification] + :keyword allowed_unauthorized_actions: + :paramtype allowed_unauthorized_actions: list[str] + :keyword authorization_action_mappings: + :paramtype authorization_action_mappings: + list[~azure.mgmt.providerhub.models.AuthorizationActionMapping] + :keyword linked_access_checks: + :paramtype linked_access_checks: list[~azure.mgmt.providerhub.models.LinkedAccessCheck] + :keyword default_api_version: + :paramtype default_api_version: str + :keyword logging_rules: + :paramtype logging_rules: list[~azure.mgmt.providerhub.models.LoggingRule] + :keyword throttling_rules: + :paramtype throttling_rules: list[~azure.mgmt.providerhub.models.ThrottlingRule] + :keyword required_features: + :paramtype required_features: list[str] + :keyword features_rule: + :paramtype features_rule: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesFeaturesRule + :keyword enable_async_operation: + :paramtype enable_async_operation: bool + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + :keyword enable_third_party_s2_s: + :paramtype enable_third_party_s2_s: bool + :keyword subscription_lifecycle_notification_specifications: + :paramtype subscription_lifecycle_notification_specifications: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications + :keyword is_pure_proxy: + :paramtype is_pure_proxy: bool + :keyword identity_management: + :paramtype identity_management: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesIdentityManagement + :keyword check_name_availability_specifications: + :paramtype check_name_availability_specifications: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications + :keyword disallowed_action_verbs: + :paramtype disallowed_action_verbs: list[str] + :keyword service_tree_infos: + :paramtype service_tree_infos: list[~azure.mgmt.providerhub.models.ServiceTreeInfo] + :keyword request_header_options: + :paramtype request_header_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesRequestHeaderOptions + :keyword subscription_state_rules: + :paramtype subscription_state_rules: list[~azure.mgmt.providerhub.models.SubscriptionStateRule] + :keyword template_deployment_options: + :paramtype template_deployment_options: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesTemplateDeploymentOptions + :keyword extended_locations: + :paramtype extended_locations: list[~azure.mgmt.providerhub.models.ExtendedLocationOptions] + :keyword resource_move_policy: + :paramtype resource_move_policy: + ~azure.mgmt.providerhub.models.ResourceTypeRegistrationPropertiesResourceMovePolicy + :keyword resource_deletion_policy: Possible values include: "NotSpecified", "CascadeDeleteAll", + "CascadeDeleteProxyOnlyChildren". + :paramtype resource_deletion_policy: str or + ~azure.mgmt.providerhub.models.ResourceDeletionPolicy + """ + super(ResourceTypeRegistrationPropertiesAutoGenerated, self).__init__(routing_type=routing_type, regionality=regionality, endpoints=endpoints, extension_options=extension_options, marketplace_type=marketplace_type, swagger_specifications=swagger_specifications, allowed_unauthorized_actions=allowed_unauthorized_actions, authorization_action_mappings=authorization_action_mappings, linked_access_checks=linked_access_checks, default_api_version=default_api_version, logging_rules=logging_rules, throttling_rules=throttling_rules, required_features=required_features, features_rule=features_rule, enable_async_operation=enable_async_operation, provisioning_state=provisioning_state, enable_third_party_s2_s=enable_third_party_s2_s, subscription_lifecycle_notification_specifications=subscription_lifecycle_notification_specifications, is_pure_proxy=is_pure_proxy, identity_management=identity_management, check_name_availability_specifications=check_name_availability_specifications, disallowed_action_verbs=disallowed_action_verbs, service_tree_infos=service_tree_infos, request_header_options=request_header_options, subscription_state_rules=subscription_state_rules, template_deployment_options=template_deployment_options, extended_locations=extended_locations, resource_move_policy=resource_move_policy, resource_deletion_policy=resource_deletion_policy, **kwargs) + + +class ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications(CheckNameAvailabilitySpecifications): + """ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications. + + :ivar enable_default_validation: + :vartype enable_default_validation: bool + :ivar resource_types_with_custom_validation: + :vartype resource_types_with_custom_validation: list[str] + """ + + _attribute_map = { + 'enable_default_validation': {'key': 'enableDefaultValidation', 'type': 'bool'}, + 'resource_types_with_custom_validation': {'key': 'resourceTypesWithCustomValidation', 'type': '[str]'}, + } + + def __init__( + self, + *, + enable_default_validation: Optional[bool] = None, + resource_types_with_custom_validation: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword enable_default_validation: + :paramtype enable_default_validation: bool + :keyword resource_types_with_custom_validation: + :paramtype resource_types_with_custom_validation: list[str] + """ + super(ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications, self).__init__(enable_default_validation=enable_default_validation, resource_types_with_custom_validation=resource_types_with_custom_validation, **kwargs) + + +class ResourceTypeRegistrationPropertiesExtensionOptions(ResourceTypeExtensionOptions): + """ResourceTypeRegistrationPropertiesExtensionOptions. + + :ivar resource_creation_begin: + :vartype resource_creation_begin: + ~azure.mgmt.providerhub.models.ResourceTypeExtensionOptionsResourceCreationBegin + """ + + _attribute_map = { + 'resource_creation_begin': {'key': 'resourceCreationBegin', 'type': 'ResourceTypeExtensionOptionsResourceCreationBegin'}, + } + + def __init__( + self, + *, + resource_creation_begin: Optional["ResourceTypeExtensionOptionsResourceCreationBegin"] = None, + **kwargs + ): + """ + :keyword resource_creation_begin: + :paramtype resource_creation_begin: + ~azure.mgmt.providerhub.models.ResourceTypeExtensionOptionsResourceCreationBegin + """ + super(ResourceTypeRegistrationPropertiesExtensionOptions, self).__init__(resource_creation_begin=resource_creation_begin, **kwargs) + + +class ResourceTypeRegistrationPropertiesFeaturesRule(FeaturesRule): + """ResourceTypeRegistrationPropertiesFeaturesRule. + + All required parameters must be populated in order to send to Azure. + + :ivar required_features_policy: Required. Possible values include: "Any", "All". + :vartype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + + _validation = { + 'required_features_policy': {'required': True}, + } + + _attribute_map = { + 'required_features_policy': {'key': 'requiredFeaturesPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + required_features_policy: Union[str, "FeaturesPolicy"], + **kwargs + ): + """ + :keyword required_features_policy: Required. Possible values include: "Any", "All". + :paramtype required_features_policy: str or ~azure.mgmt.providerhub.models.FeaturesPolicy + """ + super(ResourceTypeRegistrationPropertiesFeaturesRule, self).__init__(required_features_policy=required_features_policy, **kwargs) + + +class ResourceTypeRegistrationPropertiesIdentityManagement(IdentityManagementProperties): + """ResourceTypeRegistrationPropertiesIdentityManagement. + + :ivar type: Possible values include: "NotSpecified", "SystemAssigned", "UserAssigned", "Actor", + "DelegatedResourceIdentity". + :vartype type: str or ~azure.mgmt.providerhub.models.IdentityManagementTypes + :ivar application_id: + :vartype application_id: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "IdentityManagementTypes"]] = None, + application_id: Optional[str] = None, + **kwargs + ): + """ + :keyword type: Possible values include: "NotSpecified", "SystemAssigned", "UserAssigned", + "Actor", "DelegatedResourceIdentity". + :paramtype type: str or ~azure.mgmt.providerhub.models.IdentityManagementTypes + :keyword application_id: + :paramtype application_id: str + """ + super(ResourceTypeRegistrationPropertiesIdentityManagement, self).__init__(type=type, application_id=application_id, **kwargs) + + +class ResourceTypeRegistrationPropertiesRequestHeaderOptions(RequestHeaderOptions): + """ResourceTypeRegistrationPropertiesRequestHeaderOptions. + + :ivar opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :vartype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + + _attribute_map = { + 'opt_in_headers': {'key': 'optInHeaders', 'type': 'str'}, + } + + def __init__( + self, + *, + opt_in_headers: Optional[Union[str, "OptInHeaderType"]] = None, + **kwargs + ): + """ + :keyword opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :paramtype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + super(ResourceTypeRegistrationPropertiesRequestHeaderOptions, self).__init__(opt_in_headers=opt_in_headers, **kwargs) + + +class ResourceTypeRegistrationPropertiesResourceMovePolicy(ResourceMovePolicy): + """ResourceTypeRegistrationPropertiesResourceMovePolicy. + + :ivar validation_required: + :vartype validation_required: bool + :ivar cross_resource_group_move_enabled: + :vartype cross_resource_group_move_enabled: bool + :ivar cross_subscription_move_enabled: + :vartype cross_subscription_move_enabled: bool + """ + + _attribute_map = { + 'validation_required': {'key': 'validationRequired', 'type': 'bool'}, + 'cross_resource_group_move_enabled': {'key': 'crossResourceGroupMoveEnabled', 'type': 'bool'}, + 'cross_subscription_move_enabled': {'key': 'crossSubscriptionMoveEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + validation_required: Optional[bool] = None, + cross_resource_group_move_enabled: Optional[bool] = None, + cross_subscription_move_enabled: Optional[bool] = None, + **kwargs + ): + """ + :keyword validation_required: + :paramtype validation_required: bool + :keyword cross_resource_group_move_enabled: + :paramtype cross_resource_group_move_enabled: bool + :keyword cross_subscription_move_enabled: + :paramtype cross_subscription_move_enabled: bool + """ + super(ResourceTypeRegistrationPropertiesResourceMovePolicy, self).__init__(validation_required=validation_required, cross_resource_group_move_enabled=cross_resource_group_move_enabled, cross_subscription_move_enabled=cross_subscription_move_enabled, **kwargs) + + +class ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications(SubscriptionLifecycleNotificationSpecifications): + """ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications. + + :ivar subscription_state_override_actions: + :vartype subscription_state_override_actions: + list[~azure.mgmt.providerhub.models.SubscriptionStateOverrideAction] + :ivar soft_delete_ttl: + :vartype soft_delete_ttl: ~datetime.timedelta + """ + + _attribute_map = { + 'subscription_state_override_actions': {'key': 'subscriptionStateOverrideActions', 'type': '[SubscriptionStateOverrideAction]'}, + 'soft_delete_ttl': {'key': 'softDeleteTTL', 'type': 'duration'}, + } + + def __init__( + self, + *, + subscription_state_override_actions: Optional[List["SubscriptionStateOverrideAction"]] = None, + soft_delete_ttl: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword subscription_state_override_actions: + :paramtype subscription_state_override_actions: + list[~azure.mgmt.providerhub.models.SubscriptionStateOverrideAction] + :keyword soft_delete_ttl: + :paramtype soft_delete_ttl: ~datetime.timedelta + """ + super(ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications, self).__init__(subscription_state_override_actions=subscription_state_override_actions, soft_delete_ttl=soft_delete_ttl, **kwargs) + + +class ResourceTypeRegistrationPropertiesTemplateDeploymentOptions(TemplateDeploymentOptions): + """ResourceTypeRegistrationPropertiesTemplateDeploymentOptions. + + :ivar preflight_supported: + :vartype preflight_supported: bool + :ivar preflight_options: + :vartype preflight_options: list[str or ~azure.mgmt.providerhub.models.PreflightOption] + """ + + _attribute_map = { + 'preflight_supported': {'key': 'preflightSupported', 'type': 'bool'}, + 'preflight_options': {'key': 'preflightOptions', 'type': '[str]'}, + } + + def __init__( + self, + *, + preflight_supported: Optional[bool] = None, + preflight_options: Optional[List[Union[str, "PreflightOption"]]] = None, + **kwargs + ): + """ + :keyword preflight_supported: + :paramtype preflight_supported: bool + :keyword preflight_options: + :paramtype preflight_options: list[str or ~azure.mgmt.providerhub.models.PreflightOption] + """ + super(ResourceTypeRegistrationPropertiesTemplateDeploymentOptions, self).__init__(preflight_supported=preflight_supported, preflight_options=preflight_options, **kwargs) + + +class ResourceTypeRequestHeaderOptions(RequestHeaderOptions): + """ResourceTypeRequestHeaderOptions. + + :ivar opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :vartype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + + _attribute_map = { + 'opt_in_headers': {'key': 'optInHeaders', 'type': 'str'}, + } + + def __init__( + self, + *, + opt_in_headers: Optional[Union[str, "OptInHeaderType"]] = None, + **kwargs + ): + """ + :keyword opt_in_headers: Possible values include: "NotSpecified", "SignedUserToken", + "ClientGroupMembership", "SignedAuxiliaryTokens", "UnboundedClientGroupMembership". + :paramtype opt_in_headers: str or ~azure.mgmt.providerhub.models.OptInHeaderType + """ + super(ResourceTypeRequestHeaderOptions, self).__init__(opt_in_headers=opt_in_headers, **kwargs) + + +class ResourceTypeSku(msrest.serialization.Model): + """ResourceTypeSku. + + All required parameters must be populated in order to send to Azure. + + :ivar sku_settings: Required. + :vartype sku_settings: list[~azure.mgmt.providerhub.models.SkuSetting] + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + """ + + _validation = { + 'sku_settings': {'required': True}, + } + + _attribute_map = { + 'sku_settings': {'key': 'skuSettings', 'type': '[SkuSetting]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + sku_settings: List["SkuSetting"], + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + **kwargs + ): + """ + :keyword sku_settings: Required. + :paramtype sku_settings: list[~azure.mgmt.providerhub.models.SkuSetting] + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + """ + super(ResourceTypeSku, self).__init__(**kwargs) + self.sku_settings = sku_settings + self.provisioning_state = provisioning_state + + +class TemplateDeploymentPolicy(msrest.serialization.Model): + """TemplateDeploymentPolicy. + + All required parameters must be populated in order to send to Azure. + + :ivar capabilities: Required. Possible values include: "Default", "Preflight". + :vartype capabilities: str or ~azure.mgmt.providerhub.models.TemplateDeploymentCapabilities + :ivar preflight_options: Required. Possible values include: "None", "ValidationRequests", + "DeploymentRequests", "TestOnly", "RegisteredOnly". + :vartype preflight_options: str or + ~azure.mgmt.providerhub.models.TemplateDeploymentPreflightOptions + """ + + _validation = { + 'capabilities': {'required': True}, + 'preflight_options': {'required': True}, + } + + _attribute_map = { + 'capabilities': {'key': 'capabilities', 'type': 'str'}, + 'preflight_options': {'key': 'preflightOptions', 'type': 'str'}, + } + + def __init__( + self, + *, + capabilities: Union[str, "TemplateDeploymentCapabilities"], + preflight_options: Union[str, "TemplateDeploymentPreflightOptions"], + **kwargs + ): + """ + :keyword capabilities: Required. Possible values include: "Default", "Preflight". + :paramtype capabilities: str or ~azure.mgmt.providerhub.models.TemplateDeploymentCapabilities + :keyword preflight_options: Required. Possible values include: "None", "ValidationRequests", + "DeploymentRequests", "TestOnly", "RegisteredOnly". + :paramtype preflight_options: str or + ~azure.mgmt.providerhub.models.TemplateDeploymentPreflightOptions + """ + super(TemplateDeploymentPolicy, self).__init__(**kwargs) + self.capabilities = capabilities + self.preflight_options = preflight_options + + +class ResourceTypeTemplateDeploymentPolicy(TemplateDeploymentPolicy): + """ResourceTypeTemplateDeploymentPolicy. + + All required parameters must be populated in order to send to Azure. + + :ivar capabilities: Required. Possible values include: "Default", "Preflight". + :vartype capabilities: str or ~azure.mgmt.providerhub.models.TemplateDeploymentCapabilities + :ivar preflight_options: Required. Possible values include: "None", "ValidationRequests", + "DeploymentRequests", "TestOnly", "RegisteredOnly". + :vartype preflight_options: str or + ~azure.mgmt.providerhub.models.TemplateDeploymentPreflightOptions + """ + + _validation = { + 'capabilities': {'required': True}, + 'preflight_options': {'required': True}, + } + + _attribute_map = { + 'capabilities': {'key': 'capabilities', 'type': 'str'}, + 'preflight_options': {'key': 'preflightOptions', 'type': 'str'}, + } + + def __init__( + self, + *, + capabilities: Union[str, "TemplateDeploymentCapabilities"], + preflight_options: Union[str, "TemplateDeploymentPreflightOptions"], + **kwargs + ): + """ + :keyword capabilities: Required. Possible values include: "Default", "Preflight". + :paramtype capabilities: str or ~azure.mgmt.providerhub.models.TemplateDeploymentCapabilities + :keyword preflight_options: Required. Possible values include: "None", "ValidationRequests", + "DeploymentRequests", "TestOnly", "RegisteredOnly". + :paramtype preflight_options: str or + ~azure.mgmt.providerhub.models.TemplateDeploymentPreflightOptions + """ + super(ResourceTypeTemplateDeploymentPolicy, self).__init__(capabilities=capabilities, preflight_options=preflight_options, **kwargs) + + +class ServiceTreeInfo(msrest.serialization.Model): + """ServiceTreeInfo. + + :ivar service_id: + :vartype service_id: str + :ivar component_id: + :vartype component_id: str + """ + + _attribute_map = { + 'service_id': {'key': 'serviceId', 'type': 'str'}, + 'component_id': {'key': 'componentId', 'type': 'str'}, + } + + def __init__( + self, + *, + service_id: Optional[str] = None, + component_id: Optional[str] = None, + **kwargs + ): + """ + :keyword service_id: + :paramtype service_id: str + :keyword component_id: + :paramtype component_id: str + """ + super(ServiceTreeInfo, self).__init__(**kwargs) + self.service_id = service_id + self.component_id = component_id + + +class SkuCapability(msrest.serialization.Model): + """SkuCapability. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. + :vartype name: str + :ivar value: Required. + :vartype value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + value: str, + **kwargs + ): + """ + :keyword name: Required. + :paramtype name: str + :keyword value: Required. + :paramtype value: str + """ + super(SkuCapability, self).__init__(**kwargs) + self.name = name + self.value = value + + +class SkuCapacity(msrest.serialization.Model): + """SkuCapacity. + + All required parameters must be populated in order to send to Azure. + + :ivar minimum: Required. + :vartype minimum: int + :ivar maximum: + :vartype maximum: int + :ivar default: + :vartype default: int + :ivar scale_type: Possible values include: "None", "Manual", "Automatic". + :vartype scale_type: str or ~azure.mgmt.providerhub.models.SkuScaleType + """ + + _validation = { + 'minimum': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + *, + minimum: int, + maximum: Optional[int] = None, + default: Optional[int] = None, + scale_type: Optional[Union[str, "SkuScaleType"]] = None, + **kwargs + ): + """ + :keyword minimum: Required. + :paramtype minimum: int + :keyword maximum: + :paramtype maximum: int + :keyword default: + :paramtype default: int + :keyword scale_type: Possible values include: "None", "Manual", "Automatic". + :paramtype scale_type: str or ~azure.mgmt.providerhub.models.SkuScaleType + """ + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type + + +class SkuCost(msrest.serialization.Model): + """SkuCost. + + All required parameters must be populated in order to send to Azure. + + :ivar meter_id: Required. + :vartype meter_id: str + :ivar quantity: + :vartype quantity: int + :ivar extended_unit: + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'required': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'int'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + *, + meter_id: str, + quantity: Optional[int] = None, + extended_unit: Optional[str] = None, + **kwargs + ): + """ + :keyword meter_id: Required. + :paramtype meter_id: str + :keyword quantity: + :paramtype quantity: int + :keyword extended_unit: + :paramtype extended_unit: str + """ + super(SkuCost, self).__init__(**kwargs) + self.meter_id = meter_id + self.quantity = quantity + self.extended_unit = extended_unit + + +class SkuLocationInfo(msrest.serialization.Model): + """SkuLocationInfo. + + All required parameters must be populated in order to send to Azure. + + :ivar location: Required. + :vartype location: str + :ivar zones: + :vartype zones: list[str] + :ivar zone_details: + :vartype zone_details: list[~azure.mgmt.providerhub.models.SkuZoneDetail] + :ivar extended_locations: + :vartype extended_locations: list[str] + :ivar type: Possible values include: "NotSpecified", "EdgeZone", "ArcZone". + :vartype type: str or ~azure.mgmt.providerhub.models.SkuLocationInfoType + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[SkuZoneDetail]'}, + 'extended_locations': {'key': 'extendedLocations', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + zones: Optional[List[str]] = None, + zone_details: Optional[List["SkuZoneDetail"]] = None, + extended_locations: Optional[List[str]] = None, + type: Optional[Union[str, "SkuLocationInfoType"]] = None, + **kwargs + ): + """ + :keyword location: Required. + :paramtype location: str + :keyword zones: + :paramtype zones: list[str] + :keyword zone_details: + :paramtype zone_details: list[~azure.mgmt.providerhub.models.SkuZoneDetail] + :keyword extended_locations: + :paramtype extended_locations: list[str] + :keyword type: Possible values include: "NotSpecified", "EdgeZone", "ArcZone". + :paramtype type: str or ~azure.mgmt.providerhub.models.SkuLocationInfoType + """ + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = location + self.zones = zones + self.zone_details = zone_details + self.extended_locations = extended_locations + self.type = type + + +class SkuResource(ProxyResource): + """SkuResource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar properties: + :vartype properties: ~azure.mgmt.providerhub.models.SkuResourceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'SkuResourceProperties'}, + } + + def __init__( + self, + *, + properties: Optional["SkuResourceProperties"] = None, + **kwargs + ): + """ + :keyword properties: + :paramtype properties: ~azure.mgmt.providerhub.models.SkuResourceProperties + """ + super(SkuResource, self).__init__(**kwargs) + self.properties = properties + + +class SkuResourceArrayResponseWithContinuation(msrest.serialization.Model): + """SkuResourceArrayResponseWithContinuation. + + :ivar value: + :vartype value: list[~azure.mgmt.providerhub.models.SkuResource] + :ivar next_link: The URL to get to the next set of results, if there are any. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SkuResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.providerhub.models.SkuResource] + :keyword next_link: The URL to get to the next set of results, if there are any. + :paramtype next_link: str + """ + super(SkuResourceArrayResponseWithContinuation, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SkuResourceProperties(ResourceTypeSku): + """SkuResourceProperties. + + All required parameters must be populated in order to send to Azure. + + :ivar sku_settings: Required. + :vartype sku_settings: list[~azure.mgmt.providerhub.models.SkuSetting] + :ivar provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :vartype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + """ + + _validation = { + 'sku_settings': {'required': True}, + } + + _attribute_map = { + 'sku_settings': {'key': 'skuSettings', 'type': '[SkuSetting]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + sku_settings: List["SkuSetting"], + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + **kwargs + ): + """ + :keyword sku_settings: Required. + :paramtype sku_settings: list[~azure.mgmt.providerhub.models.SkuSetting] + :keyword provisioning_state: Possible values include: "NotSpecified", "Accepted", "Running", + "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", + "MovingResources", "TransientFailure", "RolloutInProgress". + :paramtype provisioning_state: str or ~azure.mgmt.providerhub.models.ProvisioningState + """ + super(SkuResourceProperties, self).__init__(sku_settings=sku_settings, provisioning_state=provisioning_state, **kwargs) + + +class SkuSetting(msrest.serialization.Model): + """SkuSetting. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. + :vartype name: str + :ivar tier: + :vartype tier: str + :ivar size: + :vartype size: str + :ivar family: + :vartype family: str + :ivar kind: + :vartype kind: str + :ivar locations: + :vartype locations: list[str] + :ivar location_info: + :vartype location_info: list[~azure.mgmt.providerhub.models.SkuLocationInfo] + :ivar required_quota_ids: + :vartype required_quota_ids: list[str] + :ivar required_features: + :vartype required_features: list[str] + :ivar capacity: + :vartype capacity: ~azure.mgmt.providerhub.models.SkuSettingCapacity + :ivar costs: + :vartype costs: list[~azure.mgmt.providerhub.models.SkuCost] + :ivar capabilities: + :vartype capabilities: list[~azure.mgmt.providerhub.models.SkuCapability] + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'required_quota_ids': {'key': 'requiredQuotaIds', 'type': '[str]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + 'capacity': {'key': 'capacity', 'type': 'SkuSettingCapacity'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + } + + def __init__( + self, + *, + name: str, + tier: Optional[str] = None, + size: Optional[str] = None, + family: Optional[str] = None, + kind: Optional[str] = None, + locations: Optional[List[str]] = None, + location_info: Optional[List["SkuLocationInfo"]] = None, + required_quota_ids: Optional[List[str]] = None, + required_features: Optional[List[str]] = None, + capacity: Optional["SkuSettingCapacity"] = None, + costs: Optional[List["SkuCost"]] = None, + capabilities: Optional[List["SkuCapability"]] = None, + **kwargs + ): + """ + :keyword name: Required. + :paramtype name: str + :keyword tier: + :paramtype tier: str + :keyword size: + :paramtype size: str + :keyword family: + :paramtype family: str + :keyword kind: + :paramtype kind: str + :keyword locations: + :paramtype locations: list[str] + :keyword location_info: + :paramtype location_info: list[~azure.mgmt.providerhub.models.SkuLocationInfo] + :keyword required_quota_ids: + :paramtype required_quota_ids: list[str] + :keyword required_features: + :paramtype required_features: list[str] + :keyword capacity: + :paramtype capacity: ~azure.mgmt.providerhub.models.SkuSettingCapacity + :keyword costs: + :paramtype costs: list[~azure.mgmt.providerhub.models.SkuCost] + :keyword capabilities: + :paramtype capabilities: list[~azure.mgmt.providerhub.models.SkuCapability] + """ + super(SkuSetting, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.kind = kind + self.locations = locations + self.location_info = location_info + self.required_quota_ids = required_quota_ids + self.required_features = required_features + self.capacity = capacity + self.costs = costs + self.capabilities = capabilities + + +class SkuSettingCapacity(SkuCapacity): + """SkuSettingCapacity. + + All required parameters must be populated in order to send to Azure. + + :ivar minimum: Required. + :vartype minimum: int + :ivar maximum: + :vartype maximum: int + :ivar default: + :vartype default: int + :ivar scale_type: Possible values include: "None", "Manual", "Automatic". + :vartype scale_type: str or ~azure.mgmt.providerhub.models.SkuScaleType + """ + + _validation = { + 'minimum': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + *, + minimum: int, + maximum: Optional[int] = None, + default: Optional[int] = None, + scale_type: Optional[Union[str, "SkuScaleType"]] = None, + **kwargs + ): + """ + :keyword minimum: Required. + :paramtype minimum: int + :keyword maximum: + :paramtype maximum: int + :keyword default: + :paramtype default: int + :keyword scale_type: Possible values include: "None", "Manual", "Automatic". + :paramtype scale_type: str or ~azure.mgmt.providerhub.models.SkuScaleType + """ + super(SkuSettingCapacity, self).__init__(minimum=minimum, maximum=maximum, default=default, scale_type=scale_type, **kwargs) + + +class SkuZoneDetail(msrest.serialization.Model): + """SkuZoneDetail. + + :ivar name: + :vartype name: list[str] + :ivar capabilities: + :vartype capabilities: list[~azure.mgmt.providerhub.models.SkuCapability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + } + + def __init__( + self, + *, + name: Optional[List[str]] = None, + capabilities: Optional[List["SkuCapability"]] = None, + **kwargs + ): + """ + :keyword name: + :paramtype name: list[str] + :keyword capabilities: + :paramtype capabilities: list[~azure.mgmt.providerhub.models.SkuCapability] + """ + super(SkuZoneDetail, self).__init__(**kwargs) + self.name = name + self.capabilities = capabilities + + +class SubscriptionStateOverrideAction(msrest.serialization.Model): + """SubscriptionStateOverrideAction. + + All required parameters must be populated in order to send to Azure. + + :ivar state: Required. Possible values include: "Registered", "Unregistered", "Warned", + "Suspended", "Deleted", "WarnedToRegistered", "WarnedToSuspended", "WarnedToDeleted", + "WarnedToUnregistered", "SuspendedToRegistered", "SuspendedToWarned", "SuspendedToDeleted", + "SuspendedToUnregistered". + :vartype state: str or ~azure.mgmt.providerhub.models.SubscriptionTransitioningState + :ivar action: Required. Possible values include: "NotDefined", "DeleteAllResources", + "SoftDeleteAllResources", "NoOp", "BillingCancellation", "UndoSoftDelete". + :vartype action: str or ~azure.mgmt.providerhub.models.SubscriptionNotificationOperation + """ + + _validation = { + 'state': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + *, + state: Union[str, "SubscriptionTransitioningState"], + action: Union[str, "SubscriptionNotificationOperation"], + **kwargs + ): + """ + :keyword state: Required. Possible values include: "Registered", "Unregistered", "Warned", + "Suspended", "Deleted", "WarnedToRegistered", "WarnedToSuspended", "WarnedToDeleted", + "WarnedToUnregistered", "SuspendedToRegistered", "SuspendedToWarned", "SuspendedToDeleted", + "SuspendedToUnregistered". + :paramtype state: str or ~azure.mgmt.providerhub.models.SubscriptionTransitioningState + :keyword action: Required. Possible values include: "NotDefined", "DeleteAllResources", + "SoftDeleteAllResources", "NoOp", "BillingCancellation", "UndoSoftDelete". + :paramtype action: str or ~azure.mgmt.providerhub.models.SubscriptionNotificationOperation + """ + super(SubscriptionStateOverrideAction, self).__init__(**kwargs) + self.state = state + self.action = action + + +class SubscriptionStateRule(msrest.serialization.Model): + """SubscriptionStateRule. + + :ivar state: Possible values include: "NotDefined", "Enabled", "Warned", "PastDue", "Disabled", + "Deleted". + :vartype state: str or ~azure.mgmt.providerhub.models.SubscriptionState + :ivar allowed_actions: + :vartype allowed_actions: list[str] + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'allowed_actions': {'key': 'allowedActions', 'type': '[str]'}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "SubscriptionState"]] = None, + allowed_actions: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword state: Possible values include: "NotDefined", "Enabled", "Warned", "PastDue", + "Disabled", "Deleted". + :paramtype state: str or ~azure.mgmt.providerhub.models.SubscriptionState + :keyword allowed_actions: + :paramtype allowed_actions: list[str] + """ + super(SubscriptionStateRule, self).__init__(**kwargs) + self.state = state + self.allowed_actions = allowed_actions + + +class SwaggerSpecification(msrest.serialization.Model): + """SwaggerSpecification. + + :ivar api_versions: + :vartype api_versions: list[str] + :ivar swagger_spec_folder_uri: + :vartype swagger_spec_folder_uri: str + """ + + _attribute_map = { + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'swagger_spec_folder_uri': {'key': 'swaggerSpecFolderUri', 'type': 'str'}, + } + + def __init__( + self, + *, + api_versions: Optional[List[str]] = None, + swagger_spec_folder_uri: Optional[str] = None, + **kwargs + ): + """ + :keyword api_versions: + :paramtype api_versions: list[str] + :keyword swagger_spec_folder_uri: + :paramtype swagger_spec_folder_uri: str + """ + super(SwaggerSpecification, self).__init__(**kwargs) + self.api_versions = api_versions + self.swagger_spec_folder_uri = swagger_spec_folder_uri + + +class ThrottlingMetric(msrest.serialization.Model): + """ThrottlingMetric. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Required. Possible values include: "NotSpecified", "NumberOfRequests", + "NumberOfResources". + :vartype type: str or ~azure.mgmt.providerhub.models.ThrottlingMetricType + :ivar limit: Required. + :vartype limit: long + :ivar interval: + :vartype interval: ~datetime.timedelta + """ + + _validation = { + 'type': {'required': True}, + 'limit': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'interval': {'key': 'interval', 'type': 'duration'}, + } + + def __init__( + self, + *, + type: Union[str, "ThrottlingMetricType"], + limit: int, + interval: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword type: Required. Possible values include: "NotSpecified", "NumberOfRequests", + "NumberOfResources". + :paramtype type: str or ~azure.mgmt.providerhub.models.ThrottlingMetricType + :keyword limit: Required. + :paramtype limit: long + :keyword interval: + :paramtype interval: ~datetime.timedelta + """ + super(ThrottlingMetric, self).__init__(**kwargs) + self.type = type + self.limit = limit + self.interval = interval + + +class ThrottlingRule(msrest.serialization.Model): + """ThrottlingRule. + + All required parameters must be populated in order to send to Azure. + + :ivar action: Required. + :vartype action: str + :ivar metrics: Required. + :vartype metrics: list[~azure.mgmt.providerhub.models.ThrottlingMetric] + :ivar required_features: + :vartype required_features: list[str] + """ + + _validation = { + 'action': {'required': True}, + 'metrics': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'metrics': {'key': 'metrics', 'type': '[ThrottlingMetric]'}, + 'required_features': {'key': 'requiredFeatures', 'type': '[str]'}, + } + + def __init__( + self, + *, + action: str, + metrics: List["ThrottlingMetric"], + required_features: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword action: Required. + :paramtype action: str + :keyword metrics: Required. + :paramtype metrics: list[~azure.mgmt.providerhub.models.ThrottlingMetric] + :keyword required_features: + :paramtype required_features: list[str] + """ + super(ThrottlingRule, self).__init__(**kwargs) + self.action = action + self.metrics = metrics + self.required_features = required_features + + +class TypedErrorInfo(msrest.serialization.Model): + """TypedErrorInfo. + + 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 type: Required. + :vartype type: str + :ivar info: Any object. + :vartype info: any + """ + + _validation = { + 'type': {'required': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + *, + type: str, + **kwargs + ): + """ + :keyword type: Required. + :paramtype type: str + """ + super(TypedErrorInfo, self).__init__(**kwargs) + self.type = type + self.info = None diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/_provider_hub_enums.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/_provider_hub_enums.py new file mode 100644 index 000000000000..7a183b59c19b --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/models/_provider_hub_enums.py @@ -0,0 +1,282 @@ +# 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 +from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class ExtensionCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + RESOURCE_CREATION_VALIDATE = "ResourceCreationValidate" + RESOURCE_CREATION_BEGIN = "ResourceCreationBegin" + RESOURCE_CREATION_COMPLETED = "ResourceCreationCompleted" + RESOURCE_READ_VALIDATE = "ResourceReadValidate" + RESOURCE_READ_BEGIN = "ResourceReadBegin" + RESOURCE_PATCH_VALIDATE = "ResourcePatchValidate" + RESOURCE_PATCH_COMPLETED = "ResourcePatchCompleted" + RESOURCE_DELETION_VALIDATE = "ResourceDeletionValidate" + RESOURCE_DELETION_BEGIN = "ResourceDeletionBegin" + RESOURCE_DELETION_COMPLETED = "ResourceDeletionCompleted" + RESOURCE_POST_ACTION = "ResourcePostAction" + SUBSCRIPTION_LIFECYCLE_NOTIFICATION = "SubscriptionLifecycleNotification" + RESOURCE_PATCH_BEGIN = "ResourcePatchBegin" + RESOURCE_MOVE_BEGIN = "ResourceMoveBegin" + RESOURCE_MOVE_COMPLETED = "ResourceMoveCompleted" + +class ExtensionOptionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + DO_NOT_MERGE_EXISTING_READ_ONLY_AND_SECRET_PROPERTIES = "DoNotMergeExistingReadOnlyAndSecretProperties" + INCLUDE_INTERNAL_METADATA = "IncludeInternalMetadata" + +class FeaturesPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + ANY = "Any" + ALL = "All" + +class IdentityManagementTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + ACTOR = "Actor" + DELEGATED_RESOURCE_IDENTITY = "DelegatedResourceIdentity" + +class LinkedAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + BLOCKED = "Blocked" + VALIDATE = "Validate" + ENABLED = "Enabled" + +class LinkedOperation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + CROSS_RESOURCE_GROUP_RESOURCE_MOVE = "CrossResourceGroupResourceMove" + CROSS_SUBSCRIPTION_RESOURCE_MOVE = "CrossSubscriptionResourceMove" + +class LoggingDetails(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + BODY = "Body" + +class LoggingDirections(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + REQUEST = "Request" + RESPONSE = "Response" + +class ManifestResourceDeletionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + CASCADE = "Cascade" + FORCE = "Force" + +class MessageScope(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + REGISTERED_SUBSCRIPTIONS = "RegisteredSubscriptions" + +class NotificationMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + EVENT_HUB = "EventHub" + WEB_HOOK = "WebHook" + +class OperationsDefinitionActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + INTERNAL = "Internal" + +class OperationsDefinitionOrigin(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + USER = "User" + SYSTEM = "System" + +class OptInHeaderType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + SIGNED_USER_TOKEN = "SignedUserToken" + CLIENT_GROUP_MEMBERSHIP = "ClientGroupMembership" + SIGNED_AUXILIARY_TOKENS = "SignedAuxiliaryTokens" + UNBOUNDED_CLIENT_GROUP_MEMBERSHIP = "UnboundedClientGroupMembership" + +class PreflightOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + CONTINUE_DEPLOYMENT_ON_FAILURE = "ContinueDeploymentOnFailure" + DEFAULT_VALIDATION_ONLY = "DefaultValidationOnly" + +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + ACCEPTED = "Accepted" + RUNNING = "Running" + CREATING = "Creating" + CREATED = "Created" + DELETING = "Deleting" + DELETED = "Deleted" + CANCELED = "Canceled" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + MOVING_RESOURCES = "MovingResources" + TRANSIENT_FAILURE = "TransientFailure" + ROLLOUT_IN_PROGRESS = "RolloutInProgress" + +class Regionality(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + GLOBAL_ENUM = "Global" + REGIONAL = "Regional" + +class ResourceDeletionPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + CASCADE_DELETE_ALL = "CascadeDeleteAll" + CASCADE_DELETE_PROXY_ONLY_CHILDREN = "CascadeDeleteProxyOnlyChildren" + +class ResourceProviderCapabilitiesEffect(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + ALLOW = "Allow" + DISALLOW = "Disallow" + +class ResourceProviderManagementResourceAccessPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + ACIS_READ_ALLOWED = "AcisReadAllowed" + ACIS_ACTION_ALLOWED = "AcisActionAllowed" + +class ResourceProviderType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + INTERNAL = "Internal" + EXTERNAL = "External" + HIDDEN = "Hidden" + REGISTRATION_FREE = "RegistrationFree" + LEGACY_REGISTRATION_REQUIRED = "LegacyRegistrationRequired" + TENANT_ONLY = "TenantOnly" + AUTHORIZATION_FREE = "AuthorizationFree" + +class ResourceTypeMarketplaceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + ADD_ON = "AddOn" + BYPASS = "Bypass" + STORE = "Store" + +class ResourceTypeRegistrationPropertiesMarketplaceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + ADD_ON = "AddOn" + BYPASS = "Bypass" + STORE = "Store" + +class ResourceValidation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + RESERVED_WORDS = "ReservedWords" + PROFANE_WORDS = "ProfaneWords" + +class RoutingType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + DEFAULT = "Default" + PROXY_ONLY = "ProxyOnly" + HOST_BASED = "HostBased" + EXTENSION = "Extension" + TENANT = "Tenant" + FANOUT = "Fanout" + LOCATION_BASED = "LocationBased" + FAILOVER = "Failover" + CASCADE_EXTENSION = "CascadeExtension" + +class SkuLocationInfoType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + EDGE_ZONE = "EdgeZone" + ARC_ZONE = "ArcZone" + +class SkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + MANUAL = "Manual" + AUTOMATIC = "Automatic" + +class SubscriptionNotificationOperation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_DEFINED = "NotDefined" + DELETE_ALL_RESOURCES = "DeleteAllResources" + SOFT_DELETE_ALL_RESOURCES = "SoftDeleteAllResources" + NO_OP = "NoOp" + BILLING_CANCELLATION = "BillingCancellation" + UNDO_SOFT_DELETE = "UndoSoftDelete" + +class SubscriptionReregistrationResult(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_APPLICABLE = "NotApplicable" + CONDITIONAL_UPDATE = "ConditionalUpdate" + FORCED_UPDATE = "ForcedUpdate" + FAILED = "Failed" + +class SubscriptionState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_DEFINED = "NotDefined" + ENABLED = "Enabled" + WARNED = "Warned" + PAST_DUE = "PastDue" + DISABLED = "Disabled" + DELETED = "Deleted" + +class SubscriptionTransitioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + REGISTERED = "Registered" + UNREGISTERED = "Unregistered" + WARNED = "Warned" + SUSPENDED = "Suspended" + DELETED = "Deleted" + WARNED_TO_REGISTERED = "WarnedToRegistered" + WARNED_TO_SUSPENDED = "WarnedToSuspended" + WARNED_TO_DELETED = "WarnedToDeleted" + WARNED_TO_UNREGISTERED = "WarnedToUnregistered" + SUSPENDED_TO_REGISTERED = "SuspendedToRegistered" + SUSPENDED_TO_WARNED = "SuspendedToWarned" + SUSPENDED_TO_DELETED = "SuspendedToDeleted" + SUSPENDED_TO_UNREGISTERED = "SuspendedToUnregistered" + +class TemplateDeploymentCapabilities(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + DEFAULT = "Default" + PREFLIGHT = "Preflight" + +class TemplateDeploymentPreflightOptions(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + VALIDATION_REQUESTS = "ValidationRequests" + DEPLOYMENT_REQUESTS = "DeploymentRequests" + TEST_ONLY = "TestOnly" + REGISTERED_ONLY = "RegisteredOnly" + +class ThrottlingMetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + NUMBER_OF_REQUESTS = "NumberOfRequests" + NUMBER_OF_RESOURCES = "NumberOfResources" + +class TrafficRegionCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + NOT_SPECIFIED = "NotSpecified" + CANARY = "Canary" + LOW_TRAFFIC = "LowTraffic" + MEDIUM_TRAFFIC = "MediumTraffic" + HIGH_TRAFFIC = "HighTraffic" + NONE = "None" + REST_OF_THE_WORLD_GROUP_ONE = "RestOfTheWorldGroupOne" + REST_OF_THE_WORLD_GROUP_TWO = "RestOfTheWorldGroupTwo" diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/__init__.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/__init__.py new file mode 100644 index 000000000000..2b800813b102 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._custom_rollouts_operations import CustomRolloutsOperations +from ._default_rollouts_operations import DefaultRolloutsOperations +from ._provider_hub_operations import ProviderHubOperationsMixin +from ._notification_registrations_operations import NotificationRegistrationsOperations +from ._operations import Operations +from ._provider_registrations_operations import ProviderRegistrationsOperations +from ._resource_type_registrations_operations import ResourceTypeRegistrationsOperations +from ._skus_operations import SkusOperations + +__all__ = [ + 'CustomRolloutsOperations', + 'DefaultRolloutsOperations', + 'ProviderHubOperationsMixin', + 'NotificationRegistrationsOperations', + 'Operations', + 'ProviderRegistrationsOperations', + 'ResourceTypeRegistrationsOperations', + 'SkusOperations', +] diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_custom_rollouts_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_custom_rollouts_operations.py new file mode 100644 index 000000000000..9ef2540c37be --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_custom_rollouts_operations.py @@ -0,0 +1,344 @@ +# 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + provider_namespace: str, + rollout_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "rolloutName": _SERIALIZER.url("rollout_name", rollout_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + provider_namespace: str, + rollout_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "rolloutName": _SERIALIZER.url("rollout_name", rollout_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_by_provider_registration_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class CustomRolloutsOperations(object): + """CustomRolloutsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace + def get( + self, + provider_namespace: str, + rollout_name: str, + **kwargs: Any + ) -> "_models.CustomRollout": + """Gets the custom rollout details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomRollout, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.CustomRollout + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRollout"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomRollout', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}'} # type: ignore + + + @distributed_trace + def create_or_update( + self, + provider_namespace: str, + rollout_name: str, + properties: "_models.CustomRollout", + **kwargs: Any + ) -> "_models.CustomRollout": + """Creates or updates the rollout details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :param properties: The custom rollout properties supplied to the CreateOrUpdate operation. + :type properties: ~azure.mgmt.providerhub.models.CustomRollout + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomRollout, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.CustomRollout + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRollout"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'CustomRollout') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomRollout', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}'} # type: ignore + + + @distributed_trace + def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> Iterable["_models.CustomRolloutArrayResponseWithContinuation"]: + """Gets the list of the custom rollouts for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CustomRolloutArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.CustomRolloutArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomRolloutArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("CustomRolloutArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts'} # type: ignore diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_default_rollouts_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_default_rollouts_operations.py new file mode 100644 index 000000000000..72a6a025d9a6 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_default_rollouts_operations.py @@ -0,0 +1,572 @@ +# 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +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 HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + provider_namespace: str, + rollout_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "rolloutName": _SERIALIZER.url("rollout_name", rollout_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + provider_namespace: str, + rollout_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "rolloutName": _SERIALIZER.url("rollout_name", rollout_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + provider_namespace: str, + rollout_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "rolloutName": _SERIALIZER.url("rollout_name", rollout_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_by_provider_registration_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_stop_request( + subscription_id: str, + provider_namespace: str, + rollout_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}/stop') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "rolloutName": _SERIALIZER.url("rollout_name", rollout_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class DefaultRolloutsOperations(object): + """DefaultRolloutsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace + def get( + self, + provider_namespace: str, + rollout_name: str, + **kwargs: Any + ) -> "_models.DefaultRollout": + """Gets the default rollout details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DefaultRollout, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.DefaultRollout + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultRollout"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DefaultRollout', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}'} # type: ignore + + + @distributed_trace + def delete( + self, + provider_namespace: str, + rollout_name: str, + **kwargs: Any + ) -> None: + """Deletes the rollout resource. Rollout must be in terminal state. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}'} # type: ignore + + + def _create_or_update_initial( + self, + provider_namespace: str, + rollout_name: str, + properties: "_models.DefaultRollout", + **kwargs: Any + ) -> "_models.DefaultRollout": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultRollout"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'DefaultRollout') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DefaultRollout', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DefaultRollout', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + provider_namespace: str, + rollout_name: str, + properties: "_models.DefaultRollout", + **kwargs: Any + ) -> LROPoller["_models.DefaultRollout"]: + """Creates or updates the rollout details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :param properties: The Default rollout properties supplied to the CreateOrUpdate operation. + :type properties: ~azure.mgmt.providerhub.models.DefaultRollout + :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: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a 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 DefaultRollout or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.providerhub.models.DefaultRollout] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultRollout"] + 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( + provider_namespace=provider_namespace, + rollout_name=rollout_name, + properties=properties, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DefaultRollout', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}'} # type: ignore + + @distributed_trace + def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> Iterable["_models.DefaultRolloutArrayResponseWithContinuation"]: + """Gets the list of the rollouts for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DefaultRolloutArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.DefaultRolloutArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DefaultRolloutArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DefaultRolloutArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts'} # type: ignore + + @distributed_trace + def stop( + self, + provider_namespace: str, + rollout_name: str, + **kwargs: Any + ) -> None: + """Stops or cancels the rollout, if in progress. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param rollout_name: The rollout name. + :type rollout_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_stop_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + rollout_name=rollout_name, + template_url=self.stop.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}/stop'} # type: ignore + diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_notification_registrations_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_notification_registrations_operations.py new file mode 100644 index 000000000000..e5fae46fa74c --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_notification_registrations_operations.py @@ -0,0 +1,428 @@ +# 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + provider_namespace: str, + notification_registration_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "notificationRegistrationName": _SERIALIZER.url("notification_registration_name", notification_registration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + provider_namespace: str, + notification_registration_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "notificationRegistrationName": _SERIALIZER.url("notification_registration_name", notification_registration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + provider_namespace: str, + notification_registration_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "notificationRegistrationName": _SERIALIZER.url("notification_registration_name", notification_registration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_provider_registration_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class NotificationRegistrationsOperations(object): + """NotificationRegistrationsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace + def get( + self, + provider_namespace: str, + notification_registration_name: str, + **kwargs: Any + ) -> "_models.NotificationRegistration": + """Gets the notification registration details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param notification_registration_name: The notification registration. + :type notification_registration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NotificationRegistration, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.NotificationRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + notification_registration_name=notification_registration_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NotificationRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}'} # type: ignore + + + @distributed_trace + def create_or_update( + self, + provider_namespace: str, + notification_registration_name: str, + properties: "_models.NotificationRegistration", + **kwargs: Any + ) -> "_models.NotificationRegistration": + """Creates or updates a notification registration. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param notification_registration_name: The notification registration. + :type notification_registration_name: str + :param properties: The required body parameters supplied to the notification registration + operation. + :type properties: ~azure.mgmt.providerhub.models.NotificationRegistration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NotificationRegistration, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.NotificationRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'NotificationRegistration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + notification_registration_name=notification_registration_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NotificationRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}'} # type: ignore + + + @distributed_trace + def delete( + self, + provider_namespace: str, + notification_registration_name: str, + **kwargs: Any + ) -> None: + """Deletes a notification registration. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param notification_registration_name: The notification registration. + :type notification_registration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + notification_registration_name=notification_registration_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}'} # type: ignore + + + @distributed_trace + def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> Iterable["_models.NotificationRegistrationArrayResponseWithContinuation"]: + """Gets the list of the notification registrations for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either + NotificationRegistrationArrayResponseWithContinuation or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.NotificationRegistrationArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationRegistrationArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NotificationRegistrationArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations'} # type: ignore diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_operations.py new file mode 100644 index 000000000000..d4c73ad11b5a --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_operations.py @@ -0,0 +1,389 @@ +# 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar +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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.ProviderHub/operations') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_provider_registration_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + provider_namespace: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class Operations(object): + """Operations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.OperationsDefinitionArrayResponseWithContinuation"]: + """Lists all the operations supported by Microsoft.ProviderHub. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationsDefinitionArrayResponseWithContinuation + or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.OperationsDefinitionArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsDefinitionArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationsDefinitionArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ProviderHub/operations'} # type: ignore + + @distributed_trace + def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> List["_models.OperationsDefinition"]: + """Gets the operations supported by the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of OperationsDefinition, or the result of cls(response) + :rtype: list[~azure.mgmt.providerhub.models.OperationsDefinition] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.OperationsDefinition"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[OperationsDefinition]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default'} # type: ignore + + + @distributed_trace + def create_or_update( + self, + provider_namespace: str, + operations_put_content: "_models.OperationsPutContent", + **kwargs: Any + ) -> "_models.OperationsContent": + """Creates or updates the operation supported by the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param operations_put_content: The operations content properties supplied to the CreateOrUpdate + operation. + :type operations_put_content: ~azure.mgmt.providerhub.models.OperationsPutContent + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationsContent, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.OperationsContent + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsContent"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(operations_put_content, 'OperationsPutContent') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationsContent', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default'} # type: ignore + + + @distributed_trace + def delete( + self, + provider_namespace: str, + **kwargs: Any + ) -> None: + """Deletes an operation. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default'} # type: ignore + diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_provider_hub_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_provider_hub_operations.py new file mode 100644 index 000000000000..7fadb5be679a --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_provider_hub_operations.py @@ -0,0 +1,208 @@ +# 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 functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_generate_manifest_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateManifest') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_checkin_manifest_request( + subscription_id: str, + provider_namespace: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/checkinManifest') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class ProviderHubOperationsMixin(object): + + @distributed_trace + def generate_manifest( + self, + provider_namespace: str, + **kwargs: Any + ) -> "_models.ResourceProviderManifest": + """Generates the manifest for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceProviderManifest, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.ResourceProviderManifest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderManifest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_generate_manifest_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.generate_manifest.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceProviderManifest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + generate_manifest.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateManifest'} # type: ignore + + + @distributed_trace + def checkin_manifest( + self, + provider_namespace: str, + checkin_manifest_params: "_models.CheckinManifestParams", + **kwargs: Any + ) -> "_models.CheckinManifestInfo": + """Checkin the manifest. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param checkin_manifest_params: The required body parameters supplied to the checkin manifest + operation. + :type checkin_manifest_params: ~azure.mgmt.providerhub.models.CheckinManifestParams + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckinManifestInfo, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.CheckinManifestInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckinManifestInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(checkin_manifest_params, 'CheckinManifestParams') + + request = build_checkin_manifest_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + content_type=content_type, + json=_json, + template_url=self.checkin_manifest.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckinManifestInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + checkin_manifest.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/checkinManifest'} # type: ignore + diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_provider_registrations_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_provider_registrations_operations.py new file mode 100644 index 000000000000..93d7bff2f5a8 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_provider_registrations_operations.py @@ -0,0 +1,542 @@ +# 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union +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 HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + provider_namespace: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_generate_operations_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateOperations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class ProviderRegistrationsOperations(object): + """ProviderRegistrationsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace + def get( + self, + provider_namespace: str, + **kwargs: Any + ) -> "_models.ProviderRegistration": + """Gets the provider registration details. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProviderRegistration, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.ProviderRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProviderRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProviderRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}'} # type: ignore + + + def _create_or_update_initial( + self, + provider_namespace: str, + properties: "_models.ProviderRegistration", + **kwargs: Any + ) -> Optional["_models.ProviderRegistration"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProviderRegistration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'ProviderRegistration') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + provider_namespace: str, + properties: "_models.ProviderRegistration", + **kwargs: Any + ) -> LROPoller["_models.ProviderRegistration"]: + """Creates or updates the provider registration. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param properties: The provider registration properties supplied to the CreateOrUpdate + operation. + :type properties: ~azure.mgmt.providerhub.models.ProviderRegistration + :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: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a 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 ProviderRegistration or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.providerhub.models.ProviderRegistration] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProviderRegistration"] + 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( + provider_namespace=provider_namespace, + properties=properties, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ProviderRegistration', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}'} # type: ignore + + @distributed_trace + def delete( + self, + provider_namespace: str, + **kwargs: Any + ) -> None: + """Deletes a provider registration. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}'} # type: ignore + + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.ProviderRegistrationArrayResponseWithContinuation"]: + """Gets the list of the provider registrations in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProviderRegistrationArrayResponseWithContinuation + or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.ProviderRegistrationArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProviderRegistrationArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ProviderRegistrationArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations'} # type: ignore + + @distributed_trace + def generate_operations( + self, + provider_namespace: str, + **kwargs: Any + ) -> List["_models.OperationsDefinition"]: + """Generates the operations api for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of OperationsDefinition, or the result of cls(response) + :rtype: list[~azure.mgmt.providerhub.models.OperationsDefinition] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.OperationsDefinition"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_generate_operations_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.generate_operations.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[OperationsDefinition]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + generate_operations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateOperations'} # type: ignore + diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_resource_type_registrations_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_resource_type_registrations_operations.py new file mode 100644 index 000000000000..a1c0b9bb6fda --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_resource_type_registrations_operations.py @@ -0,0 +1,490 @@ +# 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +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 HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + provider_namespace: str, + resource_type: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_provider_registration_request( + subscription_id: str, + provider_namespace: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class ResourceTypeRegistrationsOperations(object): + """ResourceTypeRegistrationsOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace + def get( + self, + provider_namespace: str, + resource_type: str, + **kwargs: Any + ) -> "_models.ResourceTypeRegistration": + """Gets a resource type details in the given subscription and provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceTypeRegistration, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.ResourceTypeRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceTypeRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceTypeRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}'} # type: ignore + + + def _create_or_update_initial( + self, + provider_namespace: str, + resource_type: str, + properties: "_models.ResourceTypeRegistration", + **kwargs: Any + ) -> "_models.ResourceTypeRegistration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceTypeRegistration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'ResourceTypeRegistration') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ResourceTypeRegistration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ResourceTypeRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + provider_namespace: str, + resource_type: str, + properties: "_models.ResourceTypeRegistration", + **kwargs: Any + ) -> LROPoller["_models.ResourceTypeRegistration"]: + """Creates or updates a resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param properties: The required request body parameters supplied to the resource type + registration CreateOrUpdate operation. + :type properties: ~azure.mgmt.providerhub.models.ResourceTypeRegistration + :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: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a 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 ResourceTypeRegistration or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.providerhub.models.ResourceTypeRegistration] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceTypeRegistration"] + 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( + provider_namespace=provider_namespace, + resource_type=resource_type, + properties=properties, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ResourceTypeRegistration', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}'} # type: ignore + + @distributed_trace + def delete( + self, + provider_namespace: str, + resource_type: str, + **kwargs: Any + ) -> None: + """Deletes a resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}'} # type: ignore + + + @distributed_trace + def list_by_provider_registration( + self, + provider_namespace: str, + **kwargs: Any + ) -> Iterable["_models.ResourceTypeRegistrationArrayResponseWithContinuation"]: + """Gets the list of the resource types for the given provider. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either + ResourceTypeRegistrationArrayResponseWithContinuation or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.ResourceTypeRegistrationArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceTypeRegistrationArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=self.list_by_provider_registration.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_provider_registration_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ResourceTypeRegistrationArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_provider_registration.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations'} # type: ignore diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_skus_operations.py b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_skus_operations.py new file mode 100644 index 000000000000..b18394df63b5 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/operations/_skus_operations.py @@ -0,0 +1,1811 @@ +# 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 functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + sku: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + sku: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + sku: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_nested_resource_type_first_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + sku: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_nested_resource_type_first_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + sku: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_nested_resource_type_first_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + sku: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_nested_resource_type_second_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + sku: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "nestedResourceTypeSecond": _SERIALIZER.url("nested_resource_type_second", nested_resource_type_second, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_nested_resource_type_second_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + sku: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "nestedResourceTypeSecond": _SERIALIZER.url("nested_resource_type_second", nested_resource_type_second, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_nested_resource_type_second_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + sku: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "nestedResourceTypeSecond": _SERIALIZER.url("nested_resource_type_second", nested_resource_type_second, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_nested_resource_type_third_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + sku: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "nestedResourceTypeSecond": _SERIALIZER.url("nested_resource_type_second", nested_resource_type_second, 'str'), + "nestedResourceTypeThird": _SERIALIZER.url("nested_resource_type_third", nested_resource_type_third, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_nested_resource_type_third_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + sku: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "nestedResourceTypeSecond": _SERIALIZER.url("nested_resource_type_second", nested_resource_type_second, 'str'), + "nestedResourceTypeThird": _SERIALIZER.url("nested_resource_type_third", nested_resource_type_third, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_nested_resource_type_third_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + sku: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "nestedResourceTypeSecond": _SERIALIZER.url("nested_resource_type_second", nested_resource_type_second, 'str'), + "nestedResourceTypeThird": _SERIALIZER.url("nested_resource_type_third", nested_resource_type_third, 'str'), + "sku": _SERIALIZER.url("sku", sku, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_type_registrations_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_type_registrations_nested_resource_type_first_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_type_registrations_nested_resource_type_second_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "nestedResourceTypeSecond": _SERIALIZER.url("nested_resource_type_second", nested_resource_type_second, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_type_registrations_nested_resource_type_third_request( + subscription_id: str, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-11-20" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, 'str'), + "resourceType": _SERIALIZER.url("resource_type", resource_type, 'str'), + "nestedResourceTypeFirst": _SERIALIZER.url("nested_resource_type_first", nested_resource_type_first, 'str'), + "nestedResourceTypeSecond": _SERIALIZER.url("nested_resource_type_second", nested_resource_type_second, 'str'), + "nestedResourceTypeThird": _SERIALIZER.url("nested_resource_type_third", nested_resource_type_third, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class SkusOperations(object): + """SkusOperations 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: ~azure.mgmt.providerhub.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 + + @distributed_trace + def get( + self, + provider_namespace: str, + resource_type: str, + sku: str, + **kwargs: Any + ) -> "_models.SkuResource": + """Gets the sku details for the given resource type and sku name. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + sku=sku, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}'} # type: ignore + + + @distributed_trace + def create_or_update( + self, + provider_namespace: str, + resource_type: str, + sku: str, + properties: "_models.SkuResource", + **kwargs: Any + ) -> "_models.SkuResource": + """Creates or updates the resource type skus in the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param sku: The SKU. + :type sku: str + :param properties: The required body parameters supplied to the resource sku operation. + :type properties: ~azure.mgmt.providerhub.models.SkuResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'SkuResource') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + sku=sku, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}'} # type: ignore + + + @distributed_trace + def delete( + self, + provider_namespace: str, + resource_type: str, + sku: str, + **kwargs: Any + ) -> None: + """Deletes a resource type sku. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + sku=sku, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}'} # type: ignore + + + @distributed_trace + def get_nested_resource_type_first( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + sku: str, + **kwargs: Any + ) -> "_models.SkuResource": + """Gets the sku details for the given resource type and sku name. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + sku=sku, + template_url=self.get_nested_resource_type_first.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_nested_resource_type_first.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}'} # type: ignore + + + @distributed_trace + def create_or_update_nested_resource_type_first( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + sku: str, + properties: "_models.SkuResource", + **kwargs: Any + ) -> "_models.SkuResource": + """Creates or updates the resource type skus in the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param sku: The SKU. + :type sku: str + :param properties: The required body parameters supplied to the resource sku operation. + :type properties: ~azure.mgmt.providerhub.models.SkuResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'SkuResource') + + request = build_create_or_update_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + sku=sku, + content_type=content_type, + json=_json, + template_url=self.create_or_update_nested_resource_type_first.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update_nested_resource_type_first.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}'} # type: ignore + + + @distributed_trace + def delete_nested_resource_type_first( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + sku: str, + **kwargs: Any + ) -> None: + """Deletes a resource type sku. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + sku=sku, + template_url=self.delete_nested_resource_type_first.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_nested_resource_type_first.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}'} # type: ignore + + + @distributed_trace + def get_nested_resource_type_second( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + sku: str, + **kwargs: Any + ) -> "_models.SkuResource": + """Gets the sku details for the given resource type and sku name. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + sku=sku, + template_url=self.get_nested_resource_type_second.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_nested_resource_type_second.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}'} # type: ignore + + + @distributed_trace + def create_or_update_nested_resource_type_second( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + sku: str, + properties: "_models.SkuResource", + **kwargs: Any + ) -> "_models.SkuResource": + """Creates or updates the resource type skus in the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param sku: The SKU. + :type sku: str + :param properties: The required body parameters supplied to the resource sku operation. + :type properties: ~azure.mgmt.providerhub.models.SkuResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'SkuResource') + + request = build_create_or_update_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + sku=sku, + content_type=content_type, + json=_json, + template_url=self.create_or_update_nested_resource_type_second.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update_nested_resource_type_second.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}'} # type: ignore + + + @distributed_trace + def delete_nested_resource_type_second( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + sku: str, + **kwargs: Any + ) -> None: + """Deletes a resource type sku. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + sku=sku, + template_url=self.delete_nested_resource_type_second.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_nested_resource_type_second.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}'} # type: ignore + + + @distributed_trace + def get_nested_resource_type_third( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + sku: str, + **kwargs: Any + ) -> "_models.SkuResource": + """Gets the sku details for the given resource type and sku name. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param nested_resource_type_third: The third child resource type. + :type nested_resource_type_third: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + sku=sku, + template_url=self.get_nested_resource_type_third.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_nested_resource_type_third.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}'} # type: ignore + + + @distributed_trace + def create_or_update_nested_resource_type_third( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + sku: str, + properties: "_models.SkuResource", + **kwargs: Any + ) -> "_models.SkuResource": + """Creates or updates the resource type skus in the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param nested_resource_type_third: The third child resource type. + :type nested_resource_type_third: str + :param sku: The SKU. + :type sku: str + :param properties: The required body parameters supplied to the resource sku operation. + :type properties: ~azure.mgmt.providerhub.models.SkuResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuResource, or the result of cls(response) + :rtype: ~azure.mgmt.providerhub.models.SkuResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'SkuResource') + + request = build_create_or_update_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + sku=sku, + content_type=content_type, + json=_json, + template_url=self.create_or_update_nested_resource_type_third.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update_nested_resource_type_third.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}'} # type: ignore + + + @distributed_trace + def delete_nested_resource_type_third( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + sku: str, + **kwargs: Any + ) -> None: + """Deletes a resource type sku. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param nested_resource_type_third: The third child resource type. + :type nested_resource_type_third: str + :param sku: The SKU. + :type sku: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + sku=sku, + template_url=self.delete_nested_resource_type_third.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_nested_resource_type_third.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}'} # type: ignore + + + @distributed_trace + def list_by_resource_type_registrations( + self, + provider_namespace: str, + resource_type: str, + **kwargs: Any + ) -> Iterable["_models.SkuResourceArrayResponseWithContinuation"]: + """Gets the list of skus for the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuResourceArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.SkuResourceArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_type_registrations_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + template_url=self.list_by_resource_type_registrations.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_type_registrations_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SkuResourceArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_type_registrations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus'} # type: ignore + + @distributed_trace + def list_by_resource_type_registrations_nested_resource_type_first( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + **kwargs: Any + ) -> Iterable["_models.SkuResourceArrayResponseWithContinuation"]: + """Gets the list of skus for the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuResourceArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.SkuResourceArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_type_registrations_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + template_url=self.list_by_resource_type_registrations_nested_resource_type_first.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_type_registrations_nested_resource_type_first_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SkuResourceArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_type_registrations_nested_resource_type_first.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus'} # type: ignore + + @distributed_trace + def list_by_resource_type_registrations_nested_resource_type_second( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + **kwargs: Any + ) -> Iterable["_models.SkuResourceArrayResponseWithContinuation"]: + """Gets the list of skus for the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuResourceArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.SkuResourceArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_type_registrations_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + template_url=self.list_by_resource_type_registrations_nested_resource_type_second.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_type_registrations_nested_resource_type_second_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SkuResourceArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_type_registrations_nested_resource_type_second.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus'} # type: ignore + + @distributed_trace + def list_by_resource_type_registrations_nested_resource_type_third( + self, + provider_namespace: str, + resource_type: str, + nested_resource_type_first: str, + nested_resource_type_second: str, + nested_resource_type_third: str, + **kwargs: Any + ) -> Iterable["_models.SkuResourceArrayResponseWithContinuation"]: + """Gets the list of skus for the given resource type. + + :param provider_namespace: The name of the resource provider hosted within ProviderHub. + :type provider_namespace: str + :param resource_type: The resource type. + :type resource_type: str + :param nested_resource_type_first: The first child resource type. + :type nested_resource_type_first: str + :param nested_resource_type_second: The second child resource type. + :type nested_resource_type_second: str + :param nested_resource_type_third: The third child resource type. + :type nested_resource_type_third: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuResourceArrayResponseWithContinuation or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.providerhub.models.SkuResourceArrayResponseWithContinuation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuResourceArrayResponseWithContinuation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_type_registrations_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + template_url=self.list_by_resource_type_registrations_nested_resource_type_third.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_type_registrations_nested_resource_type_third_request( + subscription_id=self._config.subscription_id, + provider_namespace=provider_namespace, + resource_type=resource_type, + nested_resource_type_first=nested_resource_type_first, + nested_resource_type_second=nested_resource_type_second, + nested_resource_type_third=nested_resource_type_third, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SkuResourceArrayResponseWithContinuation", 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_type_registrations_nested_resource_type_third.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus'} # type: ignore diff --git a/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/py.typed b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/azure/mgmt/providerhub/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/providerhub/azure-mgmt-providerhub/sdk_packaging.toml b/sdk/providerhub/azure-mgmt-providerhub/sdk_packaging.toml new file mode 100644 index 000000000000..1b9e45a64944 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-mgmt-providerhub" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true diff --git a/sdk/providerhub/azure-mgmt-providerhub/setup.py b/sdk/providerhub/azure-mgmt-providerhub/setup.py new file mode 100644 index 000000000000..dac7ab4c8d50 --- /dev/null +++ b/sdk/providerhub/azure-mgmt-providerhub/setup.py @@ -0,0 +1,74 @@ +#!/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. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-providerhub" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'azure-common~=1.1', + 'azure-mgmt-core>=1.3.0,<2.0.0', + ], + python_requires=">=3.6" +) diff --git a/sdk/providerhub/ci.yml b/sdk/providerhub/ci.yml new file mode 100644 index 000000000000..e46677aac99b --- /dev/null +++ b/sdk/providerhub/ci.yml @@ -0,0 +1,33 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/providerhub/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/providerhub/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: providerhub + Artifacts: + - name: azure-mgmt-providerhub + safeName: azuremgmtproviderhub