Skip to content

Commit

Permalink
Generated from 0e5a9dba02e521c7f89a7364a3560cfee8c4f9ec
Browse files Browse the repository at this point in the history
  • Loading branch information
SDK Automation committed Oct 22, 2020
1 parent aba3bcf commit a150b8d
Show file tree
Hide file tree
Showing 21 changed files with 1,062 additions and 353 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .operations import Operations
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from .operations import KeyValuesOperations
from . import models


Expand All @@ -36,6 +37,8 @@ class AppConfigurationManagementClient(object):
:vartype private_endpoint_connections: app_configuration_management_client.operations.PrivateEndpointConnectionsOperations
:ivar private_link_resources: PrivateLinkResourcesOperations operations
:vartype private_link_resources: app_configuration_management_client.operations.PrivateLinkResourcesOperations
:ivar key_values: KeyValuesOperations operations
:vartype key_values: app_configuration_management_client.operations.KeyValuesOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Microsoft Azure subscription ID.
Expand All @@ -59,7 +62,6 @@ def __init__(

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)

self.configuration_stores = ConfigurationStoresOperations(
Expand All @@ -70,6 +72,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.private_link_resources = PrivateLinkResourcesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.key_values = KeyValuesOperations(
self._client, self._config, self._serialize, self._deserialize)

def close(self):
# type: () -> None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-06-01"
self.api_version = "2020-07-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-appconfiguration/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"chosen_version": "2019-11-01-preview",
"total_api_version_list": ["2019-11-01-preview"],
"chosen_version": "2020-07-01-preview",
"total_api_version_list": ["2020-07-01-preview"],
"client": {
"name": "AppConfigurationManagementClient",
"filename": "_app_configuration_management_client",
"description": "AppConfigurationManagementClient."
"description": "AppConfigurationManagementClient.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true
},
"global_parameters": {
"sync_method": {
Expand Down Expand Up @@ -41,13 +45,17 @@
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"]
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null
},
"operation_groups": {
"configuration_stores": "ConfigurationStoresOperations",
"operations": "Operations",
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
"private_link_resources": "PrivateLinkResourcesOperations"
"private_link_resources": "PrivateLinkResourcesOperations",
"key_values": "KeyValuesOperations"
},
"operation_mixins": {
},
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.1"
VERSION = "0.1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .operations import Operations
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from .operations import KeyValuesOperations
from .. import models


Expand All @@ -34,6 +35,8 @@ class AppConfigurationManagementClient(object):
:vartype private_endpoint_connections: app_configuration_management_client.aio.operations.PrivateEndpointConnectionsOperations
:ivar private_link_resources: PrivateLinkResourcesOperations operations
:vartype private_link_resources: app_configuration_management_client.aio.operations.PrivateLinkResourcesOperations
:ivar key_values: KeyValuesOperations operations
:vartype key_values: app_configuration_management_client.aio.operations.KeyValuesOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Microsoft Azure subscription ID.
Expand All @@ -56,7 +59,6 @@ def __init__(

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)

self.configuration_stores = ConfigurationStoresOperations(
Expand All @@ -67,6 +69,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.private_link_resources = PrivateLinkResourcesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.key_values = KeyValuesOperations(
self._client, self._config, self._serialize, self._deserialize)

async def close(self) -> None:
await self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-06-01"
self.api_version = "2020-07-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-appconfiguration/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
from ._operations import Operations
from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
from ._private_link_resources_operations import PrivateLinkResourcesOperations
from ._key_values_operations import KeyValuesOperations

__all__ = [
'ConfigurationStoresOperations',
'Operations',
'PrivateEndpointConnectionsOperations',
'PrivateLinkResourcesOperations',
'KeyValuesOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def list(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
api_version = "2020-07-01-preview"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down Expand Up @@ -107,7 +107,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.Error, response)
error = self._deserialize(models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -144,7 +144,7 @@ def list_by_resource_group(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
api_version = "2020-07-01-preview"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down Expand Up @@ -187,7 +187,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.Error, response)
error = self._deserialize(models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -221,7 +221,7 @@ async def get(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
api_version = "2020-07-01-preview"
accept = "application/json"

# Construct URL
Expand All @@ -247,7 +247,7 @@ async def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.Error, response)
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ConfigurationStore', pipeline_response)
Expand All @@ -270,7 +270,7 @@ async def _create_initial(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
api_version = "2020-07-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

Expand Down Expand Up @@ -301,7 +301,7 @@ async def _create_initial(

if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.Error, response)
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if response.status_code == 200:
Expand Down Expand Up @@ -393,7 +393,7 @@ async def _delete_initial(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
api_version = "2020-07-01-preview"
accept = "application/json"

# Construct URL
Expand All @@ -419,7 +419,7 @@ async def _delete_initial(

if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.Error, response)
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down Expand Up @@ -498,7 +498,7 @@ async def _update_initial(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
api_version = "2020-07-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

Expand Down Expand Up @@ -529,7 +529,7 @@ async def _update_initial(

if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.Error, response)
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if response.status_code == 200:
Expand Down Expand Up @@ -639,7 +639,7 @@ def list_keys(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
api_version = "2020-07-01-preview"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down Expand Up @@ -683,7 +683,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.Error, response)
error = self._deserialize(models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -720,7 +720,7 @@ async def regenerate_key(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
api_version = "2020-07-01-preview"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

Expand Down Expand Up @@ -751,7 +751,7 @@ async def regenerate_key(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.Error, response)
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ApiKey', pipeline_response)
Expand All @@ -761,71 +761,3 @@ async def regenerate_key(

return deserialized
regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey'} # type: ignore

async def list_key_value(
self,
resource_group_name: str,
config_store_name: str,
list_key_value_parameters: "models.ListKeyValueParameters",
**kwargs
) -> "models.KeyValue":
"""Lists a configuration store key-value.
:param resource_group_name: The name of the resource group to which the container registry
belongs.
:type resource_group_name: str
:param config_store_name: The name of the configuration store.
:type config_store_name: str
:param list_key_value_parameters: The parameters for retrieving a key-value.
:type list_key_value_parameters: ~app_configuration_management_client.models.ListKeyValueParameters
:keyword callable cls: A custom type or function that will be passed the direct response
:return: KeyValue, or the result of cls(response)
:rtype: ~app_configuration_management_client.models.KeyValue
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.KeyValue"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

# Construct URL
url = self.list_key_value.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'configStoreName': self._serialize.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'),
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(list_key_value_parameters, 'ListKeyValueParameters')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.Error, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('KeyValue', pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized
list_key_value.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue'} # type: ignore
Loading

0 comments on commit a150b8d

Please sign in to comment.