diff --git a/azure-mgmt-appconfiguration/HISTORY.rst b/azure-mgmt-appconfiguration/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-appconfiguration/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-appconfiguration/MANIFEST.in b/azure-mgmt-appconfiguration/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/azure-mgmt-appconfiguration/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-appconfiguration/README.rst b/azure-mgmt-appconfiguration/README.rst new file mode 100644 index 000000000000..87e1e74b3a9e --- /dev/null +++ b/azure-mgmt-appconfiguration/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-appconfiguration%2FREADME.png diff --git a/azure-mgmt-appconfiguration/azure/__init__.py b/azure-mgmt-appconfiguration/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-appconfiguration/azure/mgmt/__init__.py b/azure-mgmt-appconfiguration/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/__init__.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/__init__.py new file mode 100644 index 000000000000..449027590230 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/__init__.py @@ -0,0 +1,18 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .app_configuration_management_client import AppConfigurationManagementClient +from .version import VERSION + +__all__ = ['AppConfigurationManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/app_configuration_management_client.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/app_configuration_management_client.py new file mode 100644 index 000000000000..ba0b87c5b523 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/app_configuration_management_client.py @@ -0,0 +1,86 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.configuration_stores_operations import ConfigurationStoresOperations +from .operations.operations import Operations +from . import models + + +class AppConfigurationManagementClientConfiguration(AzureConfiguration): + """Configuration for AppConfigurationManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Microsoft Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AppConfigurationManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-appconfiguration/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class AppConfigurationManagementClient(SDKClient): + """AppConfigurationManagementClient + + :ivar config: Configuration for client. + :vartype config: AppConfigurationManagementClientConfiguration + + :ivar configuration_stores: ConfigurationStores operations + :vartype configuration_stores: azure.mgmt.appconfiguration.operations.ConfigurationStoresOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.appconfiguration.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Microsoft Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = AppConfigurationManagementClientConfiguration(credentials, subscription_id, base_url) + super(AppConfigurationManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2019-02-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.configuration_stores = ConfigurationStoresOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/__init__.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/__init__.py new file mode 100644 index 000000000000..2dc8bd22eb58 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/__init__.py @@ -0,0 +1,56 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .configuration_store_py3 import ConfigurationStore + from .configuration_store_update_parameters_py3 import ConfigurationStoreUpdateParameters + from .check_name_availability_parameters_py3 import CheckNameAvailabilityParameters + from .name_availability_status_py3 import NameAvailabilityStatus + from .api_key_py3 import ApiKey + from .regenerate_key_parameters_py3 import RegenerateKeyParameters + from .operation_definition_display_py3 import OperationDefinitionDisplay + from .operation_definition_py3 import OperationDefinition + from .error_py3 import Error, ErrorException + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .configuration_store import ConfigurationStore + from .configuration_store_update_parameters import ConfigurationStoreUpdateParameters + from .check_name_availability_parameters import CheckNameAvailabilityParameters + from .name_availability_status import NameAvailabilityStatus + from .api_key import ApiKey + from .regenerate_key_parameters import RegenerateKeyParameters + from .operation_definition_display import OperationDefinitionDisplay + from .operation_definition import OperationDefinition + from .error import Error, ErrorException + from .resource import Resource +from .configuration_store_paged import ConfigurationStorePaged +from .api_key_paged import ApiKeyPaged +from .operation_definition_paged import OperationDefinitionPaged +from .app_configuration_management_client_enums import ( + ProvisioningState, +) + +__all__ = [ + 'ConfigurationStore', + 'ConfigurationStoreUpdateParameters', + 'CheckNameAvailabilityParameters', + 'NameAvailabilityStatus', + 'ApiKey', + 'RegenerateKeyParameters', + 'OperationDefinitionDisplay', + 'OperationDefinition', + 'Error', 'ErrorException', + 'Resource', + 'ConfigurationStorePaged', + 'ApiKeyPaged', + 'OperationDefinitionPaged', + 'ProvisioningState', +] diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/api_key.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/api_key.py new file mode 100644 index 000000000000..a318f3364b62 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/api_key.py @@ -0,0 +1,63 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiKey(Model): + """An API key used for authenticating with a configuration store endpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The key ID. + :vartype id: str + :ivar name: A name for the key describing its usage. + :vartype name: str + :ivar value: The value of the key that is used for authentication + purposes. + :vartype value: str + :ivar connection_string: A connection string that can be used by + supporting clients for authentication. + :vartype connection_string: str + :ivar last_modified: The last time any of the key's properties were + modified. + :vartype last_modified: datetime + :ivar read_only: Whether this key can only be used for read operations. + :vartype read_only: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'value': {'readonly': True}, + 'connection_string': {'readonly': True}, + 'last_modified': {'readonly': True}, + 'read_only': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'read_only': {'key': 'readOnly', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ApiKey, self).__init__(**kwargs) + self.id = None + self.name = None + self.value = None + self.connection_string = None + self.last_modified = None + self.read_only = None diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/api_key_paged.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/api_key_paged.py new file mode 100644 index 000000000000..10bf7dcc1cfd --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/api_key_paged.py @@ -0,0 +1,27 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ApiKeyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApiKey ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApiKey]'} + } + + def __init__(self, *args, **kwargs): + + super(ApiKeyPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/api_key_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/api_key_py3.py new file mode 100644 index 000000000000..3bd854681c65 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/api_key_py3.py @@ -0,0 +1,63 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApiKey(Model): + """An API key used for authenticating with a configuration store endpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The key ID. + :vartype id: str + :ivar name: A name for the key describing its usage. + :vartype name: str + :ivar value: The value of the key that is used for authentication + purposes. + :vartype value: str + :ivar connection_string: A connection string that can be used by + supporting clients for authentication. + :vartype connection_string: str + :ivar last_modified: The last time any of the key's properties were + modified. + :vartype last_modified: datetime + :ivar read_only: Whether this key can only be used for read operations. + :vartype read_only: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'value': {'readonly': True}, + 'connection_string': {'readonly': True}, + 'last_modified': {'readonly': True}, + 'read_only': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'read_only': {'key': 'readOnly', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(ApiKey, self).__init__(**kwargs) + self.id = None + self.name = None + self.value = None + self.connection_string = None + self.last_modified = None + self.read_only = None diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/app_configuration_management_client_enums.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/app_configuration_management_client_enums.py new file mode 100644 index 000000000000..80a15a30e757 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/app_configuration_management_client_enums.py @@ -0,0 +1,22 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/check_name_availability_parameters.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/check_name_availability_parameters.py new file mode 100644 index 000000000000..0ebf6b9d2cdc --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/check_name_availability_parameters.py @@ -0,0 +1,44 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityParameters(Model): + """Parameters used for checking whether a resource name is available. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name to check for availability. + :type name: str + :ivar type: Required. The resource type to check for name availability. + Default value: "Microsoft.AppConfiguration/configurationStores" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.AppConfiguration/configurationStores" + + def __init__(self, **kwargs): + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/check_name_availability_parameters_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..70d0c1f6741f --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/check_name_availability_parameters_py3.py @@ -0,0 +1,44 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityParameters(Model): + """Parameters used for checking whether a resource name is available. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name to check for availability. + :type name: str + :ivar type: Required. The resource type to check for name availability. + Default value: "Microsoft.AppConfiguration/configurationStores" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.AppConfiguration/configurationStores" + + def __init__(self, *, name: str, **kwargs) -> None: + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store.py new file mode 100644 index 000000000000..5a885e4645c3 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store.py @@ -0,0 +1,72 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ConfigurationStore(Resource): + """The configuration store along with all resource properties. The + Configuration Store will have all information to begin utilizing it. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the configuration + store. Possible values include: 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.appconfiguration.models.ProvisioningState + :ivar creation_date: The creation date of configuration store. + :vartype creation_date: datetime + :ivar endpoint: The DNS endpoint where the configuration store API will be + available. + :vartype endpoint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'endpoint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConfigurationStore, self).__init__(**kwargs) + self.provisioning_state = None + self.creation_date = None + self.endpoint = None diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_paged.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_paged.py new file mode 100644 index 000000000000..452a93641b7e --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_paged.py @@ -0,0 +1,27 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ConfigurationStorePaged(Paged): + """ + A paging container for iterating over a list of :class:`ConfigurationStore ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConfigurationStore]'} + } + + def __init__(self, *args, **kwargs): + + super(ConfigurationStorePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_py3.py new file mode 100644 index 000000000000..62bd525f4d44 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_py3.py @@ -0,0 +1,72 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ConfigurationStore(Resource): + """The configuration store along with all resource properties. The + Configuration Store will have all information to begin utilizing it. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the configuration + store. Possible values include: 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.appconfiguration.models.ProvisioningState + :ivar creation_date: The creation date of configuration store. + :vartype creation_date: datetime + :ivar endpoint: The DNS endpoint where the configuration store API will be + available. + :vartype endpoint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'endpoint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(ConfigurationStore, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.creation_date = None + self.endpoint = None diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_update_parameters.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_update_parameters.py new file mode 100644 index 000000000000..39ad0bab0887 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_update_parameters.py @@ -0,0 +1,32 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConfigurationStoreUpdateParameters(Model): + """The parameters for updating a configuration store. + + :param properties: The properties for updating a configuration store. + :type properties: object + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ConfigurationStoreUpdateParameters, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_update_parameters_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_update_parameters_py3.py new file mode 100644 index 000000000000..c302917e9039 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/configuration_store_update_parameters_py3.py @@ -0,0 +1,32 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConfigurationStoreUpdateParameters(Model): + """The parameters for updating a configuration store. + + :param properties: The properties for updating a configuration store. + :type properties: object + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'object'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, properties=None, tags=None, **kwargs) -> None: + super(ConfigurationStoreUpdateParameters, self).__init__(**kwargs) + self.properties = properties + self.tags = tags diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/error.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/error.py new file mode 100644 index 000000000000..ba1f6e0bd33f --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/error.py @@ -0,0 +1,45 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """AppConfiguration error object. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/error_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/error_py3.py new file mode 100644 index 000000000000..360900b4b336 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/error_py3.py @@ -0,0 +1,45 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """AppConfiguration error object. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/name_availability_status.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/name_availability_status.py new file mode 100644 index 000000000000..f166a00c5bcc --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/name_availability_status.py @@ -0,0 +1,47 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NameAvailabilityStatus(Model): + """The result of a request to check the availability of a resource name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: The value indicating whether the resource name is + available. + :vartype name_available: bool + :ivar message: If any, the error message that provides more detail for the + reason that the name is not available. + :vartype message: str + :ivar reason: If any, the reason that the name is not available. + :vartype reason: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'message': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailabilityStatus, self).__init__(**kwargs) + self.name_available = None + self.message = None + self.reason = None diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/name_availability_status_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/name_availability_status_py3.py new file mode 100644 index 000000000000..5d76fad855b3 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/name_availability_status_py3.py @@ -0,0 +1,47 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NameAvailabilityStatus(Model): + """The result of a request to check the availability of a resource name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: The value indicating whether the resource name is + available. + :vartype name_available: bool + :ivar message: If any, the error message that provides more detail for the + reason that the name is not available. + :vartype message: str + :ivar reason: If any, the reason that the name is not available. + :vartype reason: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'message': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(NameAvailabilityStatus, self).__init__(**kwargs) + self.name_available = None + self.message = None + self.reason = None diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition.py new file mode 100644 index 000000000000..833c42beed20 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition.py @@ -0,0 +1,34 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """The definition of a configuration store operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The display information for the configuration store + operation. + :type display: + ~azure.mgmt.appconfiguration.models.OperationDefinitionDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDefinitionDisplay'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_display.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_display.py new file mode 100644 index 000000000000..f576816a8fba --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_display.py @@ -0,0 +1,47 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinitionDisplay(Model): + """The display information for a configuration store operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The resource provider name: Microsoft App Configuration." + :vartype provider: str + :param resource: The resource on which the operation is performed. + :type resource: str + :param operation: The operation that users can perform. + :type operation: str + :param description: The description for the operation. + :type description: str + """ + + _validation = { + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDefinitionDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_display_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_display_py3.py new file mode 100644 index 000000000000..25565855ab54 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_display_py3.py @@ -0,0 +1,47 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinitionDisplay(Model): + """The display information for a configuration store operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The resource provider name: Microsoft App Configuration." + :vartype provider: str + :param resource: The resource on which the operation is performed. + :type resource: str + :param operation: The operation that users can perform. + :type operation: str + :param description: The description for the operation. + :type description: str + """ + + _validation = { + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDefinitionDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_paged.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_paged.py new file mode 100644 index 000000000000..712e39158604 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_paged.py @@ -0,0 +1,27 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_py3.py new file mode 100644 index 000000000000..d119da7c0101 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/operation_definition_py3.py @@ -0,0 +1,34 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """The definition of a configuration store operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The display information for the configuration store + operation. + :type display: + ~azure.mgmt.appconfiguration.models.OperationDefinitionDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDefinitionDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/regenerate_key_parameters.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/regenerate_key_parameters.py new file mode 100644 index 000000000000..68d37ffaeed5 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/regenerate_key_parameters.py @@ -0,0 +1,28 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegenerateKeyParameters(Model): + """The parameters used to regenerate an API key. + + :param id: The id of the key to regenerate. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegenerateKeyParameters, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/regenerate_key_parameters_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..918a755ba279 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/regenerate_key_parameters_py3.py @@ -0,0 +1,28 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegenerateKeyParameters(Model): + """The parameters used to regenerate an API key. + + :param id: The id of the key to regenerate. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(RegenerateKeyParameters, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/resource.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/resource.py new file mode 100644 index 000000000000..3965a6f0cf40 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/resource.py @@ -0,0 +1,57 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/resource_py3.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/resource_py3.py new file mode 100644 index 000000000000..3a1d4bc4edd1 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/resource_py3.py @@ -0,0 +1,57 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/__init__.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/__init__.py new file mode 100644 index 000000000000..3107e2537944 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/__init__.py @@ -0,0 +1,18 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .configuration_stores_operations import ConfigurationStoresOperations +from .operations import Operations + +__all__ = [ + 'ConfigurationStoresOperations', + 'Operations', +] diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/configuration_stores_operations.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/configuration_stores_operations.py new file mode 100644 index 000000000000..09aa3b7f8746 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/configuration_stores_operations.py @@ -0,0 +1,689 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ConfigurationStoresOperations(object): + """ConfigurationStoresOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2019-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-01-preview" + + self.config = config + + def list( + self, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Lists the configuration stores for a given subscription. + + :param skip_token: A skip token is used to continue retrieving items + after an operation returns a partial result. If a previous response + contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use + for subsequent calls. + :type skip_token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConfigurationStore + :rtype: + ~azure.mgmt.appconfiguration.models.ConfigurationStorePaged[~azure.mgmt.appconfiguration.models.ConfigurationStore] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConfigurationStorePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConfigurationStorePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores'} + + def list_by_resource_group( + self, resource_group_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Lists the configuration stores for a given resource group. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param skip_token: A skip token is used to continue retrieving items + after an operation returns a partial result. If a previous response + contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use + for subsequent calls. + :type skip_token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConfigurationStore + :rtype: + ~azure.mgmt.appconfiguration.models.ConfigurationStorePaged[~azure.mgmt.appconfiguration.models.ConfigurationStore] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + 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') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConfigurationStorePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConfigurationStorePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores'} + + def get( + self, resource_group_name, config_store_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of the specified configuration store. + + :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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConfigurationStore or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appconfiguration.models.ConfigurationStore or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationStore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} + + + def _create_initial( + self, resource_group_name, config_store_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + config_store_creation_parameters = models.ConfigurationStore(location=location, tags=tags) + + # Construct URL + url = self.create.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(config_store_creation_parameters, 'ConfigurationStore') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationStore', response) + if response.status_code == 201: + deserialized = self._deserialize('ConfigurationStore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, config_store_name, location, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a configuration store with the specified parameters. + + :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 location: The location of the resource. This cannot be changed + after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConfigurationStore or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appconfiguration.models.ConfigurationStore] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appconfiguration.models.ConfigurationStore]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + config_store_name=config_store_name, + location=location, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigurationStore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} + + + def _delete_initial( + self, resource_group_name, config_store_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, config_store_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a configuration store. + + :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 dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + config_store_name=config_store_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} + + + def _update_initial( + self, resource_group_name, config_store_name, properties=None, tags=None, custom_headers=None, raw=False, **operation_config): + config_store_update_parameters = models.ConfigurationStoreUpdateParameters(properties=properties, tags=tags) + + # Construct URL + url = self.update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(config_store_update_parameters, 'ConfigurationStoreUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationStore', response) + if response.status_code == 201: + deserialized = self._deserialize('ConfigurationStore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, config_store_name, properties=None, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a configuration store with the specified parameters. + + :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 properties: The properties for updating a configuration store. + :type properties: object + :param tags: The ARM resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConfigurationStore or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appconfiguration.models.ConfigurationStore] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appconfiguration.models.ConfigurationStore]] + :raises: + :class:`ErrorException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + config_store_name=config_store_name, + properties=properties, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigurationStore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'} + + def list_keys( + self, resource_group_name, config_store_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Lists the access key for the specified configuration store. + + :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 skip_token: A skip token is used to continue retrieving items + after an operation returns a partial result. If a previous response + contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use + for subsequent calls. + :type skip_token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApiKey + :rtype: + ~azure.mgmt.appconfiguration.models.ApiKeyPaged[~azure.mgmt.appconfiguration.models.ApiKey] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_keys.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ApiKeyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApiKeyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/ListKeys'} + + def regenerate_key( + self, resource_group_name, config_store_name, id=None, custom_headers=None, raw=False, **operation_config): + """Regenerates an access key for the specified configuration store. + + :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 id: The id of the key to regenerate. + :type id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiKey or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appconfiguration.models.ApiKey or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + regenerate_key_parameters = models.RegenerateKeyParameters(id=id) + + # Construct URL + url = self.regenerate_key.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(regenerate_key_parameters, 'RegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApiKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey'} diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/operations.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/operations.py new file mode 100644 index 000000000000..aad67c703641 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/operations.py @@ -0,0 +1,167 @@ +# 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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2019-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-01-preview" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks whether the configuration store name is available for use. + + :param name: The name to check for availability. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NameAvailabilityStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appconfiguration.models.NameAvailabilityStatus or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + check_name_availability_parameters = models.CheckNameAvailabilityParameters(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(check_name_availability_parameters, 'CheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NameAvailabilityStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability'} + + def list( + self, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Lists the operations available from this provider. + + :param skip_token: A skip token is used to continue retrieving items + after an operation returns a partial result. If a previous response + contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use + for subsequent calls. + :type skip_token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OperationDefinition + :rtype: + ~azure.mgmt.appconfiguration.models.OperationDefinitionPaged[~azure.mgmt.appconfiguration.models.OperationDefinition] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.AppConfiguration/operations'} diff --git a/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/version.py b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/version.py new file mode 100644 index 000000000000..53c4c7ea05e8 --- /dev/null +++ b/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/version.py @@ -0,0 +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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2.0.0" + diff --git a/azure-mgmt-appconfiguration/sdk_packaging.toml b/azure-mgmt-appconfiguration/sdk_packaging.toml new file mode 100644 index 000000000000..4419b32942df --- /dev/null +++ b/azure-mgmt-appconfiguration/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-appconfiguration" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-appconfiguration/setup.cfg b/azure-mgmt-appconfiguration/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-appconfiguration/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-appconfiguration/setup.py b/azure-mgmt-appconfiguration/setup.py new file mode 100644 index 000000000000..01496b11b0e5 --- /dev/null +++ b/azure-mgmt-appconfiguration/setup.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-appconfiguration" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)