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
6 changes: 3 additions & 3 deletions sdk/storage/azure-mgmt-storagecache/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "3f3b51edf8fd0eb65004df390d6ee98e0e23c53d",
"commit": "674e8468d8b504621f328839e77fca4ac20b734a",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.2.16",
"@autorest/python@6.5.0",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/storagecache/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/storagecache/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.5.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/storagecache/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
Expand All @@ -33,17 +27,16 @@ class StorageCacheManagementClientConfiguration(Configuration): # pylint: disab

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageCacheManagementClientConfiguration, self).__init__(**kwargs)
api_version: Literal["2023-01-01"] = kwargs.pop("api_version", "2023-01-01")
api_version: str = kwargs.pop("api_version", "2023-05-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if xml_desc.get("attr", False):
if xml_ns:
ET.register_namespace(xml_prefix, xml_ns)
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
serialized.set(xml_name, new_attr) # type: ignore
continue
if xml_desc.get("text", False):
Expand Down Expand Up @@ -1271,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type):
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
xml_ns = internal_type_xml_map.get("ns", None)
if xml_ns:
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
return xml_name


Expand All @@ -1295,7 +1295,7 @@ def xml_key_extractor(attr, attr_desc, data):
# Integrate namespace if necessary
xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None))
if xml_ns:
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)

# If it's an attribute, that's simple
if xml_desc.get("attr", False):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
from ._configuration import StorageCacheManagementClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
AmlFilesystemsOperations,
AscOperationsOperations,
AscUsagesOperations,
CachesOperations,
Operations,
SkusOperations,
StorageCacheManagementClientOperationsMixin,
StorageTargetOperations,
StorageTargetsOperations,
UsageModelsOperations,
Expand All @@ -31,11 +33,15 @@
from azure.core.credentials import TokenCredential


class StorageCacheManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""A Storage Cache provides scalable caching service for NAS clients, serving data from either
NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to
manage Caches.
class StorageCacheManagementClient(
StorageCacheManagementClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""Azure Managed Lustre provides a fully managed Lustre® file system, integrated with Blob
storage, for use on demand. These operations create and manage Azure Managed Lustre file
systems.

:ivar aml_filesystems: AmlFilesystemsOperations operations
:vartype aml_filesystems: azure.mgmt.storagecache.operations.AmlFilesystemsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.storagecache.operations.Operations
:ivar skus: SkusOperations operations
Expand All @@ -54,12 +60,11 @@ class StorageCacheManagementClient: # pylint: disable=client-accepts-api-versio
:vartype storage_target: azure.mgmt.storagecache.operations.StorageTargetOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand All @@ -76,12 +81,13 @@ def __init__(
self._config = StorageCacheManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.aml_filesystems = AmlFilesystemsOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize)
self.usage_models = UsageModelsOperations(self._client, self._config, self._serialize, self._deserialize)
Expand Down Expand Up @@ -120,5 +126,5 @@ def __enter__(self) -> "StorageCacheManagementClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details) -> None:
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import List, cast
from abc import ABC
from typing import List, TYPE_CHECKING, cast

from azure.core.pipeline.transport import HttpRequest

from ._configuration import StorageCacheManagementClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient

from ._serialization import Deserializer, Serializer


def _convert_request(request, files=None):
data = request.content if not files else None
Expand All @@ -28,3 +37,12 @@ def _format_url_section(template, **kwargs):
formatted_components = cast(List[str], template.split("/"))
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
template = "/".join(components)


class StorageCacheManagementClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""

_client: "PipelineClient"
_config: StorageCacheManagementClientConfiguration
_serialize: "Serializer"
_deserialize: "Deserializer"
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.4.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from .._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
Expand All @@ -33,17 +27,16 @@ class StorageCacheManagementClientConfiguration(Configuration): # pylint: disab

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageCacheManagementClientConfiguration, self).__init__(**kwargs)
api_version: Literal["2023-01-01"] = kwargs.pop("api_version", "2023-01-01")
api_version: str = kwargs.pop("api_version", "2023-05-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
from .._serialization import Deserializer, Serializer
from ._configuration import StorageCacheManagementClientConfiguration
from .operations import (
AmlFilesystemsOperations,
AscOperationsOperations,
AscUsagesOperations,
CachesOperations,
Operations,
SkusOperations,
StorageCacheManagementClientOperationsMixin,
StorageTargetOperations,
StorageTargetsOperations,
UsageModelsOperations,
Expand All @@ -31,11 +33,15 @@
from azure.core.credentials_async import AsyncTokenCredential


class StorageCacheManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""A Storage Cache provides scalable caching service for NAS clients, serving data from either
NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to
manage Caches.
class StorageCacheManagementClient(
StorageCacheManagementClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""Azure Managed Lustre provides a fully managed Lustre® file system, integrated with Blob
storage, for use on demand. These operations create and manage Azure Managed Lustre file
systems.

:ivar aml_filesystems: AmlFilesystemsOperations operations
:vartype aml_filesystems: azure.mgmt.storagecache.aio.operations.AmlFilesystemsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.storagecache.aio.operations.Operations
:ivar skus: SkusOperations operations
Expand All @@ -54,12 +60,11 @@ class StorageCacheManagementClient: # pylint: disable=client-accepts-api-versio
:vartype storage_target: azure.mgmt.storagecache.aio.operations.StorageTargetOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand All @@ -76,12 +81,13 @@ def __init__(
self._config = StorageCacheManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.aml_filesystems = AmlFilesystemsOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize)
self.usage_models = UsageModelsOperations(self._client, self._config, self._serialize, self._deserialize)
Expand Down Expand Up @@ -120,5 +126,5 @@ async def __aenter__(self) -> "StorageCacheManagementClient":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# --------------------------------------------------------------------------
# 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 abc import ABC
from typing import TYPE_CHECKING

from azure.core.pipeline.transport import HttpRequest

from ._configuration import StorageCacheManagementClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient

from .._serialization import Deserializer, Serializer


class StorageCacheManagementClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""

_client: "AsyncPipelineClient"
_config: StorageCacheManagementClientConfiguration
_serialize: "Serializer"
_deserialize: "Deserializer"
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._aml_filesystems_operations import AmlFilesystemsOperations
from ._storage_cache_management_client_operations import StorageCacheManagementClientOperationsMixin
from ._operations import Operations
from ._skus_operations import SkusOperations
from ._usage_models_operations import UsageModelsOperations
Expand All @@ -20,6 +22,8 @@
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"AmlFilesystemsOperations",
"StorageCacheManagementClientOperationsMixin",
"Operations",
"SkusOperations",
"UsageModelsOperations",
Expand Down
Loading