Skip to content

Commit

Permalink
CodeGen from PR 16902 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge c7144760e2fddd0b9328f113cff6a03b2a8c8987 into b22180c
  • Loading branch information
SDKAuto committed Nov 30, 2021
1 parent d769535 commit f3cd4b4
Show file tree
Hide file tree
Showing 43 changed files with 16,713 additions and 465 deletions.
8 changes: 4 additions & 4 deletions sdk/edgeorder/azure-mgmt-edgeorder/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.4.2",
"autorest": "3.4.5",
"use": [
"@autorest/python@5.8.1",
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
],
"commit": "f985f05e68b7720cd5cd4c55bd89ce8463f7e554",
"commit": "3d1c5d45f465ee873b46edacd52d045cf75cb7c3",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/edgeorder/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
"autorest_command": "autorest specification/edgeorder/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5",
"readme": "specification/edgeorder/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# --------------------------------------------------------------------------

from ._edge_order_management_client import EdgeOrderManagementClient
from ._version import VERSION

__version__ = VERSION
__all__ = ['EdgeOrderManagementClient']

try:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +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.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -20,7 +22,6 @@

from azure.core.credentials import TokenCredential


class EdgeOrderManagementClientConfiguration(Configuration):
"""Configuration for EdgeOrderManagementClient.
Expand Down Expand Up @@ -48,9 +49,8 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-12-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-edgeorder/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'azure-mgmt-edgeorder/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,85 +1,112 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.mgmt.core import ARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from msrest import Deserializer, Serializer

from ._configuration import EdgeOrderManagementClientConfiguration
from ._operations_mixin import EdgeOrderManagementClientOperationsMixin

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import EdgeOrderManagementClientConfiguration
from .operations import EdgeOrderManagementClientOperationsMixin
from . import models
class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Will be removed in final version of multiapi azure-core based client
"""
pass

class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient):
"""The EdgeOrder Client.
class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin):
"""Edge Order API's.
This ready contains multiple API versions, to help you deal with all of the Azure clouds
(Azure Stack, Azure Government, Azure China, etc.).
By default, it uses the latest API version available on public Azure.
For production, you should stick to a particular api-version and/or profile.
The profile sets a mapping between an operation group and its API version.
The api-version parameter sets the default API version if the operation
group is not described in the profile.
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
:type base_url: str
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2021-12-01'
_PROFILE_TAG = "azure.mgmt.edgeorder.EdgeOrderManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
}},
_PROFILE_TAG + " latest"
)

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None, # type: Optional[str]
base_url=None, # type: Optional[str]
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = EdgeOrderManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(EdgeOrderManagementClient, self).__init__(
api_version=api_version,
profile=profile
)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

@classmethod
def _models_dict(cls, api_version):
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
@classmethod
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
* 2020-12-01-preview: :mod:`v2020_12_01_preview.models<azure.mgmt.edgeorder.v2020_12_01_preview.models>`
* 2021-12-01: :mod:`v2021_12_01.models<azure.mgmt.edgeorder.v2021_12_01.models>`
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response
if api_version == '2020-12-01-preview':
from .v2020_12_01_preview import models
return models
elif api_version == '2021-12-01':
from .v2021_12_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

def close(self):
# type: () -> None
self._client.close()

def __enter__(self):
# type: () -> EdgeOrderManagementClient
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
self._client.__exit__(*exc_details)
Loading

0 comments on commit f3cd4b4

Please sign in to comment.