From 01187079623611733bbe7ed1aaa011697ef14763 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 3 May 2018 22:11:42 +0000 Subject: [PATCH] Generated from b2a473c1f2d0cb2ffc1ba4bee3c836e22b03c0f6 Rename Azure Maps to Maps, and adding examples (#440) * Change Azure Maps to Maps * Azure Maps to Maps * add examples * change file names * add 2018-05-01 * change api-version to 2018-05-01 --- azure-mgmt-maps/azure/mgmt/maps/__init__.py | 18 + .../azure/mgmt/maps/maps_management_client.py | 85 +++ .../azure/mgmt/maps/models/__init__.py | 60 ++ .../azure/mgmt/maps/models/error.py | 63 ++ .../mgmt/maps/models/error_details_item.py | 45 ++ .../maps/models/error_details_item_py3.py | 45 ++ .../azure/mgmt/maps/models/error_py3.py | 63 ++ .../azure/mgmt/maps/models/maps_account.py | 62 ++ .../models/maps_account_create_parameters.py | 47 ++ .../maps_account_create_parameters_py3.py | 47 ++ .../mgmt/maps/models/maps_account_keys.py | 46 ++ .../mgmt/maps/models/maps_account_keys_py3.py | 46 ++ .../mgmt/maps/models/maps_account_paged.py | 27 + .../mgmt/maps/models/maps_account_py3.py | 62 ++ .../models/maps_account_update_parameters.py | 36 + .../maps_account_update_parameters_py3.py | 36 + .../maps/models/maps_accounts_move_request.py | 41 ++ .../models/maps_accounts_move_request_py3.py | 41 ++ .../maps/models/maps_key_specification.py | 35 + .../maps/models/maps_key_specification_py3.py | 35 + .../models/maps_management_client_enums.py | 18 + .../maps/models/maps_operations_value_item.py | 44 ++ .../maps_operations_value_item_display.py | 51 ++ .../maps_operations_value_item_display_py3.py | 51 ++ .../maps_operations_value_item_paged.py | 27 + .../models/maps_operations_value_item_py3.py | 44 ++ .../azure/mgmt/maps/models/resource.py | 46 ++ .../azure/mgmt/maps/models/resource_py3.py | 46 ++ azure-mgmt-maps/azure/mgmt/maps/models/sku.py | 43 ++ .../azure/mgmt/maps/models/sku_py3.py | 43 ++ .../azure/mgmt/maps/operations/__init__.py | 16 + .../maps/operations/accounts_operations.py | 688 ++++++++++++++++++ azure-mgmt-maps/azure/mgmt/maps/version.py | 13 + 33 files changed, 2070 insertions(+) create mode 100644 azure-mgmt-maps/azure/mgmt/maps/__init__.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/maps_management_client.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/__init__.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/error.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/error_details_item.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/error_details_item_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/error_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_account.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_account_create_parameters.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_account_create_parameters_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_account_keys.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_account_keys_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_account_paged.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_account_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_account_update_parameters.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_account_update_parameters_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_accounts_move_request.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_accounts_move_request_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_key_specification.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_key_specification_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_management_client_enums.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_display.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_display_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_paged.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/resource.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/resource_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/sku.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/models/sku_py3.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/operations/__init__.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/operations/accounts_operations.py create mode 100644 azure-mgmt-maps/azure/mgmt/maps/version.py diff --git a/azure-mgmt-maps/azure/mgmt/maps/__init__.py b/azure-mgmt-maps/azure/mgmt/maps/__init__.py new file mode 100644 index 000000000000..0a7916353c17 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/__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 .maps_management_client import MapsManagementClient +from .version import VERSION + +__all__ = ['MapsManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-maps/azure/mgmt/maps/maps_management_client.py b/azure-mgmt-maps/azure/mgmt/maps/maps_management_client.py new file mode 100644 index 000000000000..7cb0af30b5b7 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/maps_management_client.py @@ -0,0 +1,85 @@ +# 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.accounts_operations import AccountsOperations +from . import models + + +class MapsManagementClientConfiguration(AzureConfiguration): + """Configuration for MapsManagementClient + 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: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :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(MapsManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-maps/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class MapsManagementClient(SDKClient): + """Resource Provider + + :ivar config: Configuration for client. + :vartype config: MapsManagementClientConfiguration + + :ivar accounts: Accounts operations + :vartype accounts: azure.mgmt.maps.operations.AccountsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = MapsManagementClientConfiguration(credentials, subscription_id, base_url) + super(MapsManagementClient, 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 = '2018-05-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.accounts = AccountsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/__init__.py b/azure-mgmt-maps/azure/mgmt/maps/models/__init__.py new file mode 100644 index 000000000000..4bdf8309fed0 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/__init__.py @@ -0,0 +1,60 @@ +# 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 .error_details_item_py3 import ErrorDetailsItem + from .error_py3 import Error, ErrorException + from .resource_py3 import Resource + from .sku_py3 import Sku + from .maps_account_py3 import MapsAccount + from .maps_account_create_parameters_py3 import MapsAccountCreateParameters + from .maps_account_update_parameters_py3 import MapsAccountUpdateParameters + from .maps_accounts_move_request_py3 import MapsAccountsMoveRequest + from .maps_key_specification_py3 import MapsKeySpecification + from .maps_account_keys_py3 import MapsAccountKeys + from .maps_operations_value_item_display_py3 import MapsOperationsValueItemDisplay + from .maps_operations_value_item_py3 import MapsOperationsValueItem +except (SyntaxError, ImportError): + from .error_details_item import ErrorDetailsItem + from .error import Error, ErrorException + from .resource import Resource + from .sku import Sku + from .maps_account import MapsAccount + from .maps_account_create_parameters import MapsAccountCreateParameters + from .maps_account_update_parameters import MapsAccountUpdateParameters + from .maps_accounts_move_request import MapsAccountsMoveRequest + from .maps_key_specification import MapsKeySpecification + from .maps_account_keys import MapsAccountKeys + from .maps_operations_value_item_display import MapsOperationsValueItemDisplay + from .maps_operations_value_item import MapsOperationsValueItem +from .maps_account_paged import MapsAccountPaged +from .maps_operations_value_item_paged import MapsOperationsValueItemPaged +from .maps_management_client_enums import ( + KeyType, +) + +__all__ = [ + 'ErrorDetailsItem', + 'Error', 'ErrorException', + 'Resource', + 'Sku', + 'MapsAccount', + 'MapsAccountCreateParameters', + 'MapsAccountUpdateParameters', + 'MapsAccountsMoveRequest', + 'MapsKeySpecification', + 'MapsAccountKeys', + 'MapsOperationsValueItemDisplay', + 'MapsOperationsValueItem', + 'MapsAccountPaged', + 'MapsOperationsValueItemPaged', + 'KeyType', +] diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/error.py b/azure-mgmt-maps/azure/mgmt/maps/models/error.py new file mode 100644 index 000000000000..04c39fcc3a7f --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/error.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 +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """This object is returned when an error occurs in the Maps API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: If available, a human readable description of the error. + :vartype message: str + :ivar target: If available, the component generating the error. + :vartype target: str + :ivar details: If available, a list of additional details about the error. + :vartype details: list[~azure.mgmt.maps.models.ErrorDetailsItem] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsItem]'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = 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-maps/azure/mgmt/maps/models/error_details_item.py b/azure-mgmt-maps/azure/mgmt/maps/models/error_details_item.py new file mode 100644 index 000000000000..56cfb2b7bf18 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/error_details_item.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 + + +class ErrorDetailsItem(Model): + """ErrorDetailsItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: If available, a human readable description of the error. + :vartype message: str + :ivar target: If available, the component generating the error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/error_details_item_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/error_details_item_py3.py new file mode 100644 index 000000000000..104240a2cca2 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/error_details_item_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 + + +class ErrorDetailsItem(Model): + """ErrorDetailsItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: If available, a human readable description of the error. + :vartype message: str + :ivar target: If available, the component generating the error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/error_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/error_py3.py new file mode 100644 index 000000000000..0d9085501f6d --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/error_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 +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """This object is returned when an error occurs in the Maps API. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: If available, a human readable description of the error. + :vartype message: str + :ivar target: If available, the component generating the error. + :vartype target: str + :ivar details: If available, a list of additional details about the error. + :vartype details: list[~azure.mgmt.maps.models.ErrorDetailsItem] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsItem]'}, + } + + def __init__(self, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = 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-maps/azure/mgmt/maps/models/maps_account.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account.py new file mode 100644 index 000000000000..74524c9d67c4 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account.py @@ -0,0 +1,62 @@ +# 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 MapsAccount(Resource): + """An Azure resource which represents access to a suite of Maps REST APIs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified Maps Account resource identifier. + :vartype id: str + :ivar name: The name of the Maps Account, which is unique within a + Resource Group. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :ivar location: The location of the resource. + :vartype location: str + :ivar tags: Gets a list of key value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across + resource groups). A maximum of 15 tags can be provided for a resource. + Each tag must have a key no greater than 128 characters and value no + greater than 256 characters. + :vartype tags: dict[str, str] + :ivar sku: The SKU of this account. + :vartype sku: ~azure.mgmt.maps.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'tags': {'readonly': True}, + 'sku': {'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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(MapsAccount, self).__init__(**kwargs) + self.location = None + self.tags = None + self.sku = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_create_parameters.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_create_parameters.py new file mode 100644 index 000000000000..d3fb8c778d97 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_create_parameters.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 MapsAccountCreateParameters(Model): + """Parameters used to create a new Maps Account. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param sku: Required. The SKU of this account. + :type sku: ~azure.mgmt.maps.models.Sku + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(MapsAccountCreateParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_create_parameters_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_create_parameters_py3.py new file mode 100644 index 000000000000..dc5ec797e649 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_create_parameters_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 MapsAccountCreateParameters(Model): + """Parameters used to create a new Maps Account. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param sku: Required. The SKU of this account. + :type sku: ~azure.mgmt.maps.models.Sku + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str, sku, tags=None, **kwargs) -> None: + super(MapsAccountCreateParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.sku = sku diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_keys.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_keys.py new file mode 100644 index 000000000000..3591827bad7e --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_keys.py @@ -0,0 +1,46 @@ +# 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 MapsAccountKeys(Model): + """The set of keys which can be used to access the Maps REST APIs. Two keys + are provided for key rotation without interruption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The full Azure resource identifier of the Maps Account. + :vartype id: str + :ivar primary_key: The primary key for accessing the Maps REST APIs. + :vartype primary_key: str + :ivar secondary_key: The secondary key for accessing the Maps REST APIs. + :vartype secondary_key: str + """ + + _validation = { + 'id': {'readonly': True}, + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MapsAccountKeys, self).__init__(**kwargs) + self.id = None + self.primary_key = None + self.secondary_key = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_keys_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_keys_py3.py new file mode 100644 index 000000000000..f441c2a3e5e0 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_keys_py3.py @@ -0,0 +1,46 @@ +# 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 MapsAccountKeys(Model): + """The set of keys which can be used to access the Maps REST APIs. Two keys + are provided for key rotation without interruption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The full Azure resource identifier of the Maps Account. + :vartype id: str + :ivar primary_key: The primary key for accessing the Maps REST APIs. + :vartype primary_key: str + :ivar secondary_key: The secondary key for accessing the Maps REST APIs. + :vartype secondary_key: str + """ + + _validation = { + 'id': {'readonly': True}, + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(MapsAccountKeys, self).__init__(**kwargs) + self.id = None + self.primary_key = None + self.secondary_key = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_paged.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_paged.py new file mode 100644 index 000000000000..52861a1b61c0 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_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 MapsAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`MapsAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MapsAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(MapsAccountPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_py3.py new file mode 100644 index 000000000000..96745b19eadc --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_py3.py @@ -0,0 +1,62 @@ +# 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 MapsAccount(Resource): + """An Azure resource which represents access to a suite of Maps REST APIs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified Maps Account resource identifier. + :vartype id: str + :ivar name: The name of the Maps Account, which is unique within a + Resource Group. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :ivar location: The location of the resource. + :vartype location: str + :ivar tags: Gets a list of key value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across + resource groups). A maximum of 15 tags can be provided for a resource. + Each tag must have a key no greater than 128 characters and value no + greater than 256 characters. + :vartype tags: dict[str, str] + :ivar sku: The SKU of this account. + :vartype sku: ~azure.mgmt.maps.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'tags': {'readonly': True}, + 'sku': {'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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs) -> None: + super(MapsAccount, self).__init__(**kwargs) + self.location = None + self.tags = None + self.sku = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_update_parameters.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_update_parameters.py new file mode 100644 index 000000000000..a816f367ced9 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_update_parameters.py @@ -0,0 +1,36 @@ +# 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 MapsAccountUpdateParameters(Model): + """Parameters used to update an existing Maps Account. + + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param sku: The SKU of this account. + :type sku: ~azure.mgmt.maps.models.Sku + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(MapsAccountUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_update_parameters_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_update_parameters_py3.py new file mode 100644 index 000000000000..d51707e686dc --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_account_update_parameters_py3.py @@ -0,0 +1,36 @@ +# 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 MapsAccountUpdateParameters(Model): + """Parameters used to update an existing Maps Account. + + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param sku: The SKU of this account. + :type sku: ~azure.mgmt.maps.models.Sku + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, tags=None, sku=None, **kwargs) -> None: + super(MapsAccountUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.sku = sku diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_accounts_move_request.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_accounts_move_request.py new file mode 100644 index 000000000000..762d321b9910 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_accounts_move_request.py @@ -0,0 +1,41 @@ +# 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 MapsAccountsMoveRequest(Model): + """The description of what resources to move between resource groups. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. The name of the destination + resource group. + :type target_resource_group: str + :param resource_ids: Required. A list of resource names to move from the + source resource group. + :type resource_ids: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resource_ids': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resource_ids': {'key': 'resourceIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(MapsAccountsMoveRequest, self).__init__(**kwargs) + self.target_resource_group = kwargs.get('target_resource_group', None) + self.resource_ids = kwargs.get('resource_ids', None) diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_accounts_move_request_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_accounts_move_request_py3.py new file mode 100644 index 000000000000..c049da9a7ecc --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_accounts_move_request_py3.py @@ -0,0 +1,41 @@ +# 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 MapsAccountsMoveRequest(Model): + """The description of what resources to move between resource groups. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group: Required. The name of the destination + resource group. + :type target_resource_group: str + :param resource_ids: Required. A list of resource names to move from the + source resource group. + :type resource_ids: list[str] + """ + + _validation = { + 'target_resource_group': {'required': True}, + 'resource_ids': {'required': True}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resource_ids': {'key': 'resourceIds', 'type': '[str]'}, + } + + def __init__(self, *, target_resource_group: str, resource_ids, **kwargs) -> None: + super(MapsAccountsMoveRequest, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resource_ids = resource_ids diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_key_specification.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_key_specification.py new file mode 100644 index 000000000000..d07561e9eb3c --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_key_specification.py @@ -0,0 +1,35 @@ +# 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 MapsKeySpecification(Model): + """Whether the operation refers to the primary or secondary key. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. Whether the operation refers to the primary or + secondary key. Possible values include: 'primary', 'secondary' + :type key_type: str or ~azure.mgmt.maps.models.KeyType + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MapsKeySpecification, self).__init__(**kwargs) + self.key_type = kwargs.get('key_type', None) diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_key_specification_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_key_specification_py3.py new file mode 100644 index 000000000000..488c914f0fc4 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_key_specification_py3.py @@ -0,0 +1,35 @@ +# 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 MapsKeySpecification(Model): + """Whether the operation refers to the primary or secondary key. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. Whether the operation refers to the primary or + secondary key. Possible values include: 'primary', 'secondary' + :type key_type: str or ~azure.mgmt.maps.models.KeyType + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, *, key_type, **kwargs) -> None: + super(MapsKeySpecification, self).__init__(**kwargs) + self.key_type = key_type diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_management_client_enums.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_management_client_enums.py new file mode 100644 index 000000000000..6a1a13bc6fa6 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_management_client_enums.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 enum import Enum + + +class KeyType(str, Enum): + + primary = "primary" + secondary = "secondary" diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item.py new file mode 100644 index 000000000000..384178156e6d --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item.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 MapsOperationsValueItem(Model): + """MapsOperationsValueItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The human-readable description of the operation. + :type display: ~azure.mgmt.maps.models.MapsOperationsValueItemDisplay + :ivar origin: The origin of the operation. + :vartype origin: str + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'MapsOperationsValueItemDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MapsOperationsValueItem, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + self.origin = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_display.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_display.py new file mode 100644 index 000000000000..7c8deddee6b8 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_display.py @@ -0,0 +1,51 @@ +# 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 MapsOperationsValueItemDisplay(Model): + """The human-readable description of the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft Maps. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: The action that users can perform, based on their + permission level. + :vartype operation: str + :ivar description: The description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'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(MapsOperationsValueItemDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_display_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_display_py3.py new file mode 100644 index 000000000000..a9adedf283ff --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_display_py3.py @@ -0,0 +1,51 @@ +# 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 MapsOperationsValueItemDisplay(Model): + """The human-readable description of the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft Maps. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: The action that users can perform, based on their + permission level. + :vartype operation: str + :ivar description: The description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'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) -> None: + super(MapsOperationsValueItemDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_paged.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_paged.py new file mode 100644 index 000000000000..3a5af1dc447b --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_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 MapsOperationsValueItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`MapsOperationsValueItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MapsOperationsValueItem]'} + } + + def __init__(self, *args, **kwargs): + + super(MapsOperationsValueItemPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_py3.py new file mode 100644 index 000000000000..f4e0e7cc41f6 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/maps_operations_value_item_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 MapsOperationsValueItem(Model): + """MapsOperationsValueItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The human-readable description of the operation. + :type display: ~azure.mgmt.maps.models.MapsOperationsValueItemDisplay + :ivar origin: The origin of the operation. + :vartype origin: str + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'MapsOperationsValueItemDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(MapsOperationsValueItem, self).__init__(**kwargs) + self.name = None + self.display = display + self.origin = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/resource.py b/azure-mgmt-maps/azure/mgmt/maps/models/resource.py new file mode 100644 index 000000000000..8ae06e8d88ec --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/resource.py @@ -0,0 +1,46 @@ +# 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. + + :ivar id: The fully qualified Maps Account resource identifier. + :vartype id: str + :ivar name: The name of the Maps Account, which is unique within a + Resource Group. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/resource_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/resource_py3.py new file mode 100644 index 000000000000..682516cb7482 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/resource_py3.py @@ -0,0 +1,46 @@ +# 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. + + :ivar id: The fully qualified Maps Account resource identifier. + :vartype id: str + :ivar name: The name of the Maps Account, which is unique within a + Resource Group. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/sku.py b/azure-mgmt-maps/azure/mgmt/maps/models/sku.py new file mode 100644 index 000000000000..5130804d7862 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/sku.py @@ -0,0 +1,43 @@ +# 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 Sku(Model): + """The SKU of the Maps Account. + + 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 of the SKU, in standard format (such as + S0). + :type name: str + :ivar tier: Gets the sku tier. This is based on the SKU name. + :vartype tier: str + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/models/sku_py3.py b/azure-mgmt-maps/azure/mgmt/maps/models/sku_py3.py new file mode 100644 index 000000000000..a5ca7132fb85 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/models/sku_py3.py @@ -0,0 +1,43 @@ +# 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 Sku(Model): + """The SKU of the Maps Account. + + 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 of the SKU, in standard format (such as + S0). + :type name: str + :ivar tier: Gets the sku tier. This is based on the SKU name. + :vartype tier: str + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-maps/azure/mgmt/maps/operations/__init__.py b/azure-mgmt-maps/azure/mgmt/maps/operations/__init__.py new file mode 100644 index 000000000000..4de259788320 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/operations/__init__.py @@ -0,0 +1,16 @@ +# 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 .accounts_operations import AccountsOperations + +__all__ = [ + 'AccountsOperations', +] diff --git a/azure-mgmt-maps/azure/mgmt/maps/operations/accounts_operations.py b/azure-mgmt-maps/azure/mgmt/maps/operations/accounts_operations.py new file mode 100644 index 000000000000..cebc41e84ae6 --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/operations/accounts_operations.py @@ -0,0 +1,688 @@ +# 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 AccountsOperations(object): + """AccountsOperations 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: Client Api Version. Constant value: "2018-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01" + + self.config = config + + def create_or_update( + self, resource_group_name, account_name, maps_account_create_parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a Maps Account. A Maps Account holds the keys which + allow access to the Maps REST APIs. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_name: str + :param account_name: The name of the Maps Account. + :type account_name: str + :param maps_account_create_parameters: The new or updated parameters + for the Maps Account. + :type maps_account_create_parameters: + ~azure.mgmt.maps.models.MapsAccountCreateParameters + :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: MapsAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.maps.models.MapsAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.create_or_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'), + 'accountName': self._serialize.url("account_name", account_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') + + # Construct headers + header_parameters = {} + 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(maps_account_create_parameters, 'MapsAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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('MapsAccount', response) + if response.status_code == 201: + deserialized = self._deserialize('MapsAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}'} + + def update( + self, resource_group_name, account_name, tags=None, sku=None, custom_headers=None, raw=False, **operation_config): + """Updates a Maps Account. Only a subset of the parameters may be updated + after creation, such as Sku and Tags. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_name: str + :param account_name: The name of the Maps Account. + :type account_name: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param sku: The SKU of this account. + :type sku: ~azure.mgmt.maps.models.Sku + :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: MapsAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.maps.models.MapsAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + maps_account_update_parameters = models.MapsAccountUpdateParameters(tags=tags, sku=sku) + + # 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'), + 'accountName': self._serialize.url("account_name", account_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') + + # Construct headers + header_parameters = {} + 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(maps_account_update_parameters, 'MapsAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('MapsAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Delete a Maps Account. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_name: str + :param account_name: The name of the Maps Account. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_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') + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}'} + + def get( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Get a Maps Account. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_name: str + :param account_name: The name of the Maps Account. + :type account_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: MapsAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.maps.models.MapsAccount 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'), + 'accountName': self._serialize.url("account_name", account_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') + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('MapsAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all Maps Accounts in a Resource Group. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_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: An iterator like instance of MapsAccount + :rtype: + ~azure.mgmt.maps.models.MapsAccountPaged[~azure.mgmt.maps.models.MapsAccount] + :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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.MapsAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MapsAccountPaged(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.Maps/accounts'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Get all Maps Accounts in a Subscription. + + :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 MapsAccount + :rtype: + ~azure.mgmt.maps.models.MapsAccountPaged[~azure.mgmt.maps.models.MapsAccount] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.MapsAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MapsAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Maps/accounts'} + + def move( + self, resource_group_name, target_resource_group, resource_ids, custom_headers=None, raw=False, **operation_config): + """Moves Maps Accounts from one ResourceGroup (or Subscription) to + another. + + :param resource_group_name: The name of the resource group that + contains Maps Account to move. + :type resource_group_name: str + :param target_resource_group: The name of the destination resource + group. + :type target_resource_group: str + :param resource_ids: A list of resource names to move from the source + resource group. + :type resource_ids: list[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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + move_request = models.MapsAccountsMoveRequest(target_resource_group=target_resource_group, resource_ids=resource_ids) + + # Construct URL + url = self.move.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') + + # Construct headers + header_parameters = {} + 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(move_request, 'MapsAccountsMoveRequest') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Get the keys to use with the Maps APIs. A key is used to authenticate + and authorize access to the Maps REST APIs. Only one key is needed at a + time; two are given to provide seamless key regeneration. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_name: str + :param account_name: The name of the Maps Account. + :type account_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: MapsAccountKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.maps.models.MapsAccountKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_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') + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('MapsAccountKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/listKeys'} + + def regenerate_keys( + self, resource_group_name, account_name, key_type, custom_headers=None, raw=False, **operation_config): + """Regenerate either the primary or secondary key for use with the Maps + APIs. The old key will stop working immediately. + + :param resource_group_name: The name of the Azure Resource Group. + :type resource_group_name: str + :param account_name: The name of the Maps Account. + :type account_name: str + :param key_type: Whether the operation refers to the primary or + secondary key. Possible values include: 'primary', 'secondary' + :type key_type: str or ~azure.mgmt.maps.models.KeyType + :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: MapsAccountKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.maps.models.MapsAccountKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + key_specification = models.MapsKeySpecification(key_type=key_type) + + # Construct URL + url = self.regenerate_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'), + 'accountName': self._serialize.url("account_name", account_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') + + # Construct headers + header_parameters = {} + 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(key_specification, 'MapsKeySpecification') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('MapsAccountKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/regenerateKey'} + + def list_operations( + self, custom_headers=None, raw=False, **operation_config): + """List operations available for the Maps Resource Provider. + + :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 MapsOperationsValueItem + :rtype: + ~azure.mgmt.maps.models.MapsOperationsValueItemPaged[~azure.mgmt.maps.models.MapsOperationsValueItem] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.MapsOperationsValueItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MapsOperationsValueItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_operations.metadata = {'url': '/providers/Microsoft.Maps/operations'} diff --git a/azure-mgmt-maps/azure/mgmt/maps/version.py b/azure-mgmt-maps/azure/mgmt/maps/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-maps/azure/mgmt/maps/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 = "0.1.0" +