Skip to content
Draft
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": "f6e09c2351d5f2ef8cfdf78d26fc2c726e5fd47b",
"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"
}
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,38 @@
# 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 .operations import AzureMessagingWebPubSubServiceClientOperationsMixin
from . import models


class AzureMessagingWebPubSubServiceClient(AzureMessagingWebPubSubServiceClientOperationsMixin, SDKClient):
"""AzureMessagingWebPubSubServiceClient

:ivar config: Configuration for client.
:vartype config: AzureMessagingWebPubSubServiceClientConfiguration

"""

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)

Original file line number Diff line number Diff line change
@@ -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))
Original file line number Diff line number Diff line change
@@ -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',
]
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,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)
Original file line number Diff line number Diff line change
@@ -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
Loading