Skip to content

Commit

Permalink
CodeGen from PR 12829 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.Cache to add version stable/2021-03-01 (Azure#12829)

* Adds base for updating Microsoft.Cache from version preview/2020-10-01-preview to version 2021-03-01

* Updates readme

* Updates API version in new specs and examples

* Add support for persistence and fix other typos

* Fix SDK Warning: R2063 OperationIdNounConflictingModelNames

* Fix spellcheck error

* Fix acronym capitalization in descriptions

* Replace local parameters with common-types parameters

* Use naming convention consistent with Azure documentation

* Update word choice, remove deprecated x-ms-code-generation-setting, and fix operationId

* Add x-ms-secret extension and make TLS version a string enum

* Suppress errors about secrets being sent in responses
  • Loading branch information
SDKAuto committed Feb 22, 2021
1 parent 6fd75b3 commit 22d8710
Show file tree
Hide file tree
Showing 26 changed files with 401 additions and 276 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._redis_enterprise import RedisEnterprise
from ._redis_enterprise_management_client import RedisEnterpriseManagementClient
from ._version import VERSION

__version__ = VERSION
__all__ = ['RedisEnterprise']
__all__ = ['RedisEnterpriseManagementClient']

try:
from ._patch import patch_sdk # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
from azure.core.credentials import TokenCredential


class RedisEnterpriseConfiguration(Configuration):
"""Configuration for RedisEnterprise.
class RedisEnterpriseManagementClientConfiguration(Configuration):
"""Configuration for RedisEnterpriseManagementClient.
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.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -44,11 +44,11 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(RedisEnterpriseConfiguration, self).__init__(**kwargs)
super(RedisEnterpriseManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-10-01-preview"
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-redisenterprise/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"chosen_version": "2020-10-01-preview",
"total_api_version_list": ["2020-10-01-preview"],
"chosen_version": "2021-03-01",
"total_api_version_list": ["2021-03-01"],
"client": {
"name": "RedisEnterprise",
"filename": "_redis_enterprise",
"name": "RedisEnterpriseManagementClient",
"filename": "_redis_enterprise_management_client",
"description": "REST API for managing Redis Enterprise resources in Azure.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
Expand All @@ -21,7 +21,7 @@
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand All @@ -35,7 +35,7 @@
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand All @@ -53,7 +53,7 @@
},
"operation_groups": {
"operations": "Operations",
"get": "GetOperations",
"operations_status": "OperationsStatusOperations",
"redis_enterprise": "RedisEnterpriseOperations",
"databases": "DatabasesOperations",
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@

from azure.core.credentials import TokenCredential

from ._configuration import RedisEnterpriseConfiguration
from ._configuration import RedisEnterpriseManagementClientConfiguration
from .operations import Operations
from .operations import GetOperations
from .operations import OperationsStatusOperations
from .operations import RedisEnterpriseOperations
from .operations import DatabasesOperations
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from . import models


class RedisEnterprise(object):
class RedisEnterpriseManagementClient(object):
"""REST API for managing Redis Enterprise resources in Azure.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redisenterprise.operations.Operations
:ivar get: GetOperations operations
:vartype get: azure.mgmt.redisenterprise.operations.GetOperations
:ivar operations_status: OperationsStatusOperations operations
:vartype operations_status: azure.mgmt.redisenterprise.operations.OperationsStatusOperations
:ivar redis_enterprise: RedisEnterpriseOperations operations
:vartype redis_enterprise: azure.mgmt.redisenterprise.operations.RedisEnterpriseOperations
:ivar databases: DatabasesOperations operations
Expand All @@ -44,7 +44,7 @@ class RedisEnterprise(object):
:vartype private_link_resources: azure.mgmt.redisenterprise.operations.PrivateLinkResourcesOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand All @@ -60,7 +60,7 @@ def __init__(
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = RedisEnterpriseConfiguration(credential, subscription_id, **kwargs)
self._config = RedisEnterpriseManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand All @@ -69,7 +69,7 @@ def __init__(

self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.get = GetOperations(
self.operations_status = OperationsStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.redis_enterprise = RedisEnterpriseOperations(
self._client, self._config, self._serialize, self._deserialize)
Expand All @@ -85,7 +85,7 @@ def close(self):
self._client.close()

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

Expand Down
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.0.0b1"
VERSION = "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._redis_enterprise import RedisEnterprise
__all__ = ['RedisEnterprise']
from ._redis_enterprise_management_client import RedisEnterpriseManagementClient
__all__ = ['RedisEnterpriseManagementClient']
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
from azure.core.credentials_async import AsyncTokenCredential


class RedisEnterpriseConfiguration(Configuration):
"""Configuration for RedisEnterprise.
class RedisEnterpriseManagementClientConfiguration(Configuration):
"""Configuration for RedisEnterpriseManagementClient.
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.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -41,11 +41,11 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(RedisEnterpriseConfiguration, self).__init__(**kwargs)
super(RedisEnterpriseManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-10-01-preview"
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-redisenterprise/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import RedisEnterpriseConfiguration
from ._configuration import RedisEnterpriseManagementClientConfiguration
from .operations import Operations
from .operations import GetOperations
from .operations import OperationsStatusOperations
from .operations import RedisEnterpriseOperations
from .operations import DatabasesOperations
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from .. import models


class RedisEnterprise(object):
class RedisEnterpriseManagementClient(object):
"""REST API for managing Redis Enterprise resources in Azure.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redisenterprise.aio.operations.Operations
:ivar get: GetOperations operations
:vartype get: azure.mgmt.redisenterprise.aio.operations.GetOperations
:ivar operations_status: OperationsStatusOperations operations
:vartype operations_status: azure.mgmt.redisenterprise.aio.operations.OperationsStatusOperations
:ivar redis_enterprise: RedisEnterpriseOperations operations
:vartype redis_enterprise: azure.mgmt.redisenterprise.aio.operations.RedisEnterpriseOperations
:ivar databases: DatabasesOperations operations
Expand All @@ -42,7 +42,7 @@ class RedisEnterprise(object):
:vartype private_link_resources: azure.mgmt.redisenterprise.aio.operations.PrivateLinkResourcesOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand All @@ -57,7 +57,7 @@ def __init__(
) -> None:
if not base_url:
base_url = 'https://management.azure.com'
self._config = RedisEnterpriseConfiguration(credential, subscription_id, **kwargs)
self._config = RedisEnterpriseManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand All @@ -66,7 +66,7 @@ def __init__(

self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.get = GetOperations(
self.operations_status = OperationsStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.redis_enterprise = RedisEnterpriseOperations(
self._client, self._config, self._serialize, self._deserialize)
Expand All @@ -80,7 +80,7 @@ def __init__(
async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "RedisEnterprise":
async def __aenter__(self) -> "RedisEnterpriseManagementClient":
await self._client.__aenter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
# --------------------------------------------------------------------------

from ._operations import Operations
from ._get_operations import GetOperations
from ._operations_status_operations import OperationsStatusOperations
from ._redis_enterprise_operations import RedisEnterpriseOperations
from ._databases_operations import DatabasesOperations
from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
from ._private_link_resources_operations import PrivateLinkResourcesOperations

__all__ = [
'Operations',
'GetOperations',
'OperationsStatusOperations',
'RedisEnterpriseOperations',
'DatabasesOperations',
'PrivateEndpointConnectionsOperations',
Expand Down
Loading

0 comments on commit 22d8710

Please sign in to comment.