forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 14002 in Azure/azure-rest-api-specs
[Hub Generated] Public private branch 'wps' (Azure#14002) * Add webpubsub swagger Add custom words Update webpubsub.json Update webpubsub.json Resolve comments Update webpubsub.json resolve comments Update operationId for existence check [wps] update python generation section and client name for all languages (#1) * add python stuff * make title across languages the same * Update version * Update some constraints * Update webpubsub.json * rename to GetServiceStatus * Update readme.md * Update readme.md * Update readme.md
- Loading branch information
SDKAuto
committed
Apr 21, 2021
1 parent
eae413d
commit b75fd39
Showing
18 changed files
with
1,348 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Release History | ||
|
||
## 0.1.0 (1970-01-01) | ||
|
||
* Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": "6a209b9db4e27a651a6c2f38109ce3b2b9868aca", | ||
"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" | ||
} |
1 change: 1 addition & 0 deletions
1
sdk/webpubsub/azure-messaging-webpubsubservice/azure/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
1 change: 1 addition & 0 deletions
1
sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
19 changes: 19 additions & 0 deletions
19
sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
49 changes: 49 additions & 0 deletions
49
...ubservice/azure/messaging/webpubsubservice/_azure_messaging_web_pub_sub_service_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
36 changes: 36 additions & 0 deletions
36
...ubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
18 changes: 18 additions & 0 deletions
18
...re/messaging/webpubsubservice/models/_azure_messaging_web_pub_sub_service_client_enums.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
18 changes: 18 additions & 0 deletions
18
.../azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/operations/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
] |
74 changes: 74 additions & 0 deletions
74
...ng-webpubsubservice/azure/messaging/webpubsubservice/operations/_health_api_operations.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'} |
Oops, something went wrong.