Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdk/webpubsub/azure-messaging-webpubsubservice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 0.1.0 (1970-01-01)

* Initial Release
6 changes: 6 additions & 0 deletions sdk/webpubsub/azure-messaging-webpubsubservice/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
include azure/messaging/__init__.py

27 changes: 27 additions & 0 deletions sdk/webpubsub/azure-messaging-webpubsubservice/README.md
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 8 additions & 0 deletions sdk/webpubsub/azure-messaging-webpubsubservice/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "V2",
"use": "@microsoft.azure/autorest.python@~4.0.71",
"commit": "8b5c4cad689cd8b75d0c145aa973bd8bc66f56c1",
"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 [email protected]/autorest.python@~4.0.71 --version=V2",
"readme": "specification/webpubsub/data-plane/readme.md"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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


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

:param str base_url: Service URL
"""

def __init__(
self, base_url=None):

self.config = AzureMessagingWebPubSubServiceClientConfiguration(base_url)
super(AzureMessagingWebPubSubServiceClient, self).__init__(None, self.config)

client_models = {}
self.api_version = '2021-05-01-preview'
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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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.

:param str base_url: Service URL
"""

def __init__(
self, base_url=None):

if not base_url:
base_url = 'http://localhost'

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))
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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


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.
"""

def __init__(self, client, config, serializer, deserializer):

self._client = client
self._serialize = serializer
self._deserialize = deserializer

self.config = config

def get_service_status(
self, api_version="2021-05-01-preview", custom_headers=None, raw=False, **operation_config):
"""Get service health status.

: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<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
"""
# Construct URL
url = self.get_service_status.metadata['url']

# Construct parameters
query_parameters = {}
if api_version is not None:
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'}
Loading