diff --git a/sdk/relay/azure-mgmt-relay/CHANGELOG.md b/sdk/relay/azure-mgmt-relay/CHANGELOG.md index 72b9f95a10b5..5fc85510b82c 100644 --- a/sdk/relay/azure-mgmt-relay/CHANGELOG.md +++ b/sdk/relay/azure-mgmt-relay/CHANGELOG.md @@ -1,5 +1,35 @@ # Release History +## 1.0.0b1 (2019-05-16) + +This is beta preview version. + +This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming). + +**General breaking changes** + +- Credential system has been completly revamped: + + - `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/ + - `credentials` parameter has been renamed `credential` + +- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of + supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) +- You can't import a `version` module anymore, use `__version__` instead +- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`. +- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed). +- Most of the operation kwarg have changed. Some of the most noticeable: + + - `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user + - For a complete set of + supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) + +**General new features** + +- Type annotations support using `typing`. SDKs are mypy ready. +- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client. +- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview. + ## 0.2.0 (2019-05-16) **Note** diff --git a/sdk/relay/azure-mgmt-relay/README.md b/sdk/relay/azure-mgmt-relay/README.md index f17218c7fab0..fb7087f26b72 100644 --- a/sdk/relay/azure-mgmt-relay/README.md +++ b/sdk/relay/azure-mgmt-relay/README.md @@ -16,9 +16,15 @@ For a more complete set of Azure libraries, see the ## Usage -For code examples, see -[Relay](https://docs.microsoft.com/python/api/overview/azure/relay) on -docs.microsoft.com. + +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 [Relay 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 diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/__init__.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/__init__.py index 2ec056f921c3..2fd04de028b3 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/__init__.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/__init__.py @@ -1,18 +1,19 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from .relay_management_client import RelayManagementClient -from .version import VERSION - -__all__ = ['RelayManagementClient'] +from ._relay_api import RelayAPI +from ._version import VERSION __version__ = VERSION +__all__ = ['RelayAPI'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_configuration.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_configuration.py new file mode 100644 index 000000000000..78cd5876565e --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class RelayAPIConfiguration(Configuration): + """Configuration for RelayAPI. + + 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: Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(RelayAPIConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2017-04-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-relay/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_relay_api.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_relay_api.py new file mode 100644 index 000000000000..0786f6e6b3c6 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_relay_api.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import RelayAPIConfiguration +from .operations import Operations +from .operations import NamespacesOperations +from .operations import HybridConnectionsOperations +from .operations import WCFRelaysOperations +from . import models + + +class RelayAPI(object): + """Use these API to manage Azure Relay resources through Azure Resource Manager. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.relay.operations.Operations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: azure.mgmt.relay.operations.NamespacesOperations + :ivar hybrid_connections: HybridConnectionsOperations operations + :vartype hybrid_connections: azure.mgmt.relay.operations.HybridConnectionsOperations + :ivar wcf_relays: WCFRelaysOperations operations + :vartype wcf_relays: azure.mgmt.relay.operations.WCFRelaysOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = RelayAPIConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.namespaces = NamespacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hybrid_connections = HybridConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.wcf_relays = WCFRelaysOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> RelayAPI + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/version.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_version.py similarity index 84% rename from sdk/relay/azure-mgmt-relay/azure/mgmt/relay/version.py rename to sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_version.py index 9bd1dfac7ecb..e5754a47ce68 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/version.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_version.py @@ -1,13 +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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.2.0" - +VERSION = "1.0.0b1" diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/__init__.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/__init__.py new file mode 100644 index 000000000000..8837f93b82a5 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._relay_api import RelayAPI +__all__ = ['RelayAPI'] diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_configuration.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_configuration.py new file mode 100644 index 000000000000..ab055d2c1f98 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/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 + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class RelayAPIConfiguration(Configuration): + """Configuration for RelayAPI. + + 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: Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(RelayAPIConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2017-04-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-relay/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_relay_api.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_relay_api.py new file mode 100644 index 000000000000..1d0bdc654b74 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/_relay_api.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import RelayAPIConfiguration +from .operations import Operations +from .operations import NamespacesOperations +from .operations import HybridConnectionsOperations +from .operations import WCFRelaysOperations +from .. import models + + +class RelayAPI(object): + """Use these API to manage Azure Relay resources through Azure Resource Manager. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.relay.aio.operations.Operations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: azure.mgmt.relay.aio.operations.NamespacesOperations + :ivar hybrid_connections: HybridConnectionsOperations operations + :vartype hybrid_connections: azure.mgmt.relay.aio.operations.HybridConnectionsOperations + :ivar wcf_relays: WCFRelaysOperations operations + :vartype wcf_relays: azure.mgmt.relay.aio.operations.WCFRelaysOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = RelayAPIConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.namespaces = NamespacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hybrid_connections = HybridConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.wcf_relays = WCFRelaysOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "RelayAPI": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/__init__.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/__init__.py new file mode 100644 index 000000000000..772eceb28d8f --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._namespaces_operations import NamespacesOperations +from ._hybrid_connections_operations import HybridConnectionsOperations +from ._wcf_relays_operations import WCFRelaysOperations + +__all__ = [ + 'Operations', + 'NamespacesOperations', + 'HybridConnectionsOperations', + 'WCFRelaysOperations', +] diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_hybrid_connections_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_hybrid_connections_operations.py new file mode 100644 index 000000000000..6108492cf8f5 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_hybrid_connections_operations.py @@ -0,0 +1,738 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class HybridConnectionsOperations: + """HybridConnectionsOperations 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.relay.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs + ) -> AsyncIterable["models.HybridConnectionListResult"]: + """Lists the hybrid connection within the namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.relay.models.HybridConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_namespace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HybridConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + hybrid_connection_name: str, + parameters: "models.HybridConnection", + **kwargs + ) -> "models.HybridConnection": + """Creates or updates a service hybrid connection. This operation is idempotent. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param parameters: Parameters supplied to create a hybrid connection. + :type parameters: ~azure.mgmt.relay.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + namespace_name: str, + hybrid_connection_name: str, + **kwargs + ) -> None: + """Deletes a hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + namespace_name: str, + hybrid_connection_name: str, + **kwargs + ) -> "models.HybridConnection": + """Returns the description for the specified hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name: str, + namespace_name: str, + hybrid_connection_name: str, + **kwargs + ) -> AsyncIterable["models.AuthorizationRuleListResult"]: + """Authorization rules for a hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.relay.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules'} # type: ignore + + async def create_or_update_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + hybrid_connection_name: str, + authorization_rule_name: str, + parameters: "models.AuthorizationRule", + **kwargs + ) -> "models.AuthorizationRule": + """Creates or updates an authorization rule for a hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The authorization rule parameters. + :type parameters: ~azure.mgmt.relay.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def delete_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + hybrid_connection_name: str, + authorization_rule_name: str, + **kwargs + ) -> None: + """Deletes a hybrid connection authorization rule. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def get_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + hybrid_connection_name: str, + authorization_rule_name: str, + **kwargs + ) -> "models.AuthorizationRule": + """Hybrid connection authorization rule for a hybrid connection by name. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + namespace_name: str, + hybrid_connection_name: str, + authorization_rule_name: str, + **kwargs + ) -> "models.AccessKeys": + """Primary and secondary connection strings to the hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + async def regenerate_keys( + self, + resource_group_name: str, + namespace_name: str, + hybrid_connection_name: str, + authorization_rule_name: str, + parameters: "models.RegenerateAccessKeyParameters", + **kwargs + ) -> "models.AccessKeys": + """Regenerates the primary or secondary connection strings to the hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters supplied to regenerate authorization rule. + :type parameters: ~azure.mgmt.relay.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_namespaces_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_namespaces_operations.py new file mode 100644 index 000000000000..0f343a60ce13 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_namespaces_operations.py @@ -0,0 +1,1002 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NamespacesOperations: + """NamespacesOperations 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.relay.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_name_availability( + self, + parameters: "models.CheckNameAvailability", + **kwargs + ) -> "models.CheckNameAvailabilityResult": + """Check the specified namespace name availability. + + :param parameters: Parameters to check availability of the specified namespace name. + :type parameters: ~azure.mgmt.relay.models.CheckNameAvailability + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckNameAvailability') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["models.RelayNamespaceListResult"]: + """Lists all the available namespaces within the subscription regardless of the resourceGroups. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RelayNamespaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.relay.models.RelayNamespaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RelayNamespaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.RelayNamespaceListResult"]: + """Lists all the available namespaces within the ResourceGroup. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RelayNamespaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.relay.models.RelayNamespaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RelayNamespaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + namespace_name: str, + parameters: "models.RelayNamespace", + **kwargs + ) -> "models.RelayNamespace": + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespace"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RelayNamespace') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + namespace_name: str, + parameters: "models.RelayNamespace", + **kwargs + ) -> AsyncLROPoller["models.RelayNamespace"]: + """Create Azure Relay namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param parameters: Parameters supplied to create a namespace resource. + :type parameters: ~azure.mgmt.relay.models.RelayNamespace + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RelayNamespace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.relay.models.RelayNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespace"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + namespace_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing namespace. This operation also removes all associated resources under the + namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + namespace_name: str, + **kwargs + ) -> "models.RelayNamespace": + """Returns the description for the specified namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayNamespace, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.RelayNamespace + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespace"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + namespace_name: str, + parameters: "models.RelayUpdateParameters", + **kwargs + ) -> "models.RelayNamespace": + """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. + This operation is idempotent. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param parameters: Parameters for updating a namespace resource. + :type parameters: ~azure.mgmt.relay.models.RelayUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayNamespace, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.RelayNamespace + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespace"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RelayUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name: str, + namespace_name: str, + **kwargs + ) -> AsyncIterable["models.AuthorizationRuleListResult"]: + """Authorization rules for a namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.relay.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules'} # type: ignore + + async def create_or_update_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + parameters: "models.AuthorizationRule", + **kwargs + ) -> "models.AuthorizationRule": + """Creates or updates an authorization rule for a namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The authorization rule parameters. + :type parameters: ~azure.mgmt.relay.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def delete_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + **kwargs + ) -> None: + """Deletes a namespace authorization rule. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def get_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + **kwargs + ) -> "models.AuthorizationRule": + """Authorization rule for a namespace by name. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + **kwargs + ) -> "models.AccessKeys": + """Primary and secondary connection strings to the namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + async def regenerate_keys( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + parameters: "models.RegenerateAccessKeyParameters", + **kwargs + ) -> "models.AccessKeys": + """Regenerates the primary or secondary connection strings to the namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters supplied to regenerate authorization rule. + :type parameters: ~azure.mgmt.relay.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_operations.py new file mode 100644 index 000000000000..f399d78fb156 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.relay.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.OperationListResult"]: + """Lists all available Relay REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.relay.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Relay/operations'} # type: ignore diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_wcf_relays_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_wcf_relays_operations.py new file mode 100644 index 000000000000..a1b9bd67bd0c --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/aio/operations/_wcf_relays_operations.py @@ -0,0 +1,739 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WCFRelaysOperations: + """WCFRelaysOperations 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.relay.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs + ) -> AsyncIterable["models.WcfRelaysListResult"]: + """Lists the WCF relays within the namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WcfRelaysListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.relay.models.WcfRelaysListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WcfRelaysListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_namespace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WcfRelaysListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + relay_name: str, + parameters: "models.WcfRelay", + **kwargs + ) -> "models.WcfRelay": + """Creates or updates a WCF relay. This operation is idempotent. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param parameters: Parameters supplied to create a WCF relay. + :type parameters: ~azure.mgmt.relay.models.WcfRelay + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WcfRelay, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.WcfRelay + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WcfRelay"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'WcfRelay') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WcfRelay', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> None: + """Deletes a WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> Optional["models.WcfRelay"]: + """Returns the description for the specified WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WcfRelay, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.WcfRelay or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.WcfRelay"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WcfRelay', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name: str, + namespace_name: str, + relay_name: str, + **kwargs + ) -> AsyncIterable["models.AuthorizationRuleListResult"]: + """Authorization rules for a WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.relay.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules'} # type: ignore + + async def create_or_update_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + relay_name: str, + authorization_rule_name: str, + parameters: "models.AuthorizationRule", + **kwargs + ) -> "models.AuthorizationRule": + """Creates or updates an authorization rule for a WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The authorization rule parameters. + :type parameters: ~azure.mgmt.relay.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def delete_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + relay_name: str, + authorization_rule_name: str, + **kwargs + ) -> None: + """Deletes a WCF relay authorization rule. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def get_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + relay_name: str, + authorization_rule_name: str, + **kwargs + ) -> "models.AuthorizationRule": + """Get authorizationRule for a WCF relay by name. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + namespace_name: str, + relay_name: str, + authorization_rule_name: str, + **kwargs + ) -> "models.AccessKeys": + """Primary and secondary connection strings to the WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + async def regenerate_keys( + self, + resource_group_name: str, + namespace_name: str, + relay_name: str, + authorization_rule_name: str, + parameters: "models.RegenerateAccessKeyParameters", + **kwargs + ) -> "models.AccessKeys": + """Regenerates the primary or secondary connection strings to the WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters supplied to regenerate authorization rule. + :type parameters: ~azure.mgmt.relay.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/__init__.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/__init__.py index ad1ad778033b..9feb1e8435df 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/__init__.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/__init__.py @@ -1,88 +1,89 @@ # 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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- try: - from .tracked_resource_py3 import TrackedResource - from .resource_namespace_patch_py3 import ResourceNamespacePatch - from .resource_py3 import Resource - from .hybrid_connection_py3 import HybridConnection - from .wcf_relay_py3 import WcfRelay - from .sku_py3 import Sku - from .relay_namespace_py3 import RelayNamespace - from .relay_update_parameters_py3 import RelayUpdateParameters - from .authorization_rule_py3 import AuthorizationRule - from .access_keys_py3 import AccessKeys - from .regenerate_access_key_parameters_py3 import RegenerateAccessKeyParameters - from .check_name_availability_py3 import CheckNameAvailability - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .operation_display_py3 import OperationDisplay - from .operation_py3 import Operation - from .error_response_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import AccessKeys + from ._models_py3 import AuthorizationRule + from ._models_py3 import AuthorizationRuleListResult + from ._models_py3 import CheckNameAvailability + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import ErrorResponse + from ._models_py3 import HybridConnection + from ._models_py3 import HybridConnectionListResult + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import RegenerateAccessKeyParameters + from ._models_py3 import RelayNamespace + from ._models_py3 import RelayNamespaceListResult + from ._models_py3 import RelayUpdateParameters + from ._models_py3 import Resource + from ._models_py3 import ResourceNamespacePatch + from ._models_py3 import Sku + from ._models_py3 import TrackedResource + from ._models_py3 import WcfRelay + from ._models_py3 import WcfRelaysListResult except (SyntaxError, ImportError): - from .tracked_resource import TrackedResource - from .resource_namespace_patch import ResourceNamespacePatch - from .resource import Resource - from .hybrid_connection import HybridConnection - from .wcf_relay import WcfRelay - from .sku import Sku - from .relay_namespace import RelayNamespace - from .relay_update_parameters import RelayUpdateParameters - from .authorization_rule import AuthorizationRule - from .access_keys import AccessKeys - from .regenerate_access_key_parameters import RegenerateAccessKeyParameters - from .check_name_availability import CheckNameAvailability - from .check_name_availability_result import CheckNameAvailabilityResult - from .operation_display import OperationDisplay - from .operation import Operation - from .error_response import ErrorResponse, ErrorResponseException -from .operation_paged import OperationPaged -from .relay_namespace_paged import RelayNamespacePaged -from .authorization_rule_paged import AuthorizationRulePaged -from .hybrid_connection_paged import HybridConnectionPaged -from .wcf_relay_paged import WcfRelayPaged -from .relay_management_client_enums import ( - Relaytype, - SkuTier, - ProvisioningStateEnum, + from ._models import AccessKeys # type: ignore + from ._models import AuthorizationRule # type: ignore + from ._models import AuthorizationRuleListResult # type: ignore + from ._models import CheckNameAvailability # type: ignore + from ._models import CheckNameAvailabilityResult # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import HybridConnection # type: ignore + from ._models import HybridConnectionListResult # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import RegenerateAccessKeyParameters # type: ignore + from ._models import RelayNamespace # type: ignore + from ._models import RelayNamespaceListResult # type: ignore + from ._models import RelayUpdateParameters # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceNamespacePatch # type: ignore + from ._models import Sku # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import WcfRelay # type: ignore + from ._models import WcfRelaysListResult # type: ignore + +from ._relay_api_enums import ( AccessRights, KeyType, + ProvisioningStateEnum, + Relaytype, UnavailableReason, ) __all__ = [ - 'TrackedResource', - 'ResourceNamespacePatch', - 'Resource', - 'HybridConnection', - 'WcfRelay', - 'Sku', - 'RelayNamespace', - 'RelayUpdateParameters', - 'AuthorizationRule', 'AccessKeys', - 'RegenerateAccessKeyParameters', + 'AuthorizationRule', + 'AuthorizationRuleListResult', 'CheckNameAvailability', 'CheckNameAvailabilityResult', - 'OperationDisplay', + 'ErrorResponse', + 'HybridConnection', + 'HybridConnectionListResult', 'Operation', - 'ErrorResponse', 'ErrorResponseException', - 'OperationPaged', - 'RelayNamespacePaged', - 'AuthorizationRulePaged', - 'HybridConnectionPaged', - 'WcfRelayPaged', - 'Relaytype', - 'SkuTier', - 'ProvisioningStateEnum', + 'OperationDisplay', + 'OperationListResult', + 'RegenerateAccessKeyParameters', + 'RelayNamespace', + 'RelayNamespaceListResult', + 'RelayUpdateParameters', + 'Resource', + 'ResourceNamespacePatch', + 'Sku', + 'TrackedResource', + 'WcfRelay', + 'WcfRelaysListResult', 'AccessRights', 'KeyType', + 'ProvisioningStateEnum', + 'Relaytype', 'UnavailableReason', ] diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models.py new file mode 100644 index 000000000000..5ef1a6551e4b --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models.py @@ -0,0 +1,811 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AccessKeys(msrest.serialization.Model): + """Namespace/Relay Connection String. + + :param primary_connection_string: Primary connection string of the created namespace + authorization rule. + :type primary_connection_string: str + :param secondary_connection_string: Secondary connection string of the created namespace + authorization rule. + :type secondary_connection_string: str + :param primary_key: A base64-encoded 256-bit primary key for signing and validating the SAS + token. + :type primary_key: str + :param secondary_key: A base64-encoded 256-bit secondary key for signing and validating the SAS + token. + :type secondary_key: str + :param key_name: A string that describes the authorization rule. + :type key_name: str + """ + + _attribute_map = { + 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, + 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessKeys, self).__init__(**kwargs) + self.primary_connection_string = kwargs.get('primary_connection_string', None) + self.secondary_connection_string = kwargs.get('secondary_connection_string', None) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.key_name = kwargs.get('key_name', None) + + +class Resource(msrest.serialization.Model): + """The resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :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 AuthorizationRule(Resource): + """Description of a namespace authorization rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param rights: Required. The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rights': {'required': True, 'unique': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rights': {'key': 'properties.rights', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AuthorizationRule, self).__init__(**kwargs) + self.rights = kwargs['rights'] + + +class AuthorizationRuleListResult(msrest.serialization.Model): + """The response from the list namespace operation. + + :param value: Result of the list authorization rules operation. + :type value: list[~azure.mgmt.relay.models.AuthorizationRule] + :param next_link: Link to the next set of results. Not empty if value contains incomplete list + of authorization rules. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AuthorizationRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AuthorizationRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class CheckNameAvailability(msrest.serialization.Model): + """Description of the check name availability request properties. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The namespace name to check for availability. The namespace name can + contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must + end with a letter or number. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailability, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """Description of the check name availability request properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar message: The detailed info regarding the reason associated with the namespace. + :vartype message: str + :param name_available: Value indicating namespace is available. Returns true if the namespace + is available; otherwise, false. + :type name_available: bool + :param reason: The reason for unavailability of a namespace. Possible values include: "None", + "InvalidName", "SubscriptionIsDisabled", "NameInUse", "NameInLockdown", + "TooManyNamespaceInCurrentSubscription". + :type reason: str or ~azure.mgmt.relay.models.UnavailableReason + """ + + _validation = { + 'message': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = None + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + + +class ErrorResponse(msrest.serialization.Model): + """Error reponse indicates Relay service is not able to process the incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class HybridConnection(Resource): + """Description of hybrid connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar created_at: The time the hybrid connection was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar listener_count: The number of listeners for this hybrid connection. Note that min : 1 and + max:25 are supported. + :vartype listener_count: int + :param requires_client_authorization: Returns true if client authorization is needed for this + hybrid connection; otherwise, false. + :type requires_client_authorization: bool + :param user_metadata: The usermetadata is a placeholder to store user-defined string data for + the hybrid connection endpoint. For example, it can be used to store descriptive data, such as + a list of teams and their contact information. Also, user-defined configuration settings can be + stored. + :type user_metadata: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, + 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, + 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnection, self).__init__(**kwargs) + self.created_at = None + self.updated_at = None + self.listener_count = None + self.requires_client_authorization = kwargs.get('requires_client_authorization', None) + self.user_metadata = kwargs.get('user_metadata', None) + + +class HybridConnectionListResult(msrest.serialization.Model): + """The response of the list hybrid connection operation. + + :param value: Result of the list hybrid connections. + :type value: list[~azure.mgmt.relay.models.HybridConnection] + :param next_link: Link to the next set of results. Not empty if value contains incomplete list + hybrid connection operation. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Operation(msrest.serialization.Model): + """A Relay REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.relay.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Relay. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Relay operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Relay operations supported by resource provider. + :vartype value: list[~azure.mgmt.relay.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RegenerateAccessKeyParameters(msrest.serialization.Model): + """Parameters supplied to the regenerate authorization rule operation, specifies which key neeeds to be reset. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The access key to regenerate. Possible values include: "PrimaryKey", + "SecondaryKey". + :type key_type: str or ~azure.mgmt.relay.models.KeyType + :param key: Optional. If the key value is provided, this is set to key type, or autogenerated + key value set for key type. + :type key: str + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RegenerateAccessKeyParameters, self).__init__(**kwargs) + self.key_type = kwargs['key_type'] + self.key = kwargs.get('key', None) + + +class TrackedResource(Resource): + """Definition of resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class RelayNamespace(TrackedResource): + """Description of a namespace resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the namespace. + :type sku: ~azure.mgmt.relay.models.Sku + :ivar provisioning_state: Possible values include: "Created", "Succeeded", "Deleted", + "Failed", "Updating", "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.relay.models.ProvisioningStateEnum + :ivar created_at: The time the namespace was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus operations. + :vartype service_bus_endpoint: str + :ivar metric_id: Identifier for Azure Insights metrics. + :vartype metric_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RelayNamespace, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.provisioning_state = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.metric_id = None + + +class RelayNamespaceListResult(msrest.serialization.Model): + """The response from the list namespace operation. + + :param value: Result of the list namespace operation. + :type value: list[~azure.mgmt.relay.models.RelayNamespace] + :param next_link: Link to the next set of results. Not empty if value contains incomplete list + of namespaces. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RelayNamespace]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RelayNamespaceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ResourceNamespacePatch(Resource): + """Definition of resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceNamespacePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class RelayUpdateParameters(ResourceNamespacePatch): + """Description of a namespace resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the namespace. + :type sku: ~azure.mgmt.relay.models.Sku + :ivar provisioning_state: Possible values include: "Created", "Succeeded", "Deleted", + "Failed", "Updating", "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.relay.models.ProvisioningStateEnum + :ivar created_at: The time the namespace was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus operations. + :vartype service_bus_endpoint: str + :ivar metric_id: Identifier for Azure Insights metrics. + :vartype metric_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RelayUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.provisioning_state = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.metric_id = None + + +class Sku(msrest.serialization.Model): + """SKU of the namespace. + + 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 name: Required. Name of this SKU. Default value: "Standard". + :vartype name: str + :ivar tier: The tier of this SKU. Default value: "Standard". + :vartype tier: str + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + 'tier': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + name = "Standard" + tier = "Standard" + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + + +class WcfRelay(Resource): + """Description of the WCF relay resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar is_dynamic: Returns true if the relay is dynamic; otherwise, false. + :vartype is_dynamic: bool + :ivar created_at: The time the WCF relay was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar listener_count: The number of listeners for this relay. Note that min :1 and max:25 are + supported. + :vartype listener_count: int + :param relay_type: WCF relay type. Possible values include: "NetTcp", "Http". + :type relay_type: str or ~azure.mgmt.relay.models.Relaytype + :param requires_client_authorization: Returns true if client authorization is needed for this + relay; otherwise, false. + :type requires_client_authorization: bool + :param requires_transport_security: Returns true if transport security is needed for this + relay; otherwise, false. + :type requires_transport_security: bool + :param user_metadata: The usermetadata is a placeholder to store user-defined string data for + the WCF Relay endpoint. For example, it can be used to store descriptive data, such as list of + teams and their contact information. Also, user-defined configuration settings can be stored. + :type user_metadata: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_dynamic': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, + 'relay_type': {'key': 'properties.relayType', 'type': 'str'}, + 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, + 'requires_transport_security': {'key': 'properties.requiresTransportSecurity', 'type': 'bool'}, + 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WcfRelay, self).__init__(**kwargs) + self.is_dynamic = None + self.created_at = None + self.updated_at = None + self.listener_count = None + self.relay_type = kwargs.get('relay_type', None) + self.requires_client_authorization = kwargs.get('requires_client_authorization', None) + self.requires_transport_security = kwargs.get('requires_transport_security', None) + self.user_metadata = kwargs.get('user_metadata', None) + + +class WcfRelaysListResult(msrest.serialization.Model): + """The response of the list WCF relay operation. + + :param value: Result of the list WCF relay operation. + :type value: list[~azure.mgmt.relay.models.WcfRelay] + :param next_link: Link to the next set of results. Not empty if value contains incomplete list + of WCF relays. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WcfRelay]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WcfRelaysListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models_py3.py new file mode 100644 index 000000000000..48cdcd8c783e --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_models_py3.py @@ -0,0 +1,868 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._relay_api_enums import * + + +class AccessKeys(msrest.serialization.Model): + """Namespace/Relay Connection String. + + :param primary_connection_string: Primary connection string of the created namespace + authorization rule. + :type primary_connection_string: str + :param secondary_connection_string: Secondary connection string of the created namespace + authorization rule. + :type secondary_connection_string: str + :param primary_key: A base64-encoded 256-bit primary key for signing and validating the SAS + token. + :type primary_key: str + :param secondary_key: A base64-encoded 256-bit secondary key for signing and validating the SAS + token. + :type secondary_key: str + :param key_name: A string that describes the authorization rule. + :type key_name: str + """ + + _attribute_map = { + 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, + 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + *, + primary_connection_string: Optional[str] = None, + secondary_connection_string: Optional[str] = None, + primary_key: Optional[str] = None, + secondary_key: Optional[str] = None, + key_name: Optional[str] = None, + **kwargs + ): + super(AccessKeys, self).__init__(**kwargs) + self.primary_connection_string = primary_connection_string + self.secondary_connection_string = secondary_connection_string + self.primary_key = primary_key + self.secondary_key = secondary_key + self.key_name = key_name + + +class Resource(msrest.serialization.Model): + """The resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :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 AuthorizationRule(Resource): + """Description of a namespace authorization rule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param rights: Required. The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rights': {'required': True, 'unique': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rights': {'key': 'properties.rights', 'type': '[str]'}, + } + + def __init__( + self, + *, + rights: List[Union[str, "AccessRights"]], + **kwargs + ): + super(AuthorizationRule, self).__init__(**kwargs) + self.rights = rights + + +class AuthorizationRuleListResult(msrest.serialization.Model): + """The response from the list namespace operation. + + :param value: Result of the list authorization rules operation. + :type value: list[~azure.mgmt.relay.models.AuthorizationRule] + :param next_link: Link to the next set of results. Not empty if value contains incomplete list + of authorization rules. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AuthorizationRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AuthorizationRule"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AuthorizationRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CheckNameAvailability(msrest.serialization.Model): + """Description of the check name availability request properties. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The namespace name to check for availability. The namespace name can + contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must + end with a letter or number. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(CheckNameAvailability, self).__init__(**kwargs) + self.name = name + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """Description of the check name availability request properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar message: The detailed info regarding the reason associated with the namespace. + :vartype message: str + :param name_available: Value indicating namespace is available. Returns true if the namespace + is available; otherwise, false. + :type name_available: bool + :param reason: The reason for unavailability of a namespace. Possible values include: "None", + "InvalidName", "SubscriptionIsDisabled", "NameInUse", "NameInLockdown", + "TooManyNamespaceInCurrentSubscription". + :type reason: str or ~azure.mgmt.relay.models.UnavailableReason + """ + + _validation = { + 'message': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + reason: Optional[Union[str, "UnavailableReason"]] = None, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = None + self.name_available = name_available + self.reason = reason + + +class ErrorResponse(msrest.serialization.Model): + """Error reponse indicates Relay service is not able to process the incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class HybridConnection(Resource): + """Description of hybrid connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar created_at: The time the hybrid connection was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar listener_count: The number of listeners for this hybrid connection. Note that min : 1 and + max:25 are supported. + :vartype listener_count: int + :param requires_client_authorization: Returns true if client authorization is needed for this + hybrid connection; otherwise, false. + :type requires_client_authorization: bool + :param user_metadata: The usermetadata is a placeholder to store user-defined string data for + the hybrid connection endpoint. For example, it can be used to store descriptive data, such as + a list of teams and their contact information. Also, user-defined configuration settings can be + stored. + :type user_metadata: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, + 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, + 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, + } + + def __init__( + self, + *, + requires_client_authorization: Optional[bool] = None, + user_metadata: Optional[str] = None, + **kwargs + ): + super(HybridConnection, self).__init__(**kwargs) + self.created_at = None + self.updated_at = None + self.listener_count = None + self.requires_client_authorization = requires_client_authorization + self.user_metadata = user_metadata + + +class HybridConnectionListResult(msrest.serialization.Model): + """The response of the list hybrid connection operation. + + :param value: Result of the list hybrid connections. + :type value: list[~azure.mgmt.relay.models.HybridConnection] + :param next_link: Link to the next set of results. Not empty if value contains incomplete list + hybrid connection operation. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["HybridConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(HybridConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Operation(msrest.serialization.Model): + """A Relay REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.relay.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Relay. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Relay operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Relay operations supported by resource provider. + :vartype value: list[~azure.mgmt.relay.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class RegenerateAccessKeyParameters(msrest.serialization.Model): + """Parameters supplied to the regenerate authorization rule operation, specifies which key neeeds to be reset. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The access key to regenerate. Possible values include: "PrimaryKey", + "SecondaryKey". + :type key_type: str or ~azure.mgmt.relay.models.KeyType + :param key: Optional. If the key value is provided, this is set to key type, or autogenerated + key value set for key type. + :type key: str + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__( + self, + *, + key_type: Union[str, "KeyType"], + key: Optional[str] = None, + **kwargs + ): + super(RegenerateAccessKeyParameters, self).__init__(**kwargs) + self.key_type = key_type + self.key = key + + +class TrackedResource(Resource): + """Definition of resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class RelayNamespace(TrackedResource): + """Description of a namespace resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the namespace. + :type sku: ~azure.mgmt.relay.models.Sku + :ivar provisioning_state: Possible values include: "Created", "Succeeded", "Deleted", + "Failed", "Updating", "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.relay.models.ProvisioningStateEnum + :ivar created_at: The time the namespace was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus operations. + :vartype service_bus_endpoint: str + :ivar metric_id: Identifier for Azure Insights metrics. + :vartype metric_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + **kwargs + ): + super(RelayNamespace, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.provisioning_state = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.metric_id = None + + +class RelayNamespaceListResult(msrest.serialization.Model): + """The response from the list namespace operation. + + :param value: Result of the list namespace operation. + :type value: list[~azure.mgmt.relay.models.RelayNamespace] + :param next_link: Link to the next set of results. Not empty if value contains incomplete list + of namespaces. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RelayNamespace]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["RelayNamespace"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RelayNamespaceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ResourceNamespacePatch(Resource): + """Definition of resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ResourceNamespacePatch, self).__init__(**kwargs) + self.tags = tags + + +class RelayUpdateParameters(ResourceNamespacePatch): + """Description of a namespace resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the namespace. + :type sku: ~azure.mgmt.relay.models.Sku + :ivar provisioning_state: Possible values include: "Created", "Succeeded", "Deleted", + "Failed", "Updating", "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.relay.models.ProvisioningStateEnum + :ivar created_at: The time the namespace was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus operations. + :vartype service_bus_endpoint: str + :ivar metric_id: Identifier for Azure Insights metrics. + :vartype metric_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + **kwargs + ): + super(RelayUpdateParameters, self).__init__(tags=tags, **kwargs) + self.sku = sku + self.provisioning_state = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.metric_id = None + + +class Sku(msrest.serialization.Model): + """SKU of the namespace. + + 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 name: Required. Name of this SKU. Default value: "Standard". + :vartype name: str + :ivar tier: The tier of this SKU. Default value: "Standard". + :vartype tier: str + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + 'tier': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + name = "Standard" + tier = "Standard" + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + + +class WcfRelay(Resource): + """Description of the WCF relay resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar is_dynamic: Returns true if the relay is dynamic; otherwise, false. + :vartype is_dynamic: bool + :ivar created_at: The time the WCF relay was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar listener_count: The number of listeners for this relay. Note that min :1 and max:25 are + supported. + :vartype listener_count: int + :param relay_type: WCF relay type. Possible values include: "NetTcp", "Http". + :type relay_type: str or ~azure.mgmt.relay.models.Relaytype + :param requires_client_authorization: Returns true if client authorization is needed for this + relay; otherwise, false. + :type requires_client_authorization: bool + :param requires_transport_security: Returns true if transport security is needed for this + relay; otherwise, false. + :type requires_transport_security: bool + :param user_metadata: The usermetadata is a placeholder to store user-defined string data for + the WCF Relay endpoint. For example, it can be used to store descriptive data, such as list of + teams and their contact information. Also, user-defined configuration settings can be stored. + :type user_metadata: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_dynamic': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, + 'relay_type': {'key': 'properties.relayType', 'type': 'str'}, + 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, + 'requires_transport_security': {'key': 'properties.requiresTransportSecurity', 'type': 'bool'}, + 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, + } + + def __init__( + self, + *, + relay_type: Optional[Union[str, "Relaytype"]] = None, + requires_client_authorization: Optional[bool] = None, + requires_transport_security: Optional[bool] = None, + user_metadata: Optional[str] = None, + **kwargs + ): + super(WcfRelay, self).__init__(**kwargs) + self.is_dynamic = None + self.created_at = None + self.updated_at = None + self.listener_count = None + self.relay_type = relay_type + self.requires_client_authorization = requires_client_authorization + self.requires_transport_security = requires_transport_security + self.user_metadata = user_metadata + + +class WcfRelaysListResult(msrest.serialization.Model): + """The response of the list WCF relay operation. + + :param value: Result of the list WCF relay operation. + :type value: list[~azure.mgmt.relay.models.WcfRelay] + :param next_link: Link to the next set of results. Not empty if value contains incomplete list + of WCF relays. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WcfRelay]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["WcfRelay"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(WcfRelaysListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_relay_api_enums.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_relay_api_enums.py new file mode 100644 index 000000000000..789bf35ba105 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/_relay_api_enums.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 enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessRights(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MANAGE = "Manage" + SEND = "Send" + LISTEN = "Listen" + +class KeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The access key to regenerate. + """ + + PRIMARY_KEY = "PrimaryKey" + SECONDARY_KEY = "SecondaryKey" + +class ProvisioningStateEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + CREATED = "Created" + SUCCEEDED = "Succeeded" + DELETED = "Deleted" + FAILED = "Failed" + UPDATING = "Updating" + UNKNOWN = "Unknown" + +class Relaytype(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """WCF relay type. + """ + + NET_TCP = "NetTcp" + HTTP = "Http" + +class UnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the reason for the unavailability of the service. + """ + + NONE = "None" + INVALID_NAME = "InvalidName" + SUBSCRIPTION_IS_DISABLED = "SubscriptionIsDisabled" + NAME_IN_USE = "NameInUse" + NAME_IN_LOCKDOWN = "NameInLockdown" + TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION = "TooManyNamespaceInCurrentSubscription" diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/access_keys.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/access_keys.py deleted file mode 100644 index 73a3001f45d9..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/access_keys.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AccessKeys(Model): - """Namespace/Relay Connection String. - - :param primary_connection_string: Primary connection string of the created - namespace authorization rule. - :type primary_connection_string: str - :param secondary_connection_string: Secondary connection string of the - created namespace authorization rule. - :type secondary_connection_string: str - :param primary_key: A base64-encoded 256-bit primary key for signing and - validating the SAS token. - :type primary_key: str - :param secondary_key: A base64-encoded 256-bit secondary key for signing - and validating the SAS token. - :type secondary_key: str - :param key_name: A string that describes the authorization rule. - :type key_name: str - """ - - _attribute_map = { - 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, - 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AccessKeys, self).__init__(**kwargs) - self.primary_connection_string = kwargs.get('primary_connection_string', None) - self.secondary_connection_string = kwargs.get('secondary_connection_string', None) - self.primary_key = kwargs.get('primary_key', None) - self.secondary_key = kwargs.get('secondary_key', None) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/access_keys_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/access_keys_py3.py deleted file mode 100644 index 7b2681c8d93d..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/access_keys_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class AccessKeys(Model): - """Namespace/Relay Connection String. - - :param primary_connection_string: Primary connection string of the created - namespace authorization rule. - :type primary_connection_string: str - :param secondary_connection_string: Secondary connection string of the - created namespace authorization rule. - :type secondary_connection_string: str - :param primary_key: A base64-encoded 256-bit primary key for signing and - validating the SAS token. - :type primary_key: str - :param secondary_key: A base64-encoded 256-bit secondary key for signing - and validating the SAS token. - :type secondary_key: str - :param key_name: A string that describes the authorization rule. - :type key_name: str - """ - - _attribute_map = { - 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, - 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, - 'primary_key': {'key': 'primaryKey', 'type': 'str'}, - 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, primary_connection_string: str=None, secondary_connection_string: str=None, primary_key: str=None, secondary_key: str=None, key_name: str=None, **kwargs) -> None: - super(AccessKeys, self).__init__(**kwargs) - self.primary_connection_string = primary_connection_string - self.secondary_connection_string = secondary_connection_string - self.primary_key = primary_key - self.secondary_key = secondary_key - self.key_name = key_name diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule.py deleted file mode 100644 index dc4b5c3e36b1..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class AuthorizationRule(Resource): - """Description of a namespace authorization rule. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param rights: Required. The rights associated with the rule. - :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'rights': {'required': True, 'unique': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'rights': {'key': 'properties.rights', 'type': '[AccessRights]'}, - } - - def __init__(self, **kwargs): - super(AuthorizationRule, self).__init__(**kwargs) - self.rights = kwargs.get('rights', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule_paged.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule_paged.py deleted file mode 100644 index f452ea050ef4..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class AuthorizationRulePaged(Paged): - """ - A paging container for iterating over a list of :class:`AuthorizationRule ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AuthorizationRule]'} - } - - def __init__(self, *args, **kwargs): - - super(AuthorizationRulePaged, self).__init__(*args, **kwargs) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule_py3.py deleted file mode 100644 index ffde450c2fe1..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class AuthorizationRule(Resource): - """Description of a namespace authorization rule. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param rights: Required. The rights associated with the rule. - :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'rights': {'required': True, 'unique': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'rights': {'key': 'properties.rights', 'type': '[AccessRights]'}, - } - - def __init__(self, *, rights, **kwargs) -> None: - super(AuthorizationRule, self).__init__(**kwargs) - self.rights = rights diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability.py deleted file mode 100644 index 6108fa093d3e..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CheckNameAvailability(Model): - """Description of the check name availability request properties. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The namespace name to check for availability. The - namespace name can contain only letters, numbers, and hyphens. The - namespace must start with a letter, and it must end with a letter or - number. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailability, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability_py3.py deleted file mode 100644 index a726776ca9a7..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CheckNameAvailability(Model): - """Description of the check name availability request properties. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The namespace name to check for availability. The - namespace name can contain only letters, numbers, and hyphens. The - namespace must start with a letter, and it must end with a letter or - number. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, **kwargs) -> None: - super(CheckNameAvailability, self).__init__(**kwargs) - self.name = name diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability_result.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability_result.py deleted file mode 100644 index f02fb72b499b..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability_result.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CheckNameAvailabilityResult(Model): - """Description of the check name availability request properties. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar message: The detailed info regarding the reason associated with the - namespace. - :vartype message: str - :param name_available: Value indicating namespace is available. Returns - true if the namespace is available; otherwise, false. - :type name_available: bool - :param reason: The reason for unavailability of a namespace. Possible - values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', - 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription' - :type reason: str or ~azure.mgmt.relay.models.UnavailableReason - """ - - _validation = { - 'message': {'readonly': True}, - } - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'UnavailableReason'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.message = None - self.name_available = kwargs.get('name_available', None) - self.reason = kwargs.get('reason', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability_result_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability_result_py3.py deleted file mode 100644 index f623f0561aaf..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CheckNameAvailabilityResult(Model): - """Description of the check name availability request properties. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar message: The detailed info regarding the reason associated with the - namespace. - :vartype message: str - :param name_available: Value indicating namespace is available. Returns - true if the namespace is available; otherwise, false. - :type name_available: bool - :param reason: The reason for unavailability of a namespace. Possible - values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', - 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription' - :type reason: str or ~azure.mgmt.relay.models.UnavailableReason - """ - - _validation = { - 'message': {'readonly': True}, - } - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'UnavailableReason'}, - } - - def __init__(self, *, name_available: bool=None, reason=None, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.message = None - self.name_available = name_available - self.reason = reason diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/error_response.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/error_response.py deleted file mode 100644 index 46c59e925e8c..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/error_response.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error reponse indicates Relay service is not able to process the incoming - request. The reason is provided in the error message. - - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/error_response_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/error_response_py3.py deleted file mode 100644 index 5056bbd93993..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/error_response_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error reponse indicates Relay service is not able to process the incoming - request. The reason is provided in the error message. - - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.code = code - self.message = message - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/hybrid_connection.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/hybrid_connection.py deleted file mode 100644 index b2dabd7466f1..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/hybrid_connection.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class HybridConnection(Resource): - """Description of hybrid connection resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar created_at: The time the hybrid connection was created. - :vartype created_at: datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: datetime - :ivar listener_count: The number of listeners for this hybrid connection. - Note that min : 1 and max:25 are supported. - :vartype listener_count: int - :param requires_client_authorization: Returns true if client authorization - is needed for this hybrid connection; otherwise, false. - :type requires_client_authorization: bool - :param user_metadata: The usermetadata is a placeholder to store - user-defined string data for the hybrid connection endpoint. For example, - it can be used to store descriptive data, such as a list of teams and - their contact information. Also, user-defined configuration settings can - be stored. - :type user_metadata: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'created_at': {'readonly': True}, - 'updated_at': {'readonly': True}, - 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, - 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, - 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, - 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, - 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(HybridConnection, self).__init__(**kwargs) - self.created_at = None - self.updated_at = None - self.listener_count = None - self.requires_client_authorization = kwargs.get('requires_client_authorization', None) - self.user_metadata = kwargs.get('user_metadata', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/hybrid_connection_paged.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/hybrid_connection_paged.py deleted file mode 100644 index c2cdcac1cc26..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/hybrid_connection_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class HybridConnectionPaged(Paged): - """ - A paging container for iterating over a list of :class:`HybridConnection ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[HybridConnection]'} - } - - def __init__(self, *args, **kwargs): - - super(HybridConnectionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/hybrid_connection_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/hybrid_connection_py3.py deleted file mode 100644 index 04b47ad22923..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/hybrid_connection_py3.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class HybridConnection(Resource): - """Description of hybrid connection resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar created_at: The time the hybrid connection was created. - :vartype created_at: datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: datetime - :ivar listener_count: The number of listeners for this hybrid connection. - Note that min : 1 and max:25 are supported. - :vartype listener_count: int - :param requires_client_authorization: Returns true if client authorization - is needed for this hybrid connection; otherwise, false. - :type requires_client_authorization: bool - :param user_metadata: The usermetadata is a placeholder to store - user-defined string data for the hybrid connection endpoint. For example, - it can be used to store descriptive data, such as a list of teams and - their contact information. Also, user-defined configuration settings can - be stored. - :type user_metadata: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'created_at': {'readonly': True}, - 'updated_at': {'readonly': True}, - 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, - 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, - 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, - 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, - 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, - } - - def __init__(self, *, requires_client_authorization: bool=None, user_metadata: str=None, **kwargs) -> None: - super(HybridConnection, self).__init__(**kwargs) - self.created_at = None - self.updated_at = None - self.listener_count = None - self.requires_client_authorization = requires_client_authorization - self.user_metadata = user_metadata diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation.py deleted file mode 100644 index 5bff3c000c80..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """A Relay REST API operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation} - :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.relay.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = kwargs.get('display', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_display.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_display.py deleted file mode 100644 index a8eaeee8622d..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_display.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: Service provider: Relay. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Invoice, - etc. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_display_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_display_py3.py deleted file mode 100644 index ee850026500d..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_display_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: Service provider: Relay. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Invoice, - etc. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_paged.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_paged.py deleted file mode 100644 index 4cbe3ebcfde0..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_py3.py deleted file mode 100644 index 1c446d85e932..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/operation_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """A Relay REST API operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation} - :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.relay.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, *, display=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = display diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/regenerate_access_key_parameters.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/regenerate_access_key_parameters.py deleted file mode 100644 index a06da742b278..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/regenerate_access_key_parameters.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class RegenerateAccessKeyParameters(Model): - """Parameters supplied to the regenerate authorization rule operation, - specifies which key neeeds to be reset. - - All required parameters must be populated in order to send to Azure. - - :param key_type: Required. The access key to regenerate. Possible values - include: 'PrimaryKey', 'SecondaryKey' - :type key_type: str or ~azure.mgmt.relay.models.KeyType - :param key: Optional. If the key value is provided, this is set to key - type, or autogenerated key value set for key type. - :type key: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'KeyType'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RegenerateAccessKeyParameters, self).__init__(**kwargs) - self.key_type = kwargs.get('key_type', None) - self.key = kwargs.get('key', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/regenerate_access_key_parameters_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/regenerate_access_key_parameters_py3.py deleted file mode 100644 index 0e41dadb27b7..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/regenerate_access_key_parameters_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class RegenerateAccessKeyParameters(Model): - """Parameters supplied to the regenerate authorization rule operation, - specifies which key neeeds to be reset. - - All required parameters must be populated in order to send to Azure. - - :param key_type: Required. The access key to regenerate. Possible values - include: 'PrimaryKey', 'SecondaryKey' - :type key_type: str or ~azure.mgmt.relay.models.KeyType - :param key: Optional. If the key value is provided, this is set to key - type, or autogenerated key value set for key type. - :type key: str - """ - - _validation = { - 'key_type': {'required': True}, - } - - _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'KeyType'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__(self, *, key_type, key: str=None, **kwargs) -> None: - super(RegenerateAccessKeyParameters, self).__init__(**kwargs) - self.key_type = key_type - self.key = key diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_management_client_enums.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_management_client_enums.py deleted file mode 100644 index d4198f6752f0..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_management_client_enums.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum - - -class Relaytype(str, Enum): - - net_tcp = "NetTcp" - http = "Http" - - -class SkuTier(str, Enum): - - standard = "Standard" - - -class ProvisioningStateEnum(str, Enum): - - created = "Created" - succeeded = "Succeeded" - deleted = "Deleted" - failed = "Failed" - updating = "Updating" - unknown = "Unknown" - - -class AccessRights(str, Enum): - - manage = "Manage" - send = "Send" - listen = "Listen" - - -class KeyType(str, Enum): - - primary_key = "PrimaryKey" - secondary_key = "SecondaryKey" - - -class UnavailableReason(str, Enum): - - none = "None" - invalid_name = "InvalidName" - subscription_is_disabled = "SubscriptionIsDisabled" - name_in_use = "NameInUse" - name_in_lockdown = "NameInLockdown" - too_many_namespace_in_current_subscription = "TooManyNamespaceInCurrentSubscription" diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_namespace.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_namespace.py deleted file mode 100644 index 371a68b21ee9..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_namespace.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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 .tracked_resource import TrackedResource - - -class RelayNamespace(TrackedResource): - """Description of a namespace resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param sku: SKU of the namespace. - :type sku: ~azure.mgmt.relay.models.Sku - :ivar provisioning_state: Possible values include: 'Created', 'Succeeded', - 'Deleted', 'Failed', 'Updating', 'Unknown' - :vartype provisioning_state: str or - ~azure.mgmt.relay.models.ProvisioningStateEnum - :ivar created_at: The time the namespace was created. - :vartype created_at: datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: datetime - :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus - operations. - :vartype service_bus_endpoint: str - :ivar metric_id: Identifier for Azure Insights metrics. - :vartype metric_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_at': {'readonly': True}, - 'updated_at': {'readonly': True}, - 'service_bus_endpoint': {'readonly': True}, - 'metric_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningStateEnum'}, - 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, - 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, - 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, - 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RelayNamespace, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.provisioning_state = None - self.created_at = None - self.updated_at = None - self.service_bus_endpoint = None - self.metric_id = None diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_namespace_paged.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_namespace_paged.py deleted file mode 100644 index cc1223c5784c..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_namespace_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class RelayNamespacePaged(Paged): - """ - A paging container for iterating over a list of :class:`RelayNamespace ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RelayNamespace]'} - } - - def __init__(self, *args, **kwargs): - - super(RelayNamespacePaged, self).__init__(*args, **kwargs) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_namespace_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_namespace_py3.py deleted file mode 100644 index ea72eacfd1c2..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_namespace_py3.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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 .tracked_resource_py3 import TrackedResource - - -class RelayNamespace(TrackedResource): - """Description of a namespace resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param sku: SKU of the namespace. - :type sku: ~azure.mgmt.relay.models.Sku - :ivar provisioning_state: Possible values include: 'Created', 'Succeeded', - 'Deleted', 'Failed', 'Updating', 'Unknown' - :vartype provisioning_state: str or - ~azure.mgmt.relay.models.ProvisioningStateEnum - :ivar created_at: The time the namespace was created. - :vartype created_at: datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: datetime - :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus - operations. - :vartype service_bus_endpoint: str - :ivar metric_id: Identifier for Azure Insights metrics. - :vartype metric_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'created_at': {'readonly': True}, - 'updated_at': {'readonly': True}, - 'service_bus_endpoint': {'readonly': True}, - 'metric_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningStateEnum'}, - 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, - 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, - 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, - 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, sku=None, **kwargs) -> None: - super(RelayNamespace, self).__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.provisioning_state = None - self.created_at = None - self.updated_at = None - self.service_bus_endpoint = None - self.metric_id = None diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_update_parameters.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_update_parameters.py deleted file mode 100644 index b2276035c62c..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_update_parameters.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_namespace_patch import ResourceNamespacePatch - - -class RelayUpdateParameters(ResourceNamespacePatch): - """Description of a namespace resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param sku: SKU of the namespace. - :type sku: ~azure.mgmt.relay.models.Sku - :ivar provisioning_state: Possible values include: 'Created', 'Succeeded', - 'Deleted', 'Failed', 'Updating', 'Unknown' - :vartype provisioning_state: str or - ~azure.mgmt.relay.models.ProvisioningStateEnum - :ivar created_at: The time the namespace was created. - :vartype created_at: datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: datetime - :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus - operations. - :vartype service_bus_endpoint: str - :ivar metric_id: Identifier for Azure Insights metrics. - :vartype metric_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_at': {'readonly': True}, - 'updated_at': {'readonly': True}, - 'service_bus_endpoint': {'readonly': True}, - 'metric_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningStateEnum'}, - 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, - 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, - 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, - 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RelayUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.provisioning_state = None - self.created_at = None - self.updated_at = None - self.service_bus_endpoint = None - self.metric_id = None diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_update_parameters_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_update_parameters_py3.py deleted file mode 100644 index 0d18f809a3d7..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/relay_update_parameters_py3.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_namespace_patch_py3 import ResourceNamespacePatch - - -class RelayUpdateParameters(ResourceNamespacePatch): - """Description of a namespace resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param sku: SKU of the namespace. - :type sku: ~azure.mgmt.relay.models.Sku - :ivar provisioning_state: Possible values include: 'Created', 'Succeeded', - 'Deleted', 'Failed', 'Updating', 'Unknown' - :vartype provisioning_state: str or - ~azure.mgmt.relay.models.ProvisioningStateEnum - :ivar created_at: The time the namespace was created. - :vartype created_at: datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: datetime - :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus - operations. - :vartype service_bus_endpoint: str - :ivar metric_id: Identifier for Azure Insights metrics. - :vartype metric_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_at': {'readonly': True}, - 'updated_at': {'readonly': True}, - 'service_bus_endpoint': {'readonly': True}, - 'metric_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningStateEnum'}, - 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, - 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, - 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, - 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, - } - - def __init__(self, *, tags=None, sku=None, **kwargs) -> None: - super(RelayUpdateParameters, self).__init__(tags=tags, **kwargs) - self.sku = sku - self.provisioning_state = None - self.created_at = None - self.updated_at = None - self.service_bus_endpoint = None - self.metric_id = None diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource.py deleted file mode 100644 index b1ef73099bc6..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """The resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :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 diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource_namespace_patch.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource_namespace_patch.py deleted file mode 100644 index f4991ad6d313..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource_namespace_patch.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ResourceNamespacePatch(Resource): - """Definition of resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(ResourceNamespacePatch, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource_namespace_patch_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource_namespace_patch_py3.py deleted file mode 100644 index 3cee2173bc9d..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource_namespace_patch_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class ResourceNamespacePatch(Resource): - """Definition of resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(ResourceNamespacePatch, self).__init__(**kwargs) - self.tags = tags diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource_py3.py deleted file mode 100644 index 1a0890e76b74..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/resource_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """The resource definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :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) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/sku.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/sku.py deleted file mode 100644 index 9162fd1c0970..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/sku.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Sku(Model): - """SKU of the namespace. - - 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 name: Required. Name of this SKU. Default value: "Standard" . - :vartype name: str - :param tier: The tier of this SKU. Possible values include: 'Standard' - :type tier: str or ~azure.mgmt.relay.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - } - - name = "Standard" - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.tier = kwargs.get('tier', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/sku_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/sku_py3.py deleted file mode 100644 index c81d3789b177..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/sku_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Sku(Model): - """SKU of the namespace. - - 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 name: Required. Name of this SKU. Default value: "Standard" . - :vartype name: str - :param tier: The tier of this SKU. Possible values include: 'Standard' - :type tier: str or ~azure.mgmt.relay.models.SkuTier - """ - - _validation = { - 'name': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - } - - name = "Standard" - - def __init__(self, *, tier=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.tier = tier diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/tracked_resource.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/tracked_resource.py deleted file mode 100644 index 6ad63c681ff3..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/tracked_resource.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class TrackedResource(Resource): - """Definition of resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/tracked_resource_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/tracked_resource_py3.py deleted file mode 100644 index 0f570808a6fa..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/tracked_resource_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class TrackedResource(Resource): - """Definition of resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.location = location - self.tags = tags diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/wcf_relay.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/wcf_relay.py deleted file mode 100644 index f3d28a56e8ce..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/wcf_relay.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class WcfRelay(Resource): - """Description of the WCF relay resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar is_dynamic: Returns true if the relay is dynamic; otherwise, false. - :vartype is_dynamic: bool - :ivar created_at: The time the WCF relay was created. - :vartype created_at: datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: datetime - :ivar listener_count: The number of listeners for this relay. Note that - min :1 and max:25 are supported. - :vartype listener_count: int - :param relay_type: WCF relay type. Possible values include: 'NetTcp', - 'Http' - :type relay_type: str or ~azure.mgmt.relay.models.Relaytype - :param requires_client_authorization: Returns true if client authorization - is needed for this relay; otherwise, false. - :type requires_client_authorization: bool - :param requires_transport_security: Returns true if transport security is - needed for this relay; otherwise, false. - :type requires_transport_security: bool - :param user_metadata: The usermetadata is a placeholder to store - user-defined string data for the WCF Relay endpoint. For example, it can - be used to store descriptive data, such as list of teams and their contact - information. Also, user-defined configuration settings can be stored. - :type user_metadata: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'is_dynamic': {'readonly': True}, - 'created_at': {'readonly': True}, - 'updated_at': {'readonly': True}, - 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, - 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, - 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, - 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, - 'relay_type': {'key': 'properties.relayType', 'type': 'Relaytype'}, - 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, - 'requires_transport_security': {'key': 'properties.requiresTransportSecurity', 'type': 'bool'}, - 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(WcfRelay, self).__init__(**kwargs) - self.is_dynamic = None - self.created_at = None - self.updated_at = None - self.listener_count = None - self.relay_type = kwargs.get('relay_type', None) - self.requires_client_authorization = kwargs.get('requires_client_authorization', None) - self.requires_transport_security = kwargs.get('requires_transport_security', None) - self.user_metadata = kwargs.get('user_metadata', None) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/wcf_relay_paged.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/wcf_relay_paged.py deleted file mode 100644 index 6235b75858ed..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/wcf_relay_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class WcfRelayPaged(Paged): - """ - A paging container for iterating over a list of :class:`WcfRelay ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[WcfRelay]'} - } - - def __init__(self, *args, **kwargs): - - super(WcfRelayPaged, self).__init__(*args, **kwargs) diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/wcf_relay_py3.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/wcf_relay_py3.py deleted file mode 100644 index 512335165cfd..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/models/wcf_relay_py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class WcfRelay(Resource): - """Description of the WCF relay resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar is_dynamic: Returns true if the relay is dynamic; otherwise, false. - :vartype is_dynamic: bool - :ivar created_at: The time the WCF relay was created. - :vartype created_at: datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: datetime - :ivar listener_count: The number of listeners for this relay. Note that - min :1 and max:25 are supported. - :vartype listener_count: int - :param relay_type: WCF relay type. Possible values include: 'NetTcp', - 'Http' - :type relay_type: str or ~azure.mgmt.relay.models.Relaytype - :param requires_client_authorization: Returns true if client authorization - is needed for this relay; otherwise, false. - :type requires_client_authorization: bool - :param requires_transport_security: Returns true if transport security is - needed for this relay; otherwise, false. - :type requires_transport_security: bool - :param user_metadata: The usermetadata is a placeholder to store - user-defined string data for the WCF Relay endpoint. For example, it can - be used to store descriptive data, such as list of teams and their contact - information. Also, user-defined configuration settings can be stored. - :type user_metadata: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'is_dynamic': {'readonly': True}, - 'created_at': {'readonly': True}, - 'updated_at': {'readonly': True}, - 'listener_count': {'readonly': True, 'maximum': 25, 'minimum': 0}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, - 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, - 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, - 'listener_count': {'key': 'properties.listenerCount', 'type': 'int'}, - 'relay_type': {'key': 'properties.relayType', 'type': 'Relaytype'}, - 'requires_client_authorization': {'key': 'properties.requiresClientAuthorization', 'type': 'bool'}, - 'requires_transport_security': {'key': 'properties.requiresTransportSecurity', 'type': 'bool'}, - 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, - } - - def __init__(self, *, relay_type=None, requires_client_authorization: bool=None, requires_transport_security: bool=None, user_metadata: str=None, **kwargs) -> None: - super(WcfRelay, self).__init__(**kwargs) - self.is_dynamic = None - self.created_at = None - self.updated_at = None - self.listener_count = None - self.relay_type = relay_type - self.requires_client_authorization = requires_client_authorization - self.requires_transport_security = requires_transport_security - self.user_metadata = user_metadata diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/__init__.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/__init__.py index 20f9ef1c9a59..772eceb28d8f 100644 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/__init__.py +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/__init__.py @@ -1,18 +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. -# +# 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. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .namespaces_operations import NamespacesOperations -from .hybrid_connections_operations import HybridConnectionsOperations -from .wcf_relays_operations import WCFRelaysOperations +from ._operations import Operations +from ._namespaces_operations import NamespacesOperations +from ._hybrid_connections_operations import HybridConnectionsOperations +from ._wcf_relays_operations import WCFRelaysOperations __all__ = [ 'Operations', diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_hybrid_connections_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_hybrid_connections_operations.py new file mode 100644 index 000000000000..5f26739fa686 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_hybrid_connections_operations.py @@ -0,0 +1,752 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class HybridConnectionsOperations(object): + """HybridConnectionsOperations 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.relay.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_namespace( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.HybridConnectionListResult"] + """Lists the hybrid connection within the namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.relay.models.HybridConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_namespace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HybridConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + namespace_name, # type: str + hybrid_connection_name, # type: str + parameters, # type: "models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "models.HybridConnection" + """Creates or updates a service hybrid connection. This operation is idempotent. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param parameters: Parameters supplied to create a hybrid connection. + :type parameters: ~azure.mgmt.relay.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + namespace_name, # type: str + hybrid_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + hybrid_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.HybridConnection" + """Returns the description for the specified hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name, # type: str + namespace_name, # type: str + hybrid_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AuthorizationRuleListResult"] + """Authorization rules for a hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.relay.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules'} # type: ignore + + def create_or_update_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + hybrid_connection_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "models.AuthorizationRule" + **kwargs # type: Any + ): + # type: (...) -> "models.AuthorizationRule" + """Creates or updates an authorization rule for a hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The authorization rule parameters. + :type parameters: ~azure.mgmt.relay.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def delete_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + hybrid_connection_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hybrid connection authorization rule. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def get_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + hybrid_connection_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AuthorizationRule" + """Hybrid connection authorization rule for a hybrid connection by name. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + hybrid_connection_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AccessKeys" + """Primary and secondary connection strings to the hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + def regenerate_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + hybrid_connection_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "models.RegenerateAccessKeyParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.AccessKeys" + """Regenerates the primary or secondary connection strings to the hybrid connection. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param hybrid_connection_name: The hybrid connection name. + :type hybrid_connection_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters supplied to regenerate authorization rule. + :type parameters: ~azure.mgmt.relay.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_namespaces_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_namespaces_operations.py new file mode 100644 index 000000000000..86eb2cfa8aa1 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_namespaces_operations.py @@ -0,0 +1,1021 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NamespacesOperations(object): + """NamespacesOperations 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.relay.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_name_availability( + self, + parameters, # type: "models.CheckNameAvailability" + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameAvailabilityResult" + """Check the specified namespace name availability. + + :param parameters: Parameters to check availability of the specified namespace name. + :type parameters: ~azure.mgmt.relay.models.CheckNameAvailability + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckNameAvailability') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.RelayNamespaceListResult"] + """Lists all the available namespaces within the subscription regardless of the resourceGroups. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RelayNamespaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.relay.models.RelayNamespaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RelayNamespaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.RelayNamespaceListResult"] + """Lists all the available namespaces within the ResourceGroup. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RelayNamespaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.relay.models.RelayNamespaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RelayNamespaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + namespace_name, # type: str + parameters, # type: "models.RelayNamespace" + **kwargs # type: Any + ): + # type: (...) -> "models.RelayNamespace" + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespace"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RelayNamespace') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + namespace_name, # type: str + parameters, # type: "models.RelayNamespace" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.RelayNamespace"] + """Create Azure Relay namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param parameters: Parameters supplied to create a namespace resource. + :type parameters: ~azure.mgmt.relay.models.RelayNamespace + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RelayNamespace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.relay.models.RelayNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespace"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing namespace. This operation also removes all associated resources under the + namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RelayNamespace" + """Returns the description for the specified namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayNamespace, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.RelayNamespace + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespace"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + namespace_name, # type: str + parameters, # type: "models.RelayUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.RelayNamespace" + """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. + This operation is idempotent. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param parameters: Parameters for updating a namespace resource. + :type parameters: ~azure.mgmt.relay.models.RelayUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayNamespace, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.RelayNamespace + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RelayNamespace"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RelayUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('RelayNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AuthorizationRuleListResult"] + """Authorization rules for a namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.relay.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules'} # type: ignore + + def create_or_update_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "models.AuthorizationRule" + **kwargs # type: Any + ): + # type: (...) -> "models.AuthorizationRule" + """Creates or updates an authorization rule for a namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The authorization rule parameters. + :type parameters: ~azure.mgmt.relay.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def delete_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a namespace authorization rule. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def get_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AuthorizationRule" + """Authorization rule for a namespace by name. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AccessKeys" + """Primary and secondary connection strings to the namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + def regenerate_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "models.RegenerateAccessKeyParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.AccessKeys" + """Regenerates the primary or secondary connection strings to the namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters supplied to regenerate authorization rule. + :type parameters: ~azure.mgmt.relay.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_operations.py new file mode 100644 index 000000000000..c532a17157d4 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.relay.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] + """Lists all available Relay REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.relay.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Relay/operations'} # type: ignore diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_wcf_relays_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_wcf_relays_operations.py new file mode 100644 index 000000000000..34a44c0d15a9 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/_wcf_relays_operations.py @@ -0,0 +1,753 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WCFRelaysOperations(object): + """WCFRelaysOperations 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.relay.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_namespace( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.WcfRelaysListResult"] + """Lists the WCF relays within the namespace. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WcfRelaysListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.relay.models.WcfRelaysListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WcfRelaysListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_namespace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WcfRelaysListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + namespace_name, # type: str + relay_name, # type: str + parameters, # type: "models.WcfRelay" + **kwargs # type: Any + ): + # type: (...) -> "models.WcfRelay" + """Creates or updates a WCF relay. This operation is idempotent. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param parameters: Parameters supplied to create a WCF relay. + :type parameters: ~azure.mgmt.relay.models.WcfRelay + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WcfRelay, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.WcfRelay + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WcfRelay"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'WcfRelay') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WcfRelay', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["models.WcfRelay"] + """Returns the description for the specified WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WcfRelay, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.WcfRelay or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.WcfRelay"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WcfRelay', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AuthorizationRuleListResult"] + """Authorization rules for a WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.relay.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules'} # type: ignore + + def create_or_update_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + relay_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "models.AuthorizationRule" + **kwargs # type: Any + ): + # type: (...) -> "models.AuthorizationRule" + """Creates or updates an authorization rule for a WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The authorization rule parameters. + :type parameters: ~azure.mgmt.relay.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def delete_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + relay_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a WCF relay authorization rule. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_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', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def get_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + relay_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AuthorizationRule" + """Get authorizationRule for a WCF relay by name. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + relay_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AccessKeys" + """Primary and secondary connection strings to the WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + def regenerate_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + relay_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "models.RegenerateAccessKeyParameters" + **kwargs # type: Any + ): + # type: (...) -> "models.AccessKeys" + """Regenerates the primary or secondary connection strings to the WCF relay. + + :param resource_group_name: Name of the Resource group within the Azure subscription. + :type resource_group_name: str + :param namespace_name: The namespace name. + :type namespace_name: str + :param relay_name: The relay name. + :type relay_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters supplied to regenerate authorization rule. + :type parameters: ~azure.mgmt.relay.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.relay.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/hybrid_connections_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/hybrid_connections_operations.py deleted file mode 100644 index e1517baa7663..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/hybrid_connections_operations.py +++ /dev/null @@ -1,734 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class HybridConnectionsOperations(object): - """HybridConnectionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2017-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-01" - - self.config = config - - def list_by_namespace( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Lists the hybrid connection within the namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of HybridConnection - :rtype: - ~azure.mgmt.relay.models.HybridConnectionPaged[~azure.mgmt.relay.models.HybridConnection] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_namespace.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.HybridConnectionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.HybridConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections'} - - def create_or_update( - self, resource_group_name, namespace_name, hybrid_connection_name, requires_client_authorization=None, user_metadata=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates a service hybrid connection. This operation is - idempotent. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param hybrid_connection_name: The hybrid connection name. - :type hybrid_connection_name: str - :param requires_client_authorization: Returns true if client - authorization is needed for this hybrid connection; otherwise, false. - :type requires_client_authorization: bool - :param user_metadata: The usermetadata is a placeholder to store - user-defined string data for the hybrid connection endpoint. For - example, it can be used to store descriptive data, such as a list of - teams and their contact information. Also, user-defined configuration - settings can be stored. - :type user_metadata: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.HybridConnection or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.HybridConnection(requires_client_authorization=requires_client_authorization, user_metadata=user_metadata) - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'HybridConnection') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}'} - - def delete( - self, resource_group_name, namespace_name, hybrid_connection_name, custom_headers=None, raw=False, **operation_config): - """Deletes a hybrid connection. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param hybrid_connection_name: The hybrid connection name. - :type hybrid_connection_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}'} - - def get( - self, resource_group_name, namespace_name, hybrid_connection_name, custom_headers=None, raw=False, **operation_config): - """Returns the description for the specified hybrid connection. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param hybrid_connection_name: The hybrid connection name. - :type hybrid_connection_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: HybridConnection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.HybridConnection or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('HybridConnection', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}'} - - def list_authorization_rules( - self, resource_group_name, namespace_name, hybrid_connection_name, custom_headers=None, raw=False, **operation_config): - """Authorization rules for a hybrid connection. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param hybrid_connection_name: The hybrid connection name. - :type hybrid_connection_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AuthorizationRule - :rtype: - ~azure.mgmt.relay.models.AuthorizationRulePaged[~azure.mgmt.relay.models.AuthorizationRule] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_authorization_rules.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules'} - - def create_or_update_authorization_rule( - self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config): - """Creates or updates an authorization rule for a hybrid connection. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param hybrid_connection_name: The hybrid connection name. - :type hybrid_connection_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param rights: The rights associated with the rule. - :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AuthorizationRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.AuthorizationRule(rights=rights) - - # Construct URL - url = self.create_or_update_authorization_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AuthorizationRule') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AuthorizationRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'} - - def delete_authorization_rule( - self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a hybrid connection authorization rule. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param hybrid_connection_name: The hybrid connection name. - :type hybrid_connection_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_authorization_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'} - - def get_authorization_rule( - self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Hybrid connection authorization rule for a hybrid connection by name. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param hybrid_connection_name: The hybrid connection name. - :type hybrid_connection_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AuthorizationRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_authorization_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AuthorizationRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'} - - def list_keys( - self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Primary and secondary connection strings to the hybrid connection. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param hybrid_connection_name: The hybrid connection name. - :type hybrid_connection_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/listKeys'} - - def regenerate_keys( - self, resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): - """Regenerates the primary or secondary connection strings to the hybrid - connection. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param hybrid_connection_name: The hybrid connection name. - :type hybrid_connection_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param key_type: The access key to regenerate. Possible values - include: 'PrimaryKey', 'SecondaryKey' - :type key_type: str or ~azure.mgmt.relay.models.KeyType - :param key: Optional. If the key value is provided, this is set to key - type, or autogenerated key value set for key type. - :type key: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) - - # Construct URL - url = self.regenerate_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'hybridConnectionName': self._serialize.url("hybrid_connection_name", hybrid_connection_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/namespaces_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/namespaces_operations.py deleted file mode 100644 index 2c824ca92d28..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/namespaces_operations.py +++ /dev/null @@ -1,962 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class NamespacesOperations(object): - """NamespacesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2017-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-01" - - self.config = config - - def check_name_availability_method( - self, name, custom_headers=None, raw=False, **operation_config): - """Check the specified namespace name availability. - - :param name: The namespace name to check for availability. The - namespace name can contain only letters, numbers, and hyphens. The - namespace must start with a letter, and it must end with a letter or - number. - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.CheckNameAvailability(name=name) - - # Construct URL - url = self.check_name_availability_method.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'CheckNameAvailability') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the available namespaces within the subscription regardless - of the resourceGroups. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of RelayNamespace - :rtype: - ~azure.mgmt.relay.models.RelayNamespacePaged[~azure.mgmt.relay.models.RelayNamespace] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.RelayNamespacePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.RelayNamespacePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the available namespaces within the ResourceGroup. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of RelayNamespace - :rtype: - ~azure.mgmt.relay.models.RelayNamespacePaged[~azure.mgmt.relay.models.RelayNamespace] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.RelayNamespacePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.RelayNamespacePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces'} - - - def _create_or_update_initial( - self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'RelayNamespace') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('RelayNamespace', response) - if response.status_code == 201: - deserialized = self._deserialize('RelayNamespace', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Create Azure Relay namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param parameters: Parameters supplied to create a namespace resource. - :type parameters: ~azure.mgmt.relay.models.RelayNamespace - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns RelayNamespace or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.relay.models.RelayNamespace] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.relay.models.RelayNamespace]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('RelayNamespace', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} - - - def _delete_initial( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an existing namespace. This operation also removes all - associated resources under the namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} - - def get( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Returns the description for the specified namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: RelayNamespace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.RelayNamespace or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('RelayNamespace', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} - - def update( - self, resource_group_name, namespace_name, tags=None, sku=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates a namespace. Once created, this namespace's resource - manifest is immutable. This operation is idempotent. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param sku: SKU of the namespace. - :type sku: ~azure.mgmt.relay.models.Sku - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: RelayNamespace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.RelayNamespace or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.RelayUpdateParameters(tags=tags, sku=sku) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'RelayUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('RelayNamespace', response) - if response.status_code == 201: - deserialized = self._deserialize('RelayNamespace', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}'} - - def list_authorization_rules( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Authorization rules for a namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AuthorizationRule - :rtype: - ~azure.mgmt.relay.models.AuthorizationRulePaged[~azure.mgmt.relay.models.AuthorizationRule] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_authorization_rules.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules'} - - def create_or_update_authorization_rule( - self, resource_group_name, namespace_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config): - """Creates or updates an authorization rule for a namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param rights: The rights associated with the rule. - :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AuthorizationRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.AuthorizationRule(rights=rights) - - # Construct URL - url = self.create_or_update_authorization_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AuthorizationRule') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AuthorizationRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} - - def delete_authorization_rule( - self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a namespace authorization rule. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_authorization_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} - - def get_authorization_rule( - self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Authorization rule for a namespace by name. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AuthorizationRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_authorization_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AuthorizationRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} - - def list_keys( - self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Primary and secondary connection strings to the namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys'} - - def regenerate_keys( - self, resource_group_name, namespace_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): - """Regenerates the primary or secondary connection strings to the - namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param key_type: The access key to regenerate. Possible values - include: 'PrimaryKey', 'SecondaryKey' - :type key_type: str or ~azure.mgmt.relay.models.KeyType - :param key: Optional. If the key value is provided, this is set to key - type, or autogenerated key value set for key type. - :type key: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) - - # Construct URL - url = self.regenerate_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/operations.py deleted file mode 100644 index 545badf3c107..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/operations.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class Operations(object): - """Operations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2017-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all available Relay REST API operations. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Operation - :rtype: - ~azure.mgmt.relay.models.OperationPaged[~azure.mgmt.relay.models.Operation] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Relay/operations'} diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/wcf_relays_operations.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/wcf_relays_operations.py deleted file mode 100644 index 0190da6dfafa..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/operations/wcf_relays_operations.py +++ /dev/null @@ -1,726 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class WCFRelaysOperations(object): - """WCFRelaysOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2017-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-01" - - self.config = config - - def list_by_namespace( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Lists the WCF relays within the namespace. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of WcfRelay - :rtype: - ~azure.mgmt.relay.models.WcfRelayPaged[~azure.mgmt.relay.models.WcfRelay] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_namespace.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.WcfRelayPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.WcfRelayPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays'} - - def create_or_update( - self, resource_group_name, namespace_name, relay_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates a WCF relay. This operation is idempotent. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param relay_name: The relay name. - :type relay_name: str - :param parameters: Parameters supplied to create a WCF relay. - :type parameters: ~azure.mgmt.relay.models.WcfRelay - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: WcfRelay or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.WcfRelay or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'WcfRelay') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('WcfRelay', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}'} - - def delete( - self, resource_group_name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): - """Deletes a WCF relay. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param relay_name: The relay name. - :type relay_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}'} - - def get( - self, resource_group_name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): - """Returns the description for the specified WCF relay. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param relay_name: The relay name. - :type relay_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: WcfRelay or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.WcfRelay or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('WcfRelay', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}'} - - def list_authorization_rules( - self, resource_group_name, namespace_name, relay_name, custom_headers=None, raw=False, **operation_config): - """Authorization rules for a WCF relay. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param relay_name: The relay name. - :type relay_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AuthorizationRule - :rtype: - ~azure.mgmt.relay.models.AuthorizationRulePaged[~azure.mgmt.relay.models.AuthorizationRule] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_authorization_rules.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.AuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules'} - - def create_or_update_authorization_rule( - self, resource_group_name, namespace_name, relay_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config): - """Creates or updates an authorization rule for a WCF relay. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param relay_name: The relay name. - :type relay_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param rights: The rights associated with the rule. - :type rights: list[str or ~azure.mgmt.relay.models.AccessRights] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AuthorizationRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.AuthorizationRule(rights=rights) - - # Construct URL - url = self.create_or_update_authorization_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AuthorizationRule') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AuthorizationRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'} - - def delete_authorization_rule( - self, resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a WCF relay authorization rule. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param relay_name: The relay name. - :type relay_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_authorization_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'} - - def get_authorization_rule( - self, resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Get authorizationRule for a WCF relay by name. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param relay_name: The relay name. - :type relay_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AuthorizationRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AuthorizationRule or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_authorization_rule.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AuthorizationRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'} - - def list_keys( - self, resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config): - """Primary and secondary connection strings to the WCF relay. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param relay_name: The relay name. - :type relay_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys'} - - def regenerate_keys( - self, resource_group_name, namespace_name, relay_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config): - """Regenerates the primary or secondary connection strings to the WCF - relay. - - :param resource_group_name: Name of the Resource group within the - Azure subscription. - :type resource_group_name: str - :param namespace_name: The namespace name - :type namespace_name: str - :param relay_name: The relay name. - :type relay_name: str - :param authorization_rule_name: The authorization rule name. - :type authorization_rule_name: str - :param key_type: The access key to regenerate. Possible values - include: 'PrimaryKey', 'SecondaryKey' - :type key_type: str or ~azure.mgmt.relay.models.KeyType - :param key: Optional. If the key value is provided, this is set to key - type, or autogenerated key value set for key type. - :type key: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AccessKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.relay.models.AccessKeys or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key) - - # Construct URL - url = self.regenerate_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'relayName': self._serialize.url("relay_name", relay_name, 'str', min_length=1), - 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('AccessKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/py.typed b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/relay_management_client.py b/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/relay_management_client.py deleted file mode 100644 index 64cb7b93baab..000000000000 --- a/sdk/relay/azure-mgmt-relay/azure/mgmt/relay/relay_management_client.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.operations import Operations -from .operations.namespaces_operations import NamespacesOperations -from .operations.hybrid_connections_operations import HybridConnectionsOperations -from .operations.wcf_relays_operations import WCFRelaysOperations -from . import models - - -class RelayManagementClientConfiguration(AzureConfiguration): - """Configuration for RelayManagementClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - the Microsoft Azure subscription. The subscription ID forms part of the - URI for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(RelayManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-relay/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class RelayManagementClient(SDKClient): - """Use these API to manage Azure Relay resources through Azure Resource Manager. - - :ivar config: Configuration for client. - :vartype config: RelayManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.relay.operations.Operations - :ivar namespaces: Namespaces operations - :vartype namespaces: azure.mgmt.relay.operations.NamespacesOperations - :ivar hybrid_connections: HybridConnections operations - :vartype hybrid_connections: azure.mgmt.relay.operations.HybridConnectionsOperations - :ivar wcf_relays: WCFRelays operations - :vartype wcf_relays: azure.mgmt.relay.operations.WCFRelaysOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - the Microsoft Azure subscription. The subscription ID forms part of the - URI for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = RelayManagementClientConfiguration(credentials, subscription_id, base_url) - super(RelayManagementClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-04-01' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.namespaces = NamespacesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.hybrid_connections = HybridConnectionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.wcf_relays = WCFRelaysOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/relay/azure-mgmt-relay/setup.py b/sdk/relay/azure-mgmt-relay/setup.py index 8915961ea400..7029f5db20ab 100644 --- a/sdk/relay/azure-mgmt-relay/setup.py +++ b/sdk/relay/azure-mgmt-relay/setup.py @@ -36,7 +36,7 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -79,8 +79,8 @@ ]), install_requires=[ 'msrest>=0.5.0', - 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0', ], extras_require={ ":python_version<'3.0'": ['azure-mgmt-nspkg'], diff --git a/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_hybridconnection.test_hybridconnetion_curd.yaml b/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_hybridconnection.test_hybridconnetion_curd.yaml index 570fc3411f93..60ba591a4798 100644 --- a/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_hybridconnection.test_hybridconnetion_curd.yaml +++ b/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_hybridconnection.test_hybridconnetion_curd.yaml @@ -1,517 +1,867 @@ interactions: - request: body: '{"location": "westus", "tags": {"tag1": "value1", "tag2": "value2"}, "sku": - {"name": "Standard", "tier": "Standard"}}' - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['117'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + {"name": "Standard", "tier": "standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '117' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection?api-version=2017-04-01 response: - body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection","name":"testingpythontestcasenamespacehybridconnection","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespacehybridconnection","createdAt":"2018-02-02T10:31:31.76Z","updatedAt":"2018-02-02T10:31:31.76Z","serviceBusEndpoint":"https://testingpythontestcasenamespacehybridconnection.servicebus.windows.net:443/","status":"Activating"}}'} - headers: - cache-control: [no-cache] - content-length: ['770'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:31:33 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] - status: {code: 200, message: OK} + body: + string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection","name":"testingpythontestcasenamespacehybridconnection","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespacehybridconnection","createdAt":"2020-11-03T02:03:03.413Z","updatedAt":"2020-11-03T02:20:45.04Z","serviceBusEndpoint":"https://testingpythontestcasenamespacehybridconnection.servicebus.windows.net:443/","status":"Activating"}}' + headers: + cache-control: + - no-cache + content-length: + - '772' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:20:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection?api-version=2017-04-01 response: - body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection","name":"testingpythontestcasenamespacehybridconnection","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespacehybridconnection","createdAt":"2018-02-02T10:31:31.76Z","updatedAt":"2018-02-02T10:31:55.087Z","serviceBusEndpoint":"https://testingpythontestcasenamespacehybridconnection.servicebus.windows.net:443/","status":"Active"}}'} - headers: - cache-control: [no-cache] - content-length: ['769'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:04 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection","name":"testingpythontestcasenamespacehybridconnection","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespacehybridconnection","createdAt":"2020-11-03T02:03:03.413Z","updatedAt":"2020-11-03T02:20:46.8Z","serviceBusEndpoint":"https://testingpythontestcasenamespacehybridconnection.servicebus.windows.net:443/","status":"Active"}}' + headers: + cache-control: + - no-cache + content-length: + - '768' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection?api-version=2017-04-01 response: - body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection","name":"testingpythontestcasenamespacehybridconnection","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespacehybridconnection","createdAt":"2018-02-02T10:31:31.76Z","updatedAt":"2018-02-02T10:31:55.087Z","serviceBusEndpoint":"https://testingpythontestcasenamespacehybridconnection.servicebus.windows.net:443/","status":"Active"}}'} - headers: - cache-control: [no-cache] - content-length: ['769'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:05 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection","name":"testingpythontestcasenamespacehybridconnection","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespacehybridconnection","createdAt":"2020-11-03T02:03:03.413Z","updatedAt":"2020-11-03T02:20:46.8Z","serviceBusEndpoint":"https://testingpythontestcasenamespacehybridconnection.servicebus.windows.net:443/","status":"Active"}}' + headers: + cache-control: + - no-cache + content-length: + - '768' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: '{"properties": {"requiresClientAuthorization": true, "userMetadata": "User data for HybridConnection"}}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['103'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '103' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection","name":"testingpythontestcasehybridconnection","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West - US","properties":{"createdAt":"2018-02-02T10:32:08.2541464Z","updatedAt":"2018-02-02T10:32:08.2541464Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"User - data for HybridConnection"}}'} - headers: - cache-control: [no-cache] - content-length: ['606'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:07 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection","name":"testingpythontestcasehybridconnection","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West + US","properties":{"createdAt":"0001-01-01T00:00:00","updatedAt":"0001-01-01T00:00:00","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"User + data for HybridConnection"}}' + headers: + cache-control: + - no-cache + content-length: + - '588' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection","name":"testingpythontestcasehybridconnection","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West - US","properties":{"createdAt":"2018-02-02T10:32:08.2541464Z","updatedAt":"2018-02-02T10:32:08.2541464Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"User - data for HybridConnection"}}'} - headers: - cache-control: [no-cache] - content-length: ['606'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:08 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection","name":"testingpythontestcasehybridconnection","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West + US","properties":{"createdAt":"2020-11-03T02:18:30.1009414Z","updatedAt":"2020-11-03T02:21:16.7700008Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"User + data for HybridConnection"}}' + headers: + cache-control: + - no-cache + content-length: + - '606' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections?api-version=2017-04-01 response: - body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection","name":"testingpythontestcasehybridconnection","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West - US","properties":{"createdAt":"2018-02-02T10:32:08.2541464Z","updatedAt":"2018-02-02T10:32:08.2541464Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"User - data for HybridConnection"}}]}'} - headers: - cache-control: [no-cache] - content-length: ['618'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:10 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-inline-count: [''] - status: {code: 200, message: OK} + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection","name":"testingpythontestcasehybridconnection","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West + US","properties":{"createdAt":"2020-11-03T02:18:30.1009414Z","updatedAt":"2020-11-03T02:21:16.7700008Z","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"User + data for HybridConnection"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '618' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-inline-count: + - '' + status: + code: 200 + message: OK - request: body: '{"properties": {"userMetadata": "User data for HybridConnection updated"}}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['74'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '74' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection","name":"testingpythontestcasehybridconnection","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection","name":"testingpythontestcasehybridconnection","type":"Microsoft.Relay/Namespaces/HybridConnections","location":"West US","properties":{"createdAt":"0001-01-01T00:00:00","updatedAt":"0001-01-01T00:00:00","listenerCount":0,"requiresClientAuthorization":true,"userMetadata":"User - data for HybridConnection updated"}}'} - headers: - cache-control: [no-cache] - content-length: ['596'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:10 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1195'] - status: {code: 200, message: OK} + data for HybridConnection updated"}}' + headers: + cache-control: + - no-cache + content-length: + - '596' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK - request: body: '{"properties": {"rights": ["Send", "Listen"]}}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['46'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '46' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West - US","properties":{"rights":["Send","Listen"]}}'} - headers: - cache-control: [no-cache] - content-length: ['482'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:11 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1194'] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West + US","properties":{"rights":["Send","Listen"]}}' + headers: + cache-control: + - no-cache + content-length: + - '482' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West - US","properties":{"rights":["Send","Listen"]}}'} - headers: - cache-control: [no-cache] - content-length: ['482'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:12 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West + US","properties":{"rights":["Send","Listen"]}}' + headers: + cache-control: + - no-cache + content-length: + - '482' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: '{"properties": {"rights": ["Send", "Listen", "Manage"]}}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['56'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '56' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West - US","properties":{"rights":["Send","Listen","Manage"]}}'} - headers: - cache-control: [no-cache] - content-length: ['491'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:14 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1194'] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West + US","properties":{"rights":["Send","Listen","Manage"]}}' + headers: + cache-control: + - no-cache + content-length: + - '491' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules?api-version=2017-04-01 response: - body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West - US","properties":{"rights":["Send","Listen","Manage"]}}]}'} - headers: - cache-control: [no-cache] - content-length: ['503'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:14 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/HybridConnections/AuthorizationRules","location":"West + US","properties":{"rights":["Send","Listen","Manage"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '503' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy/listKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=JmplZ6JcyDzaJZ2MiN+/PxORUUSz0WdH6IdKJZgCCow=;EntityPath=testingpythontestcasehybridconnection","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=uLPp1ABKUNJ1V7eA3QhmcT5z3SATQ2l3bxn1MlQDf7w=;EntityPath=testingpythontestcasehybridconnection","primaryKey":"JmplZ6JcyDzaJZ2MiN+/PxORUUSz0WdH6IdKJZgCCow=","secondaryKey":"uLPp1ABKUNJ1V7eA3QhmcT5z3SATQ2l3bxn1MlQDf7w=","keyName":"testingauthrulepy"}'} - headers: - cache-control: [no-cache] - content-length: ['677'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:15 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1194'] - status: {code: 200, message: OK} + body: + string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=Kuj0vu/gefo/Er6cP++b2dC26aUzcaLRAI5mLl6H3m4=;EntityPath=testingpythontestcasehybridconnection","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=4n6E2Zr0VLJ+Ik7hXhLNa2Tsh3Cf7C0fYECvRFUOzLo=;EntityPath=testingpythontestcasehybridconnection","primaryKey":"Kuj0vu/gefo/Er6cP++b2dC26aUzcaLRAI5mLl6H3m4=","secondaryKey":"4n6E2Zr0VLJ+Ik7hXhLNa2Tsh3Cf7C0fYECvRFUOzLo=","keyName":"testingauthrulepy"}' + headers: + cache-control: + - no-cache + content-length: + - '677' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK - request: body: '{"keyType": "PrimaryKey"}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['25'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '25' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=PTX0qG1m4EujIXSQ3Iqc9a0q+cmkLwFY14z+TOH6sxg=;EntityPath=testingpythontestcasehybridconnection","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=uLPp1ABKUNJ1V7eA3QhmcT5z3SATQ2l3bxn1MlQDf7w=;EntityPath=testingpythontestcasehybridconnection","primaryKey":"PTX0qG1m4EujIXSQ3Iqc9a0q+cmkLwFY14z+TOH6sxg=","secondaryKey":"uLPp1ABKUNJ1V7eA3QhmcT5z3SATQ2l3bxn1MlQDf7w=","keyName":"testingauthrulepy"}'} - headers: - cache-control: [no-cache] - content-length: ['677'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:16 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1196'] - status: {code: 200, message: OK} + body: + string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=DWhA8XuA5JNQ1VWbi21e6ngpxE3u20RUmdk9+52zDVk=;EntityPath=testingpythontestcasehybridconnection","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=4n6E2Zr0VLJ+Ik7hXhLNa2Tsh3Cf7C0fYECvRFUOzLo=;EntityPath=testingpythontestcasehybridconnection","primaryKey":"DWhA8XuA5JNQ1VWbi21e6ngpxE3u20RUmdk9+52zDVk=","secondaryKey":"4n6E2Zr0VLJ+Ik7hXhLNa2Tsh3Cf7C0fYECvRFUOzLo=","keyName":"testingauthrulepy"}' + headers: + cache-control: + - no-cache + content-length: + - '677' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK - request: body: '{"keyType": "SecondaryKey"}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['27'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=PTX0qG1m4EujIXSQ3Iqc9a0q+cmkLwFY14z+TOH6sxg=;EntityPath=testingpythontestcasehybridconnection","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=9q4VPKgqzi7gzeEcrtIubUXXRWkjuz1qWd+iuowjumA=;EntityPath=testingpythontestcasehybridconnection","primaryKey":"PTX0qG1m4EujIXSQ3Iqc9a0q+cmkLwFY14z+TOH6sxg=","secondaryKey":"9q4VPKgqzi7gzeEcrtIubUXXRWkjuz1qWd+iuowjumA=","keyName":"testingauthrulepy"}'} - headers: - cache-control: [no-cache] - content-length: ['677'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:17 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1195'] - status: {code: 200, message: OK} + body: + string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=DWhA8XuA5JNQ1VWbi21e6ngpxE3u20RUmdk9+52zDVk=;EntityPath=testingpythontestcasehybridconnection","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespacehybridconnection.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=9KXk6ftflBBZiFu/98rxtlq+bNN/y52/kbizm4I+fLg=;EntityPath=testingpythontestcasehybridconnection","primaryKey":"DWhA8XuA5JNQ1VWbi21e6ngpxE3u20RUmdk9+52zDVk=","secondaryKey":"9KXk6ftflBBZiFu/98rxtlq+bNN/y52/kbizm4I+fLg=","keyName":"testingauthrulepy"}' + headers: + cache-control: + - no-cache + content-length: + - '677' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:21:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 02 Feb 2018 10:32:18 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] - status: {code: 200, message: OK} + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 03 Nov 2020 02:21:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/hybridConnections/testingpythontestcasehybridconnection?api-version=2017-04-01 response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 02 Feb 2018 10:32:21 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1197'] - status: {code: 200, message: OK} + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 03 Nov 2020 02:21:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection?api-version=2017-04-01 response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 02 Feb 2018 10:32:21 GMT'] - expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/operationresults/testingpythontestcasenamespacehybridconnection?api-version=2017-04-01'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1197'] - status: {code: 202, message: Accepted} + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 03 Nov 2020 02:21:25 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/operationresults/testingpythontestcasenamespacehybridconnection?api-version=2017-04-01 + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + status: + code: 202 + message: Accepted - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_hybridconnection_test_hybridconnetion_curdc8bc1815/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespacehybridconnection/operationresults/testingpythontestcasenamespacehybridconnection?api-version=2017-04-01 response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 02 Feb 2018 10:32:52 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - status: {code: 200, message: OK} + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 03 Nov 2020 02:21:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK version: 1 diff --git a/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_relay_check_name_availability.test_eh_namespace_available.yaml b/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_relay_check_name_availability.test_eh_namespace_available.yaml index df694170ea83..35ddd9a7e499 100644 --- a/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_relay_check_name_availability.test_eh_namespace_available.yaml +++ b/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_relay_check_name_availability.test_eh_namespace_available.yaml @@ -2,30 +2,52 @@ interactions: - request: body: '{"name": "Testingehnamespaceavailabilityforpython"}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['51'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '51' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Relay/checkNameAvailability?api-version=2017-04-01 response: - body: {string: '{"nameAvailable":true,"reason":"None","message":null}'} + body: + string: '{"nameAvailable":true,"reason":"None","message":null}' headers: - cache-control: [no-cache] - content-length: ['53'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:32:55 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1197'] - status: {code: 200, message: OK} + cache-control: + - no-cache + content-length: + - '53' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:26:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/SN1 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/SN1 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK version: 1 diff --git a/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_relay_namespace.test_relay_namespace_curd.yaml b/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_relay_namespace.test_relay_namespace_curd.yaml index 3dee6cb0370d..340bc7467379 100644 --- a/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_relay_namespace.test_relay_namespace_curd.yaml +++ b/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_relay_namespace.test_relay_namespace_curd.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"location": "westus", "tags": {"tag1": "value1", "tag2": "value2"}, "sku": - {"name": "Standard", "tier": "Standard"}}' + {"name": "Standard", "tier": "standard"}}' headers: Accept: - application/json @@ -12,18 +12,15 @@ interactions: Content-Length: - '117' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace","name":"testingpythontestcasenamespace","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-02-28T04:04:17.637Z","updatedAt":"2020-02-28T04:04:17.637Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Activating"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-11-03T02:27:17.463Z","updatedAt":"2020-11-03T02:42:08.58Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache @@ -32,7 +29,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:04:19 GMT + - Tue, 03 Nov 2020 02:42:08 GMT expires: - '-1' pragma: @@ -51,54 +48,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1192' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace?api-version=2017-04-01 - response: - body: - string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace","name":"testingpythontestcasenamespace","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-02-28T04:04:17.637Z","updatedAt":"2020-02-28T04:04:17.637Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Activating"}}' - headers: - cache-control: - - no-cache - content-length: - - '707' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 28 Feb 2020 04:04:51 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - server-sb: - - Service-Bus-Resource-Provider/CH3 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff + - '1199' status: code: 200 message: OK @@ -106,29 +56,28 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace","name":"testingpythontestcasenamespace","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-02-28T04:04:17.637Z","updatedAt":"2020-02-28T04:05:01.543Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Active"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-11-03T02:27:17.463Z","updatedAt":"2020-11-03T02:42:12.58Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Active"}}' headers: cache-control: - no-cache content-length: - - '705' + - '704' content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:05:24 GMT + - Tue, 03 Nov 2020 02:42:39 GMT expires: - '-1' pragma: @@ -159,25 +108,22 @@ interactions: Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace","name":"testingpythontestcasenamespace","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-02-28T04:04:17.637Z","updatedAt":"2020-02-28T04:05:01.543Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Active"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-11-03T02:27:17.463Z","updatedAt":"2020-11-03T02:42:12.58Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Active"}}' headers: cache-control: - no-cache content-length: - - '705' + - '704' content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:05:26 GMT + - Tue, 03 Nov 2020 02:42:41 GMT expires: - '-1' pragma: @@ -199,7 +145,7 @@ interactions: code: 200 message: OK - request: - body: '{"tags": {"tags": "{''tag1'': ''value1'', ''tag2'': ''value2''}"}}' + body: '{"tags": {"tag1": "value1", "tag2": "value2"}}' headers: Accept: - application/json @@ -208,29 +154,26 @@ interactions: Connection: - keep-alive Content-Length: - - '58' + - '46' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace","name":"testingpythontestcasenamespace","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tags":"{''tag1'': ''value1'', ''tag2'': ''value2''}"},"properties":{"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-02-28T04:04:17.637Z","updatedAt":"2020-02-28T04:05:28.697Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Activating"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-11-03T02:27:17.463Z","updatedAt":"2020-11-03T02:42:43.94Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '722' + - '707' content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:05:31 GMT + - Tue, 03 Nov 2020 02:42:47 GMT expires: - '-1' pragma: @@ -249,7 +192,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1198' status: code: 200 message: OK @@ -263,25 +206,22 @@ interactions: Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces?api-version=2017-04-01 response: body: string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace","name":"testingpythontestcasenamespace","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tags":"{''tag1'': ''value1'', ''tag2'': ''value2''}"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-02-28T04:04:17.637Z","updatedAt":"2020-02-28T04:05:29.923Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Active"}}]}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-11-03T02:27:17.463Z","updatedAt":"2020-11-03T02:42:46.263Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Active"}}]}' headers: cache-control: - no-cache content-length: - - '731' + - '717' content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:05:32 GMT + - Tue, 03 Nov 2020 02:42:47 GMT expires: - '-1' pragma: @@ -312,25 +252,22 @@ interactions: Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Relay/namespaces?api-version=2017-04-01 response: body: string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace","name":"testingpythontestcasenamespace","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tags":"{''tag1'': ''value1'', ''tag2'': ''value2''}"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-02-28T04:04:17.637Z","updatedAt":"2020-02-28T04:05:29.923Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Active"}}]}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcasenamespace","createdAt":"2020-11-03T02:27:17.463Z","updatedAt":"2020-11-03T02:42:46.263Z","serviceBusEndpoint":"https://testingpythontestcasenamespace.servicebus.windows.net:443/","status":"Active"}}]}' headers: cache-control: - no-cache content-length: - - '731' + - '717' content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:05:33 GMT + - Tue, 03 Nov 2020 02:42:47 GMT expires: - '-1' pragma: @@ -361,10 +298,7 @@ interactions: Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules/RootManageSharedAccessKey?api-version=2017-04-01 response: @@ -379,7 +313,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:05:37 GMT + - Tue, 03 Nov 2020 02:42:48 GMT expires: - '-1' pragma: @@ -412,12 +346,9 @@ interactions: Content-Length: - '46' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: @@ -432,7 +363,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:05:58 GMT + - Tue, 03 Nov 2020 02:42:55 GMT expires: - '-1' pragma: @@ -451,7 +382,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1197' status: code: 200 message: OK @@ -465,10 +396,7 @@ interactions: Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: @@ -483,7 +411,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:06:01 GMT + - Tue, 03 Nov 2020 02:42:55 GMT expires: - '-1' pragma: @@ -516,12 +444,9 @@ interactions: Content-Length: - '56' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: @@ -536,7 +461,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:06:19 GMT + - Tue, 03 Nov 2020 02:43:02 GMT expires: - '-1' pragma: @@ -555,7 +480,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1191' + - '1196' status: code: 200 message: OK @@ -569,10 +494,7 @@ interactions: Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules?api-version=2017-04-01 response: @@ -588,7 +510,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:06:20 GMT + - Tue, 03 Nov 2020 02:43:03 GMT expires: - '-1' pragma: @@ -621,15 +543,12 @@ interactions: Content-Length: - '0' User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules/testingauthrulepy/listKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=EiIFlllb9Tn7/fDBza5CCHvGuJkraB0chjDw371p4wE=","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=7HGD+SBCTU0932/3JiRf4XHMYz3k3pbh9GBHHtpp+ik=","primaryKey":"EiIFlllb9Tn7/fDBza5CCHvGuJkraB0chjDw371p4wE=","secondaryKey":"7HGD+SBCTU0932/3JiRf4XHMYz3k3pbh9GBHHtpp+ik=","keyName":"testingauthrulepy"}' + string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=Yi8RP3dNbXJvYM2X6mnMHDuN/w+q/SP6ksjKqFjsxLs=","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=li+gCzEZP3UNnnWltV42qF2IAwaNEP0TbyGSQnX6iCU=","primaryKey":"Yi8RP3dNbXJvYM2X6mnMHDuN/w+q/SP6ksjKqFjsxLs=","secondaryKey":"li+gCzEZP3UNnnWltV42qF2IAwaNEP0TbyGSQnX6iCU=","keyName":"testingauthrulepy"}' headers: cache-control: - no-cache @@ -638,7 +557,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:06:23 GMT + - Tue, 03 Nov 2020 02:43:04 GMT expires: - '-1' pragma: @@ -673,17 +592,14 @@ interactions: Content-Length: - '25' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules/testingauthrulepy/regenerateKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=PsxB2oOuORG5gRHRg7hrymGybtbhDfaOoImoTFb8vPs=","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=7HGD+SBCTU0932/3JiRf4XHMYz3k3pbh9GBHHtpp+ik=","primaryKey":"PsxB2oOuORG5gRHRg7hrymGybtbhDfaOoImoTFb8vPs=","secondaryKey":"7HGD+SBCTU0932/3JiRf4XHMYz3k3pbh9GBHHtpp+ik=","keyName":"testingauthrulepy"}' + string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=Op7C0BsZ1kUEFpKuFSpyr2N1JPgR+a+WKO8rmhhVkQE=","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=li+gCzEZP3UNnnWltV42qF2IAwaNEP0TbyGSQnX6iCU=","primaryKey":"Op7C0BsZ1kUEFpKuFSpyr2N1JPgR+a+WKO8rmhhVkQE=","secondaryKey":"li+gCzEZP3UNnnWltV42qF2IAwaNEP0TbyGSQnX6iCU=","keyName":"testingauthrulepy"}' headers: cache-control: - no-cache @@ -692,7 +608,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:06:41 GMT + - Tue, 03 Nov 2020 02:43:11 GMT expires: - '-1' pragma: @@ -711,7 +627,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -727,17 +643,14 @@ interactions: Content-Length: - '27' Content-Type: - - application/json; charset=utf-8 + - application/json User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules/testingauthrulepy/regenerateKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=PsxB2oOuORG5gRHRg7hrymGybtbhDfaOoImoTFb8vPs=","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=pf2BDtHtw0DRLStFGZ3dzhnGKZTO3WjNiC+CrLi1N4c=","primaryKey":"PsxB2oOuORG5gRHRg7hrymGybtbhDfaOoImoTFb8vPs=","secondaryKey":"pf2BDtHtw0DRLStFGZ3dzhnGKZTO3WjNiC+CrLi1N4c=","keyName":"testingauthrulepy"}' + string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=Op7C0BsZ1kUEFpKuFSpyr2N1JPgR+a+WKO8rmhhVkQE=","secondaryConnectionString":"Endpoint=sb://testingpythontestcasenamespace.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=6Du9Owm/VHzZf/UVUSmUi29OS+t+W05BE8sgbnmvOAI=","primaryKey":"Op7C0BsZ1kUEFpKuFSpyr2N1JPgR+a+WKO8rmhhVkQE=","secondaryKey":"6Du9Owm/VHzZf/UVUSmUi29OS+t+W05BE8sgbnmvOAI=","keyName":"testingauthrulepy"}' headers: cache-control: - no-cache @@ -746,7 +659,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:07:00 GMT + - Tue, 03 Nov 2020 02:43:17 GMT expires: - '-1' pragma: @@ -765,7 +678,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 200 message: OK @@ -781,10 +694,7 @@ interactions: Content-Length: - '0' User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: @@ -796,7 +706,7 @@ interactions: content-length: - '0' date: - - Fri, 28 Feb 2020 04:07:16 GMT + - Tue, 03 Nov 2020 02:43:23 GMT expires: - '-1' pragma: @@ -811,7 +721,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 200 message: OK @@ -825,10 +735,7 @@ interactions: Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/authorizationRules?api-version=2017-04-01 response: @@ -843,7 +750,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 28 Feb 2020 04:07:18 GMT + - Tue, 03 Nov 2020 02:43:25 GMT expires: - '-1' pragma: @@ -876,10 +783,7 @@ interactions: Content-Length: - '0' User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python - accept-language: - - en-US + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace?api-version=2017-04-01 response: @@ -891,7 +795,7 @@ interactions: content-length: - '0' date: - - Fri, 28 Feb 2020 04:07:24 GMT + - Tue, 03 Nov 2020 02:43:26 GMT expires: - '-1' location: @@ -908,7 +812,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14998' status: code: 202 message: Accepted @@ -916,14 +820,13 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-relay/0.2.0 Azure-SDK-For-Python + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_relay_namespace_test_relay_namespace_curdaba01766/providers/Microsoft.Relay/namespaces/testingpythontestcasenamespace/operationresults/testingpythontestcasenamespace?api-version=2017-04-01 response: @@ -935,7 +838,7 @@ interactions: content-length: - '0' date: - - Fri, 28 Feb 2020 04:07:55 GMT + - Tue, 03 Nov 2020 02:43:57 GMT expires: - '-1' pragma: diff --git a/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_wcfrelay.test_wcfrelay_curd.yaml b/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_wcfrelay.test_wcfrelay_curd.yaml index 2fa75f38d168..5f083b1b35b8 100644 --- a/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_wcfrelay.test_wcfrelay_curd.yaml +++ b/sdk/relay/azure-mgmt-relay/tests/recordings/test_azure_mgmt_wcfrelay.test_wcfrelay_curd.yaml @@ -1,518 +1,914 @@ interactions: - request: body: '{"location": "westus", "tags": {"tag1": "value1", "tag2": "value2"}, "sku": - {"name": "Standard", "tier": "Standard"}}' - headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['117'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + {"name": "Standard", "tier": "standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '117' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub?api-version=2017-04-01 response: - body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub","name":"testingpythontestcaseeventhubnamespaceEventhub","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcaseeventhubnamespaceeventhub","createdAt":"2018-02-02T10:35:58.503Z","updatedAt":"2018-02-02T10:35:58.503Z","serviceBusEndpoint":"https://testingpythontestcaseeventhubnamespaceEventhub.servicebus.windows.net:443/","status":"Activating"}}'} - headers: - cache-control: [no-cache] - content-length: ['757'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:00 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] - status: {code: 200, message: OK} + body: + string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub","name":"testingpythontestcaseeventhubnamespaceEventhub","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcaseeventhubnamespaceeventhub","createdAt":"2020-11-03T02:48:00.357Z","updatedAt":"2020-11-03T02:48:00.357Z","serviceBusEndpoint":"https://testingpythontestcaseeventhubnamespaceEventhub.servicebus.windows.net:443/","status":"Activating"}}' + headers: + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:48:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub?api-version=2017-04-01 response: - body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub","name":"testingpythontestcaseeventhubnamespaceEventhub","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcaseeventhubnamespaceeventhub","createdAt":"2018-02-02T10:35:58.503Z","updatedAt":"2018-02-02T10:36:25.763Z","serviceBusEndpoint":"https://testingpythontestcaseeventhubnamespaceEventhub.servicebus.windows.net:443/","status":"Active"}}'} - headers: - cache-control: [no-cache] - content-length: ['755'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:30 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub","name":"testingpythontestcaseeventhubnamespaceEventhub","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcaseeventhubnamespaceeventhub","createdAt":"2020-11-03T02:48:00.357Z","updatedAt":"2020-11-03T02:48:00.357Z","serviceBusEndpoint":"https://testingpythontestcaseeventhubnamespaceEventhub.servicebus.windows.net:443/","status":"Activating"}}' + headers: + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:48:33 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub?api-version=2017-04-01 response: - body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub","name":"testingpythontestcaseeventhubnamespaceEventhub","type":"Microsoft.Relay/Namespaces","location":"West - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcaseeventhubnamespaceeventhub","createdAt":"2018-02-02T10:35:58.503Z","updatedAt":"2018-02-02T10:36:25.763Z","serviceBusEndpoint":"https://testingpythontestcaseeventhubnamespaceEventhub.servicebus.windows.net:443/","status":"Active"}}'} - headers: - cache-control: [no-cache] - content-length: ['755'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:31 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub","name":"testingpythontestcaseeventhubnamespaceEventhub","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcaseeventhubnamespaceeventhub","createdAt":"2020-11-03T02:48:00.357Z","updatedAt":"2020-11-03T02:48:43.87Z","serviceBusEndpoint":"https://testingpythontestcaseeventhubnamespaceEventhub.servicebus.windows.net:443/","status":"Active"}}' + headers: + cache-control: + - no-cache + content-length: + - '754' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub","name":"testingpythontestcaseeventhubnamespaceEventhub","type":"Microsoft.Relay/Namespaces","location":"West + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:testingpythontestcaseeventhubnamespaceeventhub","createdAt":"2020-11-03T02:48:00.357Z","updatedAt":"2020-11-03T02:48:43.87Z","serviceBusEndpoint":"https://testingpythontestcaseeventhubnamespaceEventhub.servicebus.windows.net:443/","status":"Active"}}' + headers: + cache-control: + - no-cache + content-length: + - '754' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: '{"properties": {"relayType": "NetTcp", "requiresClientAuthorization": true, "requiresTransportSecurity": true, "userMetadata": "User data for WcfRelay"}}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['153'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '153' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay","name":"testingpythontestcasewcfrelay","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West - US","properties":{"createdAt":"2018-02-02T10:36:34.7064575Z","updatedAt":"2018-02-02T10:36:34.7064575Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"User - data for WcfRelay"}}'} - headers: - cache-control: [no-cache] - content-length: ['623'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:34 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1195'] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay","name":"testingpythontestcasewcfrelay","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West + US","properties":{"createdAt":"2020-11-03T02:49:06.5629656Z","updatedAt":"2020-11-03T02:49:06.5629656Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"User + data for WcfRelay"}}' + headers: + cache-control: + - no-cache + content-length: + - '623' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay","name":"testingpythontestcasewcfrelay","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West - US","properties":{"createdAt":"2018-02-02T10:36:34.7064575Z","updatedAt":"2018-02-02T10:36:34.7064575Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"User - data for WcfRelay"}}'} - headers: - cache-control: [no-cache] - content-length: ['623'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:35 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay","name":"testingpythontestcasewcfrelay","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West + US","properties":{"createdAt":"2020-11-03T02:49:06.5629656Z","updatedAt":"2020-11-03T02:49:06.5629656Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"User + data for WcfRelay"}}' + headers: + cache-control: + - no-cache + content-length: + - '623' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays?api-version=2017-04-01 response: - body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay","name":"testingpythontestcasewcfrelay","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West - US","properties":{"createdAt":"2018-02-02T10:36:34.7064575Z","updatedAt":"2018-02-02T10:36:34.7064575Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"User - data for WcfRelay"}}]}'} - headers: - cache-control: [no-cache] - content-length: ['635'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:36 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-inline-count: [''] - status: {code: 200, message: OK} + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay","name":"testingpythontestcasewcfrelay","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West + US","properties":{"createdAt":"2020-11-03T02:49:06.5629656Z","updatedAt":"2020-11-03T02:49:06.5629656Z","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"User + data for WcfRelay"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '635' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-inline-count: + - '' + status: + code: 200 + message: OK - request: body: '{"properties": {"relayType": "NetTcp", "userMetadata": "User data for WcfRelay updated"}}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['89'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '89' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay","name":"testingpythontestcasewcfrelay","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay","name":"testingpythontestcasewcfrelay","type":"Microsoft.Relay/Namespaces/WcfRelays","location":"West US","properties":{"createdAt":"0001-01-01T00:00:00","updatedAt":"0001-01-01T00:00:00","listenerCount":0,"requiresClientAuthorization":true,"relayType":"NetTcp","requiresTransportSecurity":true,"isDynamic":false,"userMetadata":"User - data for WcfRelay updated"}}'} - headers: - cache-control: [no-cache] - content-length: ['613'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:38 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1196'] - status: {code: 200, message: OK} + data for WcfRelay updated"}}' + headers: + cache-control: + - no-cache + content-length: + - '613' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1193' + status: + code: 200 + message: OK - request: body: '{"properties": {"rights": ["Send", "Listen"]}}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['46'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '46' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West - US","properties":{"rights":["Send","Listen"]}}'} - headers: - cache-control: [no-cache] - content-length: ['443'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:39 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1193'] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West + US","properties":{"rights":["Send","Listen"]}}' + headers: + cache-control: + - no-cache + content-length: + - '443' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West - US","properties":{"rights":["Send","Listen"]}}'} - headers: - cache-control: [no-cache] - content-length: ['443'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:40 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West + US","properties":{"rights":["Send","Listen"]}}' + headers: + cache-control: + - no-cache + content-length: + - '443' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: '{"properties": {"rights": ["Send", "Listen", "Manage"]}}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['56'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '56' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West - US","properties":{"rights":["Send","Listen","Manage"]}}'} - headers: - cache-control: [no-cache] - content-length: ['452'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:42 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1195'] - status: {code: 200, message: OK} + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West + US","properties":{"rights":["Send","Listen","Manage"]}}' + headers: + cache-control: + - no-cache + content-length: + - '452' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1191' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules?api-version=2017-04-01 response: - body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West - US","properties":{"rights":["Send","Listen","Manage"]}}]}'} - headers: - cache-control: [no-cache] - content-length: ['464'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:43 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - status: {code: 200, message: OK} + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy","name":"testingauthrulepy","type":"Microsoft.Relay/Namespaces/WcfRelays/AuthorizationRules","location":"West + US","properties":{"rights":["Send","Listen","Manage"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '464' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy/listKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=ChXt0x5oi6zadvsWl+x2LY5HlNQnCUlZB8MUWEIL/5Q=;EntityPath=testingpythontestcasewcfrelay","secondaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=1zACNkudMYXnpLi45JhzHVUTSY/72LC8Q3LUPX7l6sA=;EntityPath=testingpythontestcasewcfrelay","primaryKey":"ChXt0x5oi6zadvsWl+x2LY5HlNQnCUlZB8MUWEIL/5Q=","secondaryKey":"1zACNkudMYXnpLi45JhzHVUTSY/72LC8Q3LUPX7l6sA=","keyName":"testingauthrulepy"}'} - headers: - cache-control: [no-cache] - content-length: ['661'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:44 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1197'] - status: {code: 200, message: OK} + body: + string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=1ArQ4nTw32jlWg8l/F5u9LhRbwLoCn15QfFTCboWrgc=;EntityPath=testingpythontestcasewcfrelay","secondaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=C0GUJoKaRnowYn1dlbl9HZ59qj71zv9iIu4yO9gZ1QI=;EntityPath=testingpythontestcasewcfrelay","primaryKey":"1ArQ4nTw32jlWg8l/F5u9LhRbwLoCn15QfFTCboWrgc=","secondaryKey":"C0GUJoKaRnowYn1dlbl9HZ59qj71zv9iIu4yO9gZ1QI=","keyName":"testingauthrulepy"}' + headers: + cache-control: + - no-cache + content-length: + - '661' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK - request: body: '{"keyType": "PrimaryKey"}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['25'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '25' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=xEdTWBdTEvulnX9wyPzXRmk7TR8q8hNAWhBkdVDgqGs=;EntityPath=testingpythontestcasewcfrelay","secondaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=1zACNkudMYXnpLi45JhzHVUTSY/72LC8Q3LUPX7l6sA=;EntityPath=testingpythontestcasewcfrelay","primaryKey":"xEdTWBdTEvulnX9wyPzXRmk7TR8q8hNAWhBkdVDgqGs=","secondaryKey":"1zACNkudMYXnpLi45JhzHVUTSY/72LC8Q3LUPX7l6sA=","keyName":"testingauthrulepy"}'} - headers: - cache-control: [no-cache] - content-length: ['661'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:44 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] - status: {code: 200, message: OK} + body: + string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=rR6qmYBrWWgfkVvZbMyP7t5wTKEDB9ownN7mNyTmK4M=;EntityPath=testingpythontestcasewcfrelay","secondaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=C0GUJoKaRnowYn1dlbl9HZ59qj71zv9iIu4yO9gZ1QI=;EntityPath=testingpythontestcasewcfrelay","primaryKey":"rR6qmYBrWWgfkVvZbMyP7t5wTKEDB9ownN7mNyTmK4M=","secondaryKey":"C0GUJoKaRnowYn1dlbl9HZ59qj71zv9iIu4yO9gZ1QI=","keyName":"testingauthrulepy"}' + headers: + cache-control: + - no-cache + content-length: + - '661' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK - request: body: '{"keyType": "SecondaryKey"}' headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['27'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy/regenerateKeys?api-version=2017-04-01 response: - body: {string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=xEdTWBdTEvulnX9wyPzXRmk7TR8q8hNAWhBkdVDgqGs=;EntityPath=testingpythontestcasewcfrelay","secondaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=Yny59DVV1SRwbUoEKOuFyUSMcXzCvUU9xuXt4tpcxs0=;EntityPath=testingpythontestcasewcfrelay","primaryKey":"xEdTWBdTEvulnX9wyPzXRmk7TR8q8hNAWhBkdVDgqGs=","secondaryKey":"Yny59DVV1SRwbUoEKOuFyUSMcXzCvUU9xuXt4tpcxs0=","keyName":"testingauthrulepy"}'} - headers: - cache-control: [no-cache] - content-length: ['661'] - content-type: [application/json; charset=utf-8] - date: ['Fri, 02 Feb 2018 10:36:45 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - transfer-encoding: [chunked] - vary: [Accept-Encoding] - x-ms-ratelimit-remaining-subscription-writes: ['1193'] - status: {code: 200, message: OK} + body: + string: '{"primaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=rR6qmYBrWWgfkVvZbMyP7t5wTKEDB9ownN7mNyTmK4M=;EntityPath=testingpythontestcasewcfrelay","secondaryConnectionString":"Endpoint=sb://testingpythontestcaseeventhubnamespaceeventhub.servicebus.windows.net/;SharedAccessKeyName=testingauthrulepy;SharedAccessKey=477rMvqdApMYRTCexdpoaCvaaBkHnr/qzE27z1YJ+FY=;EntityPath=testingpythontestcasewcfrelay","primaryKey":"rR6qmYBrWWgfkVvZbMyP7t5wTKEDB9ownN7mNyTmK4M=","secondaryKey":"477rMvqdApMYRTCexdpoaCvaaBkHnr/qzE27z1YJ+FY=","keyName":"testingauthrulepy"}' + headers: + cache-control: + - no-cache + content-length: + - '661' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Nov 2020 02:49:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay/authorizationRules/testingauthrulepy?api-version=2017-04-01 response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 02 Feb 2018 10:36:46 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1196'] - status: {code: 200, message: OK} + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 03 Nov 2020 02:49:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/wcfRelays/testingpythontestcasewcfrelay?api-version=2017-04-01 response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 02 Feb 2018 10:36:48 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1193'] - status: {code: 200, message: OK} + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 03 Nov 2020 02:49:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub?api-version=2017-04-01 response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 02 Feb 2018 10:36:49 GMT'] - expires: ['-1'] - location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/operationresults/testingpythontestcaseeventhubnamespaceEventhub?api-version=2017-04-01'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - x-ms-ratelimit-remaining-subscription-writes: ['1195'] - status: {code: 202, message: Accepted} + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 03 Nov 2020 02:49:17 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/operationresults/testingpythontestcaseeventhubnamespaceEventhub?api-version=2017-04-01 + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + status: + code: 202 + message: Accepted - request: body: null headers: - Accept: [application/json] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.6.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 - msrest_azure/0.4.21 azure-mgmt-relay/0.1.0 Azure-SDK-For-Python] - accept-language: [en-US] + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-relay/1.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_azure_mgmt_wcfrelay_test_wcfrelay_curd89e511ce/providers/Microsoft.Relay/namespaces/testingpythontestcaseeventhubnamespaceEventhub/operationresults/testingpythontestcaseeventhubnamespaceEventhub?api-version=2017-04-01 response: - body: {string: ''} - headers: - cache-control: [no-cache] - content-length: ['0'] - date: ['Fri, 02 Feb 2018 10:37:20 GMT'] - expires: ['-1'] - pragma: [no-cache] - server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0] - server-sb: [Service-Bus-Resource-Provider/SN1] - strict-transport-security: [max-age=31536000; includeSubDomains] - status: {code: 200, message: OK} + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 03 Nov 2020 02:49:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK version: 1 diff --git a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_hybridconnection.py b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_hybridconnection.py index 41ada8900f48..633e5d4c53ae 100644 --- a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_hybridconnection.py +++ b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_hybridconnection.py @@ -8,11 +8,8 @@ import unittest import time -from msrestazure.azure_exceptions import CloudError import azure.mgmt.relay.models -from azure.mgmt.relay.models import RelayNamespace, Sku, SkuTier, AccessRights -from azure.common.credentials import ServicePrincipalCredentials - +from azure.mgmt.relay.models import RelayNamespace, Sku, AccessRights from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer @@ -22,7 +19,7 @@ def setUp(self): super(MgmtHybridConnectionTest, self).setUp() self.relay_client = self.create_mgmt_client( - azure.mgmt.relay.RelayManagementClient + azure.mgmt.relay.RelayAPI ) @ResourceGroupPreparer() @@ -33,8 +30,8 @@ def test_hybridconnetion_curd(self, resource_group, location): #Create a Namespace namespace_name = "testingpythontestcasenamespacehybridconnection" - namespaceparameter = RelayNamespace(location=location, tags={'tag1': 'value1', 'tag2': 'value2'}, sku=Sku(tier=SkuTier.standard)) - creatednamespace = self.relay_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter).result() + namespaceparameter = RelayNamespace(location=location, tags={'tag1': 'value1', 'tag2': 'value2'}, sku=Sku(tier="standard")) + creatednamespace = self.relay_client.namespaces.begin_create_or_update(resource_group_name, namespace_name, namespaceparameter).result() self.assertEqual(creatednamespace.name, namespace_name) # @@ -46,7 +43,10 @@ def test_hybridconnetion_curd(self, resource_group, location): # Create a HybridConnection hybridconnection_name = "testingpythontestcasehybridconnection" - createdhybridconnectionresponse = self.relay_client.hybrid_connections.create_or_update(resource_group_name, namespace_name, hybridconnection_name, True, "User data for HybridConnection") + createdhybridconnectionresponse = self.relay_client.hybrid_connections.create_or_update(resource_group_name, namespace_name, hybridconnection_name, { + "requires_client_authorization": True, + "user_metadata": "User data for HybridConnection" + }) self.assertEqual(createdhybridconnectionresponse.name, hybridconnection_name) self.assertEqual(createdhybridconnectionresponse.requires_client_authorization, True) @@ -60,7 +60,9 @@ def test_hybridconnetion_curd(self, resource_group, location): getlistbynamespacehybridconnectionresponse = list(self.relay_client.hybrid_connections.list_by_namespace(resource_group_name, namespace_name)) self.assertGreater(len(getlistbynamespacehybridconnectionresponse), 0) - updatehybridconnectionresponse = self.relay_client.hybrid_connections.create_or_update(resource_group_name, namespace_name, hybridconnection_name, None, "User data for HybridConnection updated") + updatehybridconnectionresponse = self.relay_client.hybrid_connections.create_or_update(resource_group_name, namespace_name, hybridconnection_name, { + "user_metadata": "User data for HybridConnection updated" + }) self.assertEqual(updatehybridconnectionresponse.name, hybridconnection_name) self.assertEqual(updatehybridconnectionresponse.requires_client_authorization, True) @@ -68,7 +70,9 @@ def test_hybridconnetion_curd(self, resource_group, location): # Create a new authorizationrule authoRule_name = "testingauthrulepy" - createhybridconnectionauthorule = self.relay_client.hybrid_connections.create_or_update_authorization_rule(resource_group_name, namespace_name, hybridconnection_name, authoRule_name,[AccessRights('Send'),AccessRights('Listen')]) + createhybridconnectionauthorule = self.relay_client.hybrid_connections.create_or_update_authorization_rule(resource_group_name, namespace_name, hybridconnection_name, authoRule_name,{ + "rights": [AccessRights('Send'),AccessRights('Listen')] + }) self.assertEqual(createhybridconnectionauthorule.name, authoRule_name, "Authorization rule name not as created - create_or_update_authorization_rule ") self.assertEqual(len(createhybridconnectionauthorule.rights), 2) @@ -79,7 +83,7 @@ def test_hybridconnetion_curd(self, resource_group, location): # update the rights of the authorizatiorule gethybridconnectionauthorule.rights.append('Manage') - updatehybridconnectionauthorule = self.relay_client.hybrid_connections.create_or_update_authorization_rule(resource_group_name, namespace_name, hybridconnection_name, authoRule_name, gethybridconnectionauthorule.rights) + updatehybridconnectionauthorule = self.relay_client.hybrid_connections.create_or_update_authorization_rule(resource_group_name, namespace_name, hybridconnection_name, authoRule_name, gethybridconnectionauthorule) self.assertEqual(updatehybridconnectionauthorule.name, authoRule_name, "Authorization rule name not as passed as parameter for update call - create_or_update_authorization_rule ") self.assertEqual(len(updatehybridconnectionauthorule.rights), 3, "Access rights mis match as updated - create_or_update_authorization_rule ") @@ -92,11 +96,15 @@ def test_hybridconnetion_curd(self, resource_group, location): self.assertIsNotNone(listkeysauthorizationrule) # regenerate Keys for authorizationrule - Primary - regenratePrimarykeyauthorizationrule = self.relay_client.hybrid_connections.regenerate_keys(resource_group_name, namespace_name, hybridconnection_name, authoRule_name, 'PrimaryKey') + regenratePrimarykeyauthorizationrule = self.relay_client.hybrid_connections.regenerate_keys(resource_group_name, namespace_name, hybridconnection_name, authoRule_name, { + "key_type": 'PrimaryKey' + }) self.assertNotEqual(listkeysauthorizationrule.primary_key,regenratePrimarykeyauthorizationrule.primary_key) # regenerate Keys for authorizationrule - Primary - regenrateSecondarykeyauthorizationrule = self.relay_client.hybrid_connections.regenerate_keys(resource_group_name,namespace_name, hybridconnection_name, authoRule_name, 'SecondaryKey') + regenrateSecondarykeyauthorizationrule = self.relay_client.hybrid_connections.regenerate_keys(resource_group_name,namespace_name, hybridconnection_name, authoRule_name, { + "key_type": 'SecondaryKey' + }) self.assertNotEqual(listkeysauthorizationrule.secondary_key, regenrateSecondarykeyauthorizationrule.secondary_key) # delete the authorizationrule @@ -106,9 +114,9 @@ def test_hybridconnetion_curd(self, resource_group, location): gethybridconnectionresponse = self.relay_client.hybrid_connections.delete(resource_group_name, namespace_name, hybridconnection_name) # Delete the create namespace - self.relay_client.namespaces.delete(resource_group_name, namespace_name).result() + self.relay_client.namespaces.begin_delete(resource_group_name, namespace_name).result() # ------------------------------------------------------------------------------ if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_operations.py b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_operations.py index 2b825edce983..83497f92c74f 100644 --- a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_operations.py +++ b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_operations.py @@ -16,7 +16,7 @@ def setUp(self): super(MgmtRelayTest, self).setUp() self.relay_client = self.create_mgmt_client( - azure.mgmt.relay.RelayManagementClient + azure.mgmt.relay.RelayAPI ) def test_operations_list(self): diff --git a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_relay_check_name_availability.py b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_relay_check_name_availability.py index 9fb9fccf38c6..2b6af379e7cf 100644 --- a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_relay_check_name_availability.py +++ b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_relay_check_name_availability.py @@ -16,7 +16,7 @@ def setUp(self): super(MgmtRelayTest, self).setUp() self.relay_client = self.create_mgmt_client( - azure.mgmt.relay.RelayManagementClient + azure.mgmt.relay.RelayAPI ) def process(self, result): @@ -24,7 +24,9 @@ def process(self, result): def test_eh_namespace_available(self): # Check the namespace availability - availabilityresult = self.relay_client.namespaces.check_name_availability_method("Testingehnamespaceavailabilityforpython") + availabilityresult = self.relay_client.namespaces.check_name_availability({ + "name": "Testingehnamespaceavailabilityforpython" + }) self.assertEqual(availabilityresult.name_available, True) diff --git a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_relay_namespace.py b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_relay_namespace.py index 6d37807598ab..041c8fa08691 100644 --- a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_relay_namespace.py +++ b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_relay_namespace.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import unittest import azure.mgmt.relay -from azure.mgmt.relay.models import RelayNamespace, Sku, SkuTier, AccessRights +from azure.mgmt.relay.models import RelayNamespace, Sku, AccessRights from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer @@ -18,7 +18,7 @@ def setUp(self): super(MgmtRelayNamespaceTest, self).setUp() self.relay_client = self.create_mgmt_client( - azure.mgmt.relay.RelayManagementClient + azure.mgmt.relay.RelayAPI ) @ResourceGroupPreparer() @@ -28,8 +28,8 @@ def test_relay_namespace_curd(self, resource_group, location): # Create a Namespace namespace_name = "testingpythontestcasenamespace" - namespaceparameter=RelayNamespace(location=location, tags={'tag1':'value1', 'tag2':'value2'}, sku=Sku(tier=SkuTier.standard)) - creatednamespace = self.relay_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter).result() + namespaceparameter=RelayNamespace(location=location, tags={'tag1':'value1', 'tag2':'value2'}, sku=Sku(tier="standard")) + creatednamespace = self.relay_client.namespaces.begin_create_or_update(resource_group_name, namespace_name, namespaceparameter).result() self.assertEqual(creatednamespace.name, namespace_name) # # # Get created Namespace @@ -42,7 +42,7 @@ def test_relay_namespace_curd(self, resource_group, location): updatenamespace = self.relay_client.namespaces.update(resource_group_name, namespace_name, namespaceparameter) # Get the List of Namespaces under the resourceGroup - list_by_resource_group - listbyresourcegroupresponse = list(self.relay_client.namespaces.list_by_resource_group(resource_group_name, False, False)) + listbyresourcegroupresponse = list(self.relay_client.namespaces.list_by_resource_group(resource_group_name)) self.assertGreater(len(listbyresourcegroupresponse), 0, "No Namespace returned, List is empty") self.assertEqual(listbyresourcegroupresponse[0].name, namespace_name, "Created namespace not found - ListByResourgroup") @@ -58,7 +58,9 @@ def test_relay_namespace_curd(self, resource_group, location): # Create a new authorizationrule authoRule_name = "testingauthrulepy" - createnamespaceauthorule = self.relay_client.namespaces.create_or_update_authorization_rule(resource_group_name,namespace_name,authoRule_name,[AccessRights('Send'),AccessRights('Listen')]) + createnamespaceauthorule = self.relay_client.namespaces.create_or_update_authorization_rule(resource_group_name,namespace_name,authoRule_name, { + "rights": [AccessRights('Send'),AccessRights('Listen')] + }) self.assertEqual(createnamespaceauthorule.name,authoRule_name, "Authorization rule name not as created - create_or_update_authorization_rule ") self.assertEqual(len(createnamespaceauthorule.rights),2) @@ -69,7 +71,7 @@ def test_relay_namespace_curd(self, resource_group, location): # update the rights of the authorizatiorule getnamespaceauthorule.rights.append('Manage') - updatenamespaceauthorule = self.relay_client.namespaces.create_or_update_authorization_rule(resource_group_name, namespace_name, authoRule_name, getnamespaceauthorule.rights) + updatenamespaceauthorule = self.relay_client.namespaces.create_or_update_authorization_rule(resource_group_name, namespace_name, authoRule_name, getnamespaceauthorule) self.assertEqual(updatenamespaceauthorule.name, authoRule_name, "Authorization rule name not as passed as parameter for update call - create_or_update_authorization_rule ") self.assertEqual(len(updatenamespaceauthorule.rights), 3, "Access rights mis match as updated - create_or_update_authorization_rule ") @@ -82,11 +84,15 @@ def test_relay_namespace_curd(self, resource_group, location): self.assertIsNotNone(listkeysauthorizationrule) # regenerate Keys for authorizationrule - Primary - regenratePrimarykeyauthorizationrule = self.relay_client.namespaces.regenerate_keys(resource_group_name, namespace_name,authoRule_name,'PrimaryKey') + regenratePrimarykeyauthorizationrule = self.relay_client.namespaces.regenerate_keys(resource_group_name, namespace_name,authoRule_name,{ + "key_type": 'PrimaryKey' + }) self.assertNotEqual(listkeysauthorizationrule.primary_key,regenratePrimarykeyauthorizationrule.primary_key) # regenerate Keys for authorizationrule - Primary - regenrateSecondarykeyauthorizationrule = self.relay_client.namespaces.regenerate_keys(resource_group_name,namespace_name,authoRule_name, 'SecondaryKey') + regenrateSecondarykeyauthorizationrule = self.relay_client.namespaces.regenerate_keys(resource_group_name,namespace_name,authoRule_name, { + "key_type": 'SecondaryKey' + }) self.assertNotEqual(listkeysauthorizationrule.secondary_key, regenrateSecondarykeyauthorizationrule.secondary_key) # delete the authorizationrule @@ -98,9 +104,9 @@ def test_relay_namespace_curd(self, resource_group, location): self.assertEqual(createnamespaceauthorule[0].name, defaultauthorule_name) # Delete the create namespace - deletenamespace = self.relay_client.namespaces.delete(resource_group_name, namespace_name).result() + deletenamespace = self.relay_client.namespaces.begin_delete(resource_group_name, namespace_name).result() # ------------------------------------------------------------------------------ if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_wcfrelay.py b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_wcfrelay.py index 606abd5f831e..0df733e5a0ef 100644 --- a/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_wcfrelay.py +++ b/sdk/relay/azure-mgmt-relay/tests/test_azure_mgmt_wcfrelay.py @@ -8,11 +8,8 @@ import unittest import time -from msrestazure.azure_exceptions import CloudError import azure.mgmt.relay.models -from azure.mgmt.relay.models import RelayNamespace, Sku, SkuTier, Relaytype, AuthorizationRule, AccessRights, AccessKeys, WcfRelay, ErrorResponseException, ErrorResponse -from azure.common.credentials import ServicePrincipalCredentials - +from azure.mgmt.relay.models import RelayNamespace, Sku, Relaytype, AuthorizationRule, AccessRights, AccessKeys, WcfRelay, ErrorResponse from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer @@ -22,7 +19,7 @@ def setUp(self): super(MgmtWcfRelayTest, self).setUp() self.relay_client = self.create_mgmt_client( - azure.mgmt.relay.RelayManagementClient + azure.mgmt.relay.RelayAPI ) @ResourceGroupPreparer() @@ -33,8 +30,8 @@ def test_wcfrelay_curd(self, resource_group, location): #Create a Namespace namespace_name = "testingpythontestcaseeventhubnamespaceEventhub" - namespaceparameter = RelayNamespace(location=location, tags={'tag1': 'value1', 'tag2': 'value2'}, sku=Sku(tier=SkuTier.standard)) - creatednamespace = self.relay_client.namespaces.create_or_update(resource_group_name, namespace_name, namespaceparameter).result() + namespaceparameter = RelayNamespace(location=location, tags={'tag1': 'value1', 'tag2': 'value2'}, sku=Sku(tier="standard")) + creatednamespace = self.relay_client.namespaces.begin_create_or_update(resource_group_name, namespace_name, namespaceparameter).result() self.assertEqual(creatednamespace.name, namespace_name) # @@ -68,15 +65,16 @@ def test_wcfrelay_curd(self, resource_group, location): self.assertGreater(len(getlistbynamespacewcfrelayresponse), 0) # update the Created eventhub - wcfrelayupdateparameter = WcfRelay( relay_type=Relaytype.net_tcp, user_metadata="User data for WcfRelay updated" - ) - - updatewcfrelayresponse = self.relay_client.wcf_relays.create_or_update(resource_group_name, namespace_name, - wcfrelay_name, wcfrelayupdateparameter) - + ) + updatewcfrelayresponse = self.relay_client.wcf_relays.create_or_update( + resource_group_name, + namespace_name, + wcfrelay_name, + wcfrelayupdateparameter + ) self.assertEqual(updatewcfrelayresponse.name, wcfrelay_name) self.assertEqual(updatewcfrelayresponse.requires_transport_security, True) self.assertEqual(updatewcfrelayresponse.requires_client_authorization, True) @@ -84,7 +82,9 @@ def test_wcfrelay_curd(self, resource_group, location): # Create a new authorizationrule authoRule_name = "testingauthrulepy" - createwcfrelayauthorule = self.relay_client.wcf_relays.create_or_update_authorization_rule(resource_group_name, namespace_name, wcfrelay_name, authoRule_name,[AccessRights('Send'),AccessRights('Listen')]) + createwcfrelayauthorule = self.relay_client.wcf_relays.create_or_update_authorization_rule(resource_group_name, namespace_name, wcfrelay_name, authoRule_name, { + "rights": [AccessRights('Send'),AccessRights('Listen')] + }) self.assertEqual(createwcfrelayauthorule.name, authoRule_name, "Authorization rule name not as created - create_or_update_authorization_rule ") self.assertEqual(len(createwcfrelayauthorule.rights), 2) @@ -95,7 +95,7 @@ def test_wcfrelay_curd(self, resource_group, location): # update the rights of the authorizatiorule getwcfrelayauthorule.rights.append('Manage') - updatewcfrelayauthorule = self.relay_client.wcf_relays.create_or_update_authorization_rule(resource_group_name, namespace_name, wcfrelay_name, authoRule_name, getwcfrelayauthorule.rights) + updatewcfrelayauthorule = self.relay_client.wcf_relays.create_or_update_authorization_rule(resource_group_name, namespace_name, wcfrelay_name, authoRule_name, getwcfrelayauthorule) self.assertEqual(updatewcfrelayauthorule.name, authoRule_name, "Authorization rule name not as passed as parameter for update call - create_or_update_authorization_rule ") self.assertEqual(len(updatewcfrelayauthorule.rights), 3, "Access rights mis match as updated - create_or_update_authorization_rule ") @@ -108,11 +108,15 @@ def test_wcfrelay_curd(self, resource_group, location): self.assertIsNotNone(listkeysauthorizationrule) # regenerate Keys for authorizationrule - Primary - regenratePrimarykeyauthorizationrule = self.relay_client.wcf_relays.regenerate_keys(resource_group_name, namespace_name, wcfrelay_name, authoRule_name, 'PrimaryKey') + regenratePrimarykeyauthorizationrule = self.relay_client.wcf_relays.regenerate_keys(resource_group_name, namespace_name, wcfrelay_name, authoRule_name, { + "key_type": 'PrimaryKey' + }) self.assertNotEqual(listkeysauthorizationrule.primary_key,regenratePrimarykeyauthorizationrule.primary_key) # regenerate Keys for authorizationrule - Primary - regenrateSecondarykeyauthorizationrule = self.relay_client.wcf_relays.regenerate_keys(resource_group_name,namespace_name, wcfrelay_name, authoRule_name, 'SecondaryKey') + regenrateSecondarykeyauthorizationrule = self.relay_client.wcf_relays.regenerate_keys(resource_group_name,namespace_name, wcfrelay_name, authoRule_name, { + "key_type": 'SecondaryKey' + }) self.assertNotEqual(listkeysauthorizationrule.secondary_key, regenrateSecondarykeyauthorizationrule.secondary_key) # delete the authorizationrule @@ -122,9 +126,9 @@ def test_wcfrelay_curd(self, resource_group, location): getwcfrelayresponse = self.relay_client.wcf_relays.delete(resource_group_name, namespace_name, wcfrelay_name) # Delete the create namespace - self.relay_client.namespaces.delete(resource_group_name, namespace_name).result() + self.relay_client.namespaces.begin_delete(resource_group_name, namespace_name).result() # ------------------------------------------------------------------------------ if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main()