diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/CHANGELOG.md b/sdk/webpubsub/azure-messaging-webpubsubservice/CHANGELOG.md new file mode 100644 index 0000000000000..578ed6acf4796 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/MANIFEST.in b/sdk/webpubsub/azure-messaging-webpubsubservice/MANIFEST.in new file mode 100644 index 0000000000000..0dc0a455b6da5 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/messaging/__init__.py + diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/README.md b/sdk/webpubsub/azure-messaging-webpubsubservice/README.md new file mode 100644 index 0000000000000..04f78efb5acd3 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-messaging-webpubsubservice%2FREADME.png) diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/_meta.json b/sdk/webpubsub/azure-messaging-webpubsubservice/_meta.json new file mode 100644 index 0000000000000..e40ee01cfed1c --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "39c7d63c21b9a29efe3907d9b949d1c77b021907", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/webpubsub/data-plane/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/webpubsub/data-plane/readme.md" +} \ No newline at end of file diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/__init__.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/__init__.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/__init__.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/__init__.py new file mode 100644 index 0000000000000..b16e0167cbd2b --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/__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 ._configuration import AzureMessagingWebPubSubServiceClientConfiguration +from ._azure_messaging_web_pub_sub_service_client import AzureMessagingWebPubSubServiceClient +__all__ = ['AzureMessagingWebPubSubServiceClient', 'AzureMessagingWebPubSubServiceClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_azure_messaging_web_pub_sub_service_client.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_azure_messaging_web_pub_sub_service_client.py new file mode 100644 index 0000000000000..d87c623fe697a --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_azure_messaging_web_pub_sub_service_client.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import AzureMessagingWebPubSubServiceClientConfiguration +from msrest.exceptions import HttpOperationError +from .operations import HealthApiOperations +from .operations import WebPubSubOperations +from . import models + + +class AzureMessagingWebPubSubServiceClient(SDKClient): + """AzureMessagingWebPubSubServiceClient + + :ivar config: Configuration for client. + :vartype config: AzureMessagingWebPubSubServiceClientConfiguration + + :ivar health_api: HealthApi operations + :vartype health_api: azure.messaging.webpubsub.operations.HealthApiOperations + :ivar web_pub_sub: WebPubSub operations + :vartype web_pub_sub: azure.messaging.webpubsub.operations.WebPubSubOperations + + """ + + def __init__( + self): + + self.config = AzureMessagingWebPubSubServiceClientConfiguration() + super(AzureMessagingWebPubSubServiceClient, self).__init__(None, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-10-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.health_api = HealthApiOperations( + self._client, self.config, self._serialize, self._deserialize) + self.web_pub_sub = WebPubSubOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_configuration.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_configuration.py new file mode 100644 index 0000000000000..473cbb6fa3f2d --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_configuration.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest import Configuration + +from .version import VERSION + + +class AzureMessagingWebPubSubServiceClientConfiguration(Configuration): + """Configuration for AzureMessagingWebPubSubServiceClient + Note that all parameters used to create this instance are saved as instance + attributes. + + """ + + def __init__( + self): + + base_url = '{Endpoint}' + + super(AzureMessagingWebPubSubServiceClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-messaging-webpubsubservice/{}'.format(VERSION)) diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/__init__.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/__init__.py new file mode 100644 index 0000000000000..358615c021c38 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ClientTokenResponse + from ._models_py3 import ErrorDetail, ErrorDetailException + from ._models_py3 import InnerError +except (SyntaxError, ImportError): + from ._models import ClientTokenResponse + from ._models import ErrorDetail, ErrorDetailException + from ._models import InnerError +from ._azure_messaging_web_pub_sub_service_client_enums import ( + WebPubSubPermission, +) + +__all__ = [ + 'ClientTokenResponse', + 'ErrorDetail', 'ErrorDetailException', + 'InnerError', + 'WebPubSubPermission', +] diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/_azure_messaging_web_pub_sub_service_client_enums.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/_azure_messaging_web_pub_sub_service_client_enums.py new file mode 100644 index 0000000000000..6ed1e7975365a --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/_azure_messaging_web_pub_sub_service_client_enums.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class WebPubSubPermission(str, Enum): + + send_to_group = "sendToGroup" + join_leave_group = "joinLeaveGroup" diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/_models.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/_models.py new file mode 100644 index 0000000000000..38f3c1419b3eb --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/_models.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ClientTokenResponse(Model): + """The response object containing the token for the client. + + :param token: The token value for the WebSocket client to connect to the + service + :type token: str + """ + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClientTokenResponse, self).__init__(**kwargs) + self.token = kwargs.get('token', None) + + +class ErrorDetail(Model): + """The error object. + + :param code: One of a server-defined set of error codes. + :type code: str + :param message: A human-readable representation of the error. + :type message: str + :param target: The target of the error. + :type target: str + :param details: An array of details about specific errors that led to this + reported error. + :type details: list[~azure.messaging.webpubsub.models.ErrorDetail] + :param inner: + :type inner: ~azure.messaging.webpubsub.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'inner': {'key': 'inner', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner = kwargs.get('inner', None) + + +class ErrorDetailException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetail'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailException, self).__init__(deserialize, response, 'ErrorDetail', *args) + + +class InnerError(Model): + """InnerError. + + :param code: A more specific error code than was provided by the + containing error. + :type code: str + :param inner: + :type inner: ~azure.messaging.webpubsub.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'inner': {'key': 'inner', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.inner = kwargs.get('inner', None) diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/_models_py3.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/_models_py3.py new file mode 100644 index 0000000000000..699c83cfd627c --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/models/_models_py3.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ClientTokenResponse(Model): + """The response object containing the token for the client. + + :param token: The token value for the WebSocket client to connect to the + service + :type token: str + """ + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__(self, *, token: str=None, **kwargs) -> None: + super(ClientTokenResponse, self).__init__(**kwargs) + self.token = token + + +class ErrorDetail(Model): + """The error object. + + :param code: One of a server-defined set of error codes. + :type code: str + :param message: A human-readable representation of the error. + :type message: str + :param target: The target of the error. + :type target: str + :param details: An array of details about specific errors that led to this + reported error. + :type details: list[~azure.messaging.webpubsub.models.ErrorDetail] + :param inner: + :type inner: ~azure.messaging.webpubsub.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'inner': {'key': 'inner', 'type': 'InnerError'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner=None, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner = inner + + +class ErrorDetailException(HttpOperationError): + """Server responsed with exception of type: 'ErrorDetail'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorDetailException, self).__init__(deserialize, response, 'ErrorDetail', *args) + + +class InnerError(Model): + """InnerError. + + :param code: A more specific error code than was provided by the + containing error. + :type code: str + :param inner: + :type inner: ~azure.messaging.webpubsub.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'inner': {'key': 'inner', 'type': 'InnerError'}, + } + + def __init__(self, *, code: str=None, inner=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.code = code + self.inner = inner diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/__init__.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/__init__.py new file mode 100644 index 0000000000000..bb134d9292ac6 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._health_api_operations import HealthApiOperations +from ._web_pub_sub_operations import WebPubSubOperations + +__all__ = [ + 'HealthApiOperations', + 'WebPubSubOperations', +] diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/_health_api_operations.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/_health_api_operations.py new file mode 100644 index 0000000000000..1930fba490159 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/_health_api_operations.py @@ -0,0 +1,84 @@ +# 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.pipeline import ClientRawResponse +from msrest.exceptions import HttpOperationError + +from .. import models + + +class HealthApiOperations(object): + """HealthApiOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 get_service_status( + self, endpoint, api_version, custom_headers=None, raw=False, **operation_config): + """Get service health status. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param api_version: The version of the REST APIs. + :type api_version: 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:`HttpOperationError` + """ + # Construct URL + url = self.get_service_status.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise HttpOperationError(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + get_service_status.metadata = {'url': '/api/health'} diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/_web_pub_sub_operations.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/_web_pub_sub_operations.py new file mode 100644 index 0000000000000..76d011a5193c8 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/_web_pub_sub_operations.py @@ -0,0 +1,1309 @@ +# 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.pipeline import ClientRawResponse + +from .. import models + + +class WebPubSubOperations(object): + """WebPubSubOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 generate_client_token( + self, endpoint, hub, api_version, user_id=None, role=None, minutes_to_expire=60, custom_headers=None, raw=False, **operation_config): + """Generate token for the client to connect Azure Web PubSub service. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param user_id: User Id. + :type user_id: str + :param role: Roles that the connection with the generated token will + have. + :type role: list[str] + :param minutes_to_expire: The expire time of the generated token. + :type minutes_to_expire: int + :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: ClientTokenResponse or ClientRawResponse if raw=true + :rtype: ~azure.messaging.webpubsub.models.ClientTokenResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorDetailException` + """ + # Construct URL + url = self.generate_client_token.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if user_id is not None: + query_parameters['userId'] = self._serialize.query("user_id", user_id, 'str') + if role is not None: + query_parameters['role'] = self._serialize.query("role", role, '[str]', div=',') + if minutes_to_expire is not None: + query_parameters['minutesToExpire'] = self._serialize.query("minutes_to_expire", minutes_to_expire, 'int') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if custom_headers: + header_parameters.update(custom_headers) + + # 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.ErrorDetailException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClientTokenResponse', response) + header_dict = { + 'x-ms-error-code': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + generate_client_token.metadata = {'url': '/api/hubs/{hub}/:generateToken'} + + def close_all_connections( + self, endpoint, hub, api_version, excluded=None, reason=None, custom_headers=None, raw=False, **operation_config): + """Close the connections in the hub. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param excluded: Exclude these connectionIds when closing the + connections in the hub. + :type excluded: list[str] + :param reason: The reason closing the client connection. + :type reason: 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:`ErrorDetailException` + """ + # Construct URL + url = self.close_all_connections.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if excluded is not None: + query_parameters['excluded'] = self._serialize.query("excluded", excluded, '[str]', div=',') + if reason is not None: + query_parameters['reason'] = self._serialize.query("reason", reason, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # 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 [204]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + close_all_connections.metadata = {'url': '/api/hubs/{hub}/:closeConnections'} + + def send_to_all( + self, endpoint, hub, api_version, message, excluded=None, custom_headers=None, raw=False, **operation_config): + """Broadcast content inside request body to all the connected client + connections. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param message: The payload body. + :type message: str + :param excluded: Excluded connection Ids. + :type excluded: list[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:`ErrorDetailException` + """ + # Construct URL + url = self.send_to_all.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if excluded is not None: + query_parameters['excluded'] = self._serialize.query("excluded", excluded, '[str]', div=',') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(message, 'str') + + # 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 [202]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + send_to_all.metadata = {'url': '/api/hubs/{hub}/:send'} + + def connection_exists( + self, endpoint, hub, connection_id, api_version, custom_headers=None, raw=False, **operation_config): + """Check if the connection with the given connectionId exists. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param connection_id: The connection Id. + :type connection_id: str + :param api_version: The version of the REST APIs. + :type api_version: 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:`ErrorDetailException` + """ + # Construct URL + url = self.connection_exists.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'connectionId': self._serialize.url("connection_id", connection_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + connection_exists.metadata = {'url': '/api/hubs/{hub}/connections/{connectionId}'} + + def close_connection( + self, endpoint, hub, connection_id, api_version, reason=None, custom_headers=None, raw=False, **operation_config): + """Close the client connection. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param connection_id: Target connection Id. + :type connection_id: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param reason: The reason closing the client connection. + :type reason: 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:`ErrorDetailException` + """ + # Construct URL + url = self.close_connection.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'connectionId': self._serialize.url("connection_id", connection_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if reason is not None: + query_parameters['reason'] = self._serialize.query("reason", reason, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # 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 [204]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + close_connection.metadata = {'url': '/api/hubs/{hub}/connections/{connectionId}'} + + def send_to_connection( + self, endpoint, hub, connection_id, api_version, message, custom_headers=None, raw=False, **operation_config): + """Send content inside request body to the specific connection. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param connection_id: The connection Id. + :type connection_id: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param message: The payload body. + :type message: 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:`ErrorDetailException` + """ + # Construct URL + url = self.send_to_connection.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'connectionId': self._serialize.url("connection_id", connection_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(message, 'str') + + # 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 [202]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + send_to_connection.metadata = {'url': '/api/hubs/{hub}/connections/{connectionId}/:send'} + + def group_exists( + self, endpoint, hub, group, api_version, custom_headers=None, raw=False, **operation_config): + """Check if there are any client connections inside the given group. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param group: Target group name, which length should be greater than 0 + and less than 1025. + :type group: str + :param api_version: The version of the REST APIs. + :type api_version: 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:`ErrorDetailException` + """ + # Construct URL + url = self.group_exists.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'group': self._serialize.url("group", group, 'str', max_length=1024, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + group_exists.metadata = {'url': '/api/hubs/{hub}/groups/{group}'} + + def close_group_connections( + self, endpoint, hub, group, api_version, excluded=None, reason=None, custom_headers=None, raw=False, **operation_config): + """Close connections in the specific group. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param group: Target group name, which length should be greater than 0 + and less than 1025. + :type group: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param excluded: Exclude these connectionIds when closing the + connections in the group. + :type excluded: list[str] + :param reason: The reason closing the client connection. + :type reason: 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:`ErrorDetailException` + """ + # Construct URL + url = self.close_group_connections.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'group': self._serialize.url("group", group, 'str', max_length=1024, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if excluded is not None: + query_parameters['excluded'] = self._serialize.query("excluded", excluded, '[str]', div=',') + if reason is not None: + query_parameters['reason'] = self._serialize.query("reason", reason, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # 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 [204]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + close_group_connections.metadata = {'url': '/api/hubs/{hub}/groups/{group}/:closeConnections'} + + def send_to_group( + self, endpoint, hub, group, api_version, message, excluded=None, custom_headers=None, raw=False, **operation_config): + """Send content inside request body to a group of connections. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param group: Target group name, which length should be greater than 0 + and less than 1025. + :type group: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param message: The payload body. + :type message: str + :param excluded: Excluded connection Ids + :type excluded: list[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:`ErrorDetailException` + """ + # Construct URL + url = self.send_to_group.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'group': self._serialize.url("group", group, 'str', max_length=1024, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if excluded is not None: + query_parameters['excluded'] = self._serialize.query("excluded", excluded, '[str]', div=',') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(message, 'str') + + # 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 [202]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + send_to_group.metadata = {'url': '/api/hubs/{hub}/groups/{group}/:send'} + + def add_connection_to_group( + self, endpoint, hub, group, connection_id, api_version, custom_headers=None, raw=False, **operation_config): + """Add a connection to the target group. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param group: Target group name, which length should be greater than 0 + and less than 1025. + :type group: str + :param connection_id: Target connection Id + :type connection_id: str + :param api_version: The version of the REST APIs. + :type api_version: 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:`ErrorDetailException` + """ + # Construct URL + url = self.add_connection_to_group.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'group': self._serialize.url("group", group, 'str', max_length=1024, min_length=1), + 'connectionId': self._serialize.url("connection_id", connection_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + add_connection_to_group.metadata = {'url': '/api/hubs/{hub}/groups/{group}/connections/{connectionId}'} + + def remove_connection_from_group( + self, endpoint, hub, group, connection_id, api_version, custom_headers=None, raw=False, **operation_config): + """Remove a connection from the target group. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param group: Target group name, which length should be greater than 0 + and less than 1025. + :type group: str + :param connection_id: Target connection Id. + :type connection_id: str + :param api_version: The version of the REST APIs. + :type api_version: 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:`ErrorDetailException` + """ + # Construct URL + url = self.remove_connection_from_group.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'group': self._serialize.url("group", group, 'str', max_length=1024, min_length=1), + 'connectionId': self._serialize.url("connection_id", connection_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # 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 [204]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + remove_connection_from_group.metadata = {'url': '/api/hubs/{hub}/groups/{group}/connections/{connectionId}'} + + def user_exists( + self, endpoint, hub, user_id, api_version, custom_headers=None, raw=False, **operation_config): + """Check if there are any client connections connected for the given user. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param user_id: Target user Id. + :type user_id: str + :param api_version: The version of the REST APIs. + :type api_version: 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:`ErrorDetailException` + """ + # Construct URL + url = self.user_exists.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'userId': self._serialize.url("user_id", user_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + user_exists.metadata = {'url': '/api/hubs/{hub}/users/{userId}'} + + def close_user_connections( + self, endpoint, hub, user_id, api_version, excluded=None, reason=None, custom_headers=None, raw=False, **operation_config): + """Close connections for the specific user. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param user_id: The user Id. + :type user_id: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param excluded: Exclude these connectionIds when closing the + connections for the user. + :type excluded: list[str] + :param reason: The reason closing the client connection. + :type reason: 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:`ErrorDetailException` + """ + # Construct URL + url = self.close_user_connections.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'userId': self._serialize.url("user_id", user_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if excluded is not None: + query_parameters['excluded'] = self._serialize.query("excluded", excluded, '[str]', div=',') + if reason is not None: + query_parameters['reason'] = self._serialize.query("reason", reason, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # 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 [204]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + close_user_connections.metadata = {'url': '/api/hubs/{hub}/users/{userId}/:closeConnections'} + + def send_to_user( + self, endpoint, hub, user_id, api_version, message, custom_headers=None, raw=False, **operation_config): + """Send content inside request body to the specific user. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param user_id: The user Id. + :type user_id: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param message: The payload body. + :type message: 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:`ErrorDetailException` + """ + # Construct URL + url = self.send_to_user.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'userId': self._serialize.url("user_id", user_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(message, 'str') + + # 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 [202]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + send_to_user.metadata = {'url': '/api/hubs/{hub}/users/{userId}/:send'} + + def add_user_to_group( + self, endpoint, hub, group, user_id, api_version, custom_headers=None, raw=False, **operation_config): + """Add a user to the target group. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param group: Target group name, which length should be greater than 0 + and less than 1025. + :type group: str + :param user_id: Target user Id. + :type user_id: str + :param api_version: The version of the REST APIs. + :type api_version: 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:`ErrorDetailException` + """ + # Construct URL + url = self.add_user_to_group.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'group': self._serialize.url("group", group, 'str', max_length=1024, min_length=1), + 'userId': self._serialize.url("user_id", user_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + add_user_to_group.metadata = {'url': '/api/hubs/{hub}/users/{userId}/groups/{group}'} + + def remove_user_from_group( + self, endpoint, hub, group, user_id, api_version, custom_headers=None, raw=False, **operation_config): + """Remove a user from the target group. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param group: Target group name, which length should be greater than 0 + and less than 1025. + :type group: str + :param user_id: Target user Id. + :type user_id: str + :param api_version: The version of the REST APIs. + :type api_version: 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:`ErrorDetailException` + """ + # Construct URL + url = self.remove_user_from_group.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'group': self._serialize.url("group", group, 'str', max_length=1024, min_length=1), + 'userId': self._serialize.url("user_id", user_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # 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 [204]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + remove_user_from_group.metadata = {'url': '/api/hubs/{hub}/users/{userId}/groups/{group}'} + + def remove_user_from_all_groups( + self, endpoint, hub, user_id, api_version, custom_headers=None, raw=False, **operation_config): + """Remove a user from all groups. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param user_id: Target user Id. + :type user_id: str + :param api_version: The version of the REST APIs. + :type api_version: 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:`ErrorDetailException` + """ + # Construct URL + url = self.remove_user_from_all_groups.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'userId': self._serialize.url("user_id", user_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # 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 [204]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + remove_user_from_all_groups.metadata = {'url': '/api/hubs/{hub}/users/{userId}/groups'} + + def grant_permission( + self, endpoint, hub, permission, connection_id, api_version, target_name=None, custom_headers=None, raw=False, **operation_config): + """Grant permission to the connection. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param permission: The permission: current supported actions are + joinLeaveGroup and sendToGroup. Possible values include: + 'sendToGroup', 'joinLeaveGroup' + :type permission: str or + ~azure.messaging.webpubsub.models.WebPubSubPermission + :param connection_id: Target connection Id. + :type connection_id: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param target_name: The meaning of the target depends on the specific + permission. For joinLeaveGroup and sendToGroup, targetName is a + required parameter standing for the group name. + :type target_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:`ErrorDetailException` + """ + # Construct URL + url = self.grant_permission.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'permission': self._serialize.url("permission", permission, 'str'), + 'connectionId': self._serialize.url("connection_id", connection_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if target_name is not None: + query_parameters['targetName'] = self._serialize.query("target_name", target_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + grant_permission.metadata = {'url': '/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}'} + + def revoke_permission( + self, endpoint, hub, permission, connection_id, api_version, target_name=None, custom_headers=None, raw=False, **operation_config): + """Revoke permission for the connection. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param permission: The permission: current supported actions are + joinLeaveGroup and sendToGroup. Possible values include: + 'sendToGroup', 'joinLeaveGroup' + :type permission: str or + ~azure.messaging.webpubsub.models.WebPubSubPermission + :param connection_id: Target connection Id. + :type connection_id: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param target_name: The meaning of the target depends on the specific + permission. For joinLeaveGroup and sendToGroup, targetName is a + required parameter standing for the group name. + :type target_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:`ErrorDetailException` + """ + # Construct URL + url = self.revoke_permission.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'permission': self._serialize.url("permission", permission, 'str'), + 'connectionId': self._serialize.url("connection_id", connection_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if target_name is not None: + query_parameters['targetName'] = self._serialize.query("target_name", target_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # 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 [204]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + revoke_permission.metadata = {'url': '/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}'} + + def check_permission( + self, endpoint, hub, permission, connection_id, api_version, target_name=None, custom_headers=None, raw=False, **operation_config): + """Check if a connection has permission to the specified action. + + :param endpoint: HTTP or HTTPS endpoint for the Web PubSub service + instance. + :type endpoint: str + :param hub: Target hub name, which should start with alphabetic + characters and only contain alpha-numeric characters or underscore. + :type hub: str + :param permission: The permission: current supported actions are + joinLeaveGroup and sendToGroup. Possible values include: + 'sendToGroup', 'joinLeaveGroup' + :type permission: str or + ~azure.messaging.webpubsub.models.WebPubSubPermission + :param connection_id: Target connection Id. + :type connection_id: str + :param api_version: The version of the REST APIs. + :type api_version: str + :param target_name: The meaning of the target depends on the specific + permission. For joinLeaveGroup and sendToGroup, targetName is a + required parameter standing for the group name. + :type target_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:`ErrorDetailException` + """ + # Construct URL + url = self.check_permission.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + 'hub': self._serialize.url("hub", hub, 'str', pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'), + 'permission': self._serialize.url("permission", permission, 'str'), + 'connectionId': self._serialize.url("connection_id", connection_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if target_name is not None: + query_parameters['targetName'] = self._serialize.query("target_name", target_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorDetailException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'x-ms-error-code': 'str', + }) + return client_raw_response + check_permission.metadata = {'url': '/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}'} diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/version.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/version.py new file mode 100644 index 0000000000000..affaef0c987ee --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" + diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/sdk_packaging.toml b/sdk/webpubsub/azure-messaging-webpubsubservice/sdk_packaging.toml new file mode 100644 index 0000000000000..018bb902146bc --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-messaging-webpubsubservice" +package_nspkg = "azure-messaging-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/setup.cfg b/sdk/webpubsub/azure-messaging-webpubsubservice/setup.cfg new file mode 100644 index 0000000000000..3c6e79cf31da1 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/setup.py b/sdk/webpubsub/azure-messaging-webpubsubservice/setup.py new file mode 100644 index 0000000000000..c493b1577a2e5 --- /dev/null +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/setup.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-messaging-webpubsubservice" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.messaging', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-messaging-nspkg'], + } +) diff --git a/sdk/webpubsub/ci.yml b/sdk/webpubsub/ci.yml new file mode 100644 index 0000000000000..ba6b99237b6b8 --- /dev/null +++ b/sdk/webpubsub/ci.yml @@ -0,0 +1,35 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/messaging-webpubsubservice/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/messaging-webpubsubservice/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: messaging-webpubsubservice + Artifacts: + - name: azure-mgmt-messaging-webpubsubservice + safeName: azuremgmtmessaging-webpubsubservice