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
12 changes: 6 additions & 6 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.5",
"commit": "01a40ad3b4b8588e62647b76c85090740d05c802",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
"@autorest/python@6.4.0",
"@autorest/modelerfour@4.24.3"
],
"commit": "cea6492a1e41b3f3b4f8b4f69bdcc10431e79c0e",
"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.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5",
"autorest_command": "autorest specification/edgeorder/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/edgeorder/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@
patch_sdk()
except ImportError:
pass

from ._version import VERSION

__version__ = VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

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

from azure.core.credentials import TokenCredential

class EdgeOrderManagementClientConfiguration(Configuration):
Expand All @@ -28,19 +26,18 @@ class EdgeOrderManagementClientConfiguration(Configuration):
Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
):
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
Expand All @@ -55,9 +52,8 @@ def __init__(

def _configure(
self,
**kwargs # type: Any
**kwargs: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
Expand All @@ -68,4 +64,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,19 @@
# regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
from typing import Any, Optional, 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
from ._serialization import Deserializer, Serializer

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

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand All @@ -44,9 +41,9 @@ class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin, MultiA
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.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
Expand All @@ -68,15 +65,13 @@ class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin, MultiA

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
credential: "TokenCredential",
subscription_id: str,
api_version: Optional[str]=None,
base_url: str = "https://management.azure.com",
profile: KnownProfiles=KnownProfiles.default,
**kwargs: Any
):
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__(
Expand All @@ -94,15 +89,89 @@ def models(cls, api_version=DEFAULT_API_VERSION):

* 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>`
* 2022-05-01-preview: :mod:`v2022_05_01_preview.models<azure.mgmt.edgeorder.v2022_05_01_preview.models>`
"""
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
elif api_version == '2022-05-01-preview':
from .v2022_05_01_preview import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
def addresses(self):
"""Instance depends on the API version:

* 2022-05-01-preview: :class:`AddressesOperations<azure.mgmt.edgeorder.v2022_05_01_preview.operations.AddressesOperations>`
"""
api_version = self._get_api_version('addresses')
if api_version == '2022-05-01-preview':
from .v2022_05_01_preview.operations import AddressesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'addresses'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def operations(self):
"""Instance depends on the API version:

* 2022-05-01-preview: :class:`Operations<azure.mgmt.edgeorder.v2022_05_01_preview.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2022-05-01-preview':
from .v2022_05_01_preview.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def order_items(self):
"""Instance depends on the API version:

* 2022-05-01-preview: :class:`OrderItemsOperations<azure.mgmt.edgeorder.v2022_05_01_preview.operations.OrderItemsOperations>`
"""
api_version = self._get_api_version('order_items')
if api_version == '2022-05-01-preview':
from .v2022_05_01_preview.operations import OrderItemsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'order_items'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def orders(self):
"""Instance depends on the API version:

* 2022-05-01-preview: :class:`OrdersOperations<azure.mgmt.edgeorder.v2022_05_01_preview.operations.OrdersOperations>`
"""
api_version = self._get_api_version('orders')
if api_version == '2022-05-01-preview':
from .v2022_05_01_preview.operations import OrdersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'orders'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def products_and_configurations(self):
"""Instance depends on the API version:

* 2022-05-01-preview: :class:`ProductsAndConfigurationsOperations<azure.mgmt.edgeorder.v2022_05_01_preview.operations.ProductsAndConfigurationsOperations>`
"""
api_version = self._get_api_version('products_and_configurations')
if api_version == '2022-05-01-preview':
from .v2022_05_01_preview.operations import ProductsAndConfigurationsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'products_and_configurations'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

def close(self):
self._client.close()
def __enter__(self):
Expand Down
Loading