From a50a1ce2e448d0d5ff71d3aa385db0d3fa60c958 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 30 Jan 2021 03:00:29 +0000 Subject: [PATCH] CodeGen from PR 12488 in Azure/azure-rest-api-specs Merge 4e39234f970fd480cf8c400042853145678ca627 into 138759b8a5987252fd66658078907e1d93969c85 --- .../azure/mgmt/managementgroups/__init__.py | 7 +- .../mgmt/managementgroups/_configuration.py | 43 + .../_management_groups_api.py | 70 + .../mgmt/managementgroups/models/__init__.py | 155 ++- ...ums.py => _management_groups_api_enums.py} | 2 +- .../mgmt/managementgroups/models/_models.py | 1185 +++++++++++++++++ .../managementgroups/models/_models_py3.py | 1185 +++++++++++++++++ .../managementgroups/models/_paged_models.py | 79 ++ .../models/check_name_availability_request.py | 34 - .../check_name_availability_request_py3.py | 34 - .../models/check_name_availability_result.py | 55 - .../check_name_availability_result_py3.py | 55 - .../create_management_group_child_info.py | 67 - .../create_management_group_child_info_py3.py | 67 - .../models/create_management_group_details.py | 50 - .../create_management_group_details_py3.py | 50 - .../models/create_management_group_request.py | 74 - .../create_management_group_request_py3.py | 74 - .../models/create_parent_group_info.py | 46 - .../models/create_parent_group_info_py3.py | 46 - .../models/entity_hierarchy_item.py | 62 - .../models/entity_hierarchy_item_py3.py | 62 - .../managementgroups/models/entity_info.py | 98 -- .../models/entity_info_paged.py | 27 - .../models/entity_info_py3.py | 98 -- .../models/entity_parent_group_info.py | 30 - .../models/entity_parent_group_info_py3.py | 30 - .../managementgroups/models/error_details.py | 36 - .../models/error_details_py3.py | 36 - .../managementgroups/models/error_response.py | 41 - .../models/error_response_py3.py | 41 - .../models/management_group.py | 70 - .../models/management_group_child_info.py | 55 - .../models/management_group_child_info_py3.py | 55 - .../models/management_group_details.py | 41 - .../models/management_group_details_py3.py | 41 - .../models/management_group_info.py | 57 - .../models/management_group_info_paged.py | 27 - .../models/management_group_info_py3.py | 57 - .../models/management_group_py3.py | 70 - .../mgmt/managementgroups/models/operation.py | 40 - .../models/operation_display_properties.py | 50 - .../operation_display_properties_py3.py | 50 - .../models/operation_paged.py | 27 - .../managementgroups/models/operation_py3.py | 40 - .../models/operation_results.py | 53 - .../models/operation_results_py3.py | 53 - .../models/parent_group_info.py | 38 - .../models/parent_group_info_py3.py | 38 - .../models/patch_management_group_request.py | 34 - .../patch_management_group_request_py3.py | 34 - .../models/tenant_backfill_status_result.py | 43 - .../tenant_backfill_status_result_py3.py | 43 - .../managementgroups/operations/__init__.py | 12 +- ..._operations.py => _entities_operations.py} | 60 +- .../_hierarchy_settings_operations.py | 335 +++++ ...nagement_group_subscriptions_operations.py | 308 +++++ .../_management_groups_api_operations.py} | 81 +- ...ns.py => _management_groups_operations.py} | 171 ++- .../{operations.py => _operations.py} | 20 +- ...nagement_group_subscriptions_operations.py | 149 --- 61 files changed, 3505 insertions(+), 2586 deletions(-) create mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/_configuration.py create mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/_management_groups_api.py rename sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/{management_groups_api_enums.py => _management_groups_api_enums.py} (88%) create mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_models.py create mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_models_py3.py create mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_paged_models.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_request.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_request_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_result.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_result_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_child_info.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_child_info_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_details.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_details_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_request.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_request_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_parent_group_info.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_parent_group_info_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_hierarchy_item.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_hierarchy_item_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info_paged.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_parent_group_info.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_parent_group_info_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_details.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_details_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_response.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_response_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_child_info.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_child_info_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_details.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_details_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info_paged.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_display_properties.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_display_properties_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_paged.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_results.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_results_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/parent_group_info.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/parent_group_info_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/patch_management_group_request.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/patch_management_group_request_py3.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/tenant_backfill_status_result.py delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/tenant_backfill_status_result_py3.py rename sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/{entities_operations.py => _entities_operations.py} (77%) create mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_hierarchy_settings_operations.py create mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_group_subscriptions_operations.py rename sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/{management_groups_api.py => operations/_management_groups_api_operations.py} (68%) rename sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/{management_groups_operations.py => _management_groups_operations.py} (75%) rename sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/{operations.py => _operations.py} (88%) delete mode 100644 sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/management_group_subscriptions_operations.py diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/__init__.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/__init__.py index 1c163d514465..7d52f13aa196 100644 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/__init__.py +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .management_groups_api import ManagementGroupsAPI -from .version import VERSION +from ._configuration import ManagementGroupsAPIConfiguration +from ._management_groups_api import ManagementGroupsAPI +__all__ = ['ManagementGroupsAPI', 'ManagementGroupsAPIConfiguration'] -__all__ = ['ManagementGroupsAPI'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/_configuration.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/_configuration.py new file mode 100644 index 000000000000..607d412c087a --- /dev/null +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/_configuration.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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class ManagementGroupsAPIConfiguration(AzureConfiguration): + """Configuration for ManagementGroupsAPI + 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 str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(ManagementGroupsAPIConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-managementgroups/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/_management_groups_api.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/_management_groups_api.py new file mode 100644 index 000000000000..97f1dc60bfca --- /dev/null +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/_management_groups_api.py @@ -0,0 +1,70 @@ +# 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 ._configuration import ManagementGroupsAPIConfiguration +from .operations import ManagementGroupsAPIOperationsMixin +from .operations import ManagementGroupsOperations +from .operations import ManagementGroupSubscriptionsOperations +from .operations import HierarchySettingsOperations +from .operations import Operations +from .operations import EntitiesOperations +from . import models + + +class ManagementGroupsAPI(ManagementGroupsAPIOperationsMixin, SDKClient): + """The Azure Management Groups API enables consolidation of multiple + subscriptions/resources into an organizational hierarchy and centrally + manage access control, policies, alerting and reporting for those resources. + + :ivar config: Configuration for client. + :vartype config: ManagementGroupsAPIConfiguration + + :ivar management_groups: ManagementGroups operations + :vartype management_groups: azure.mgmt.managementgroups.operations.ManagementGroupsOperations + :ivar management_group_subscriptions: ManagementGroupSubscriptions operations + :vartype management_group_subscriptions: azure.mgmt.managementgroups.operations.ManagementGroupSubscriptionsOperations + :ivar hierarchy_settings: HierarchySettings operations + :vartype hierarchy_settings: azure.mgmt.managementgroups.operations.HierarchySettingsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.managementgroups.operations.Operations + :ivar entities: Entities operations + :vartype entities: azure.mgmt.managementgroups.operations.EntitiesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = ManagementGroupsAPIConfiguration(credentials, base_url) + super(ManagementGroupsAPI, 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 = '2020-05-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.management_groups = ManagementGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.management_group_subscriptions = ManagementGroupSubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.hierarchy_settings = HierarchySettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.entities = EntitiesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/__init__.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/__init__.py index 72c19c0a5a09..2d5402d781f1 100644 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/__init__.py +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/__init__.py @@ -10,81 +10,112 @@ # -------------------------------------------------------------------------- try: - from .error_details_py3 import ErrorDetails - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .operation_display_properties_py3 import OperationDisplayProperties - from .operation_py3 import Operation - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .tenant_backfill_status_result_py3 import TenantBackfillStatusResult - from .management_group_info_py3 import ManagementGroupInfo - from .parent_group_info_py3 import ParentGroupInfo - from .management_group_details_py3 import ManagementGroupDetails - from .management_group_child_info_py3 import ManagementGroupChildInfo - from .management_group_py3 import ManagementGroup - from .operation_results_py3 import OperationResults - from .entity_parent_group_info_py3 import EntityParentGroupInfo - from .entity_info_py3 import EntityInfo - from .entity_hierarchy_item_py3 import EntityHierarchyItem - from .patch_management_group_request_py3 import PatchManagementGroupRequest - from .create_parent_group_info_py3 import CreateParentGroupInfo - from .create_management_group_details_py3 import CreateManagementGroupDetails - from .create_management_group_child_info_py3 import CreateManagementGroupChildInfo - from .create_management_group_request_py3 import CreateManagementGroupRequest - from .check_name_availability_request_py3 import CheckNameAvailabilityRequest + from ._models_py3 import AzureAsyncOperationResults + from ._models_py3 import CheckNameAvailabilityRequest + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CreateManagementGroupChildInfo + from ._models_py3 import CreateManagementGroupDetails + from ._models_py3 import CreateManagementGroupRequest + from ._models_py3 import CreateOrUpdateSettingsRequest + from ._models_py3 import CreateParentGroupInfo + from ._models_py3 import DescendantInfo + from ._models_py3 import DescendantParentGroupInfo + from ._models_py3 import EntityHierarchyItem + from ._models_py3 import EntityInfo + from ._models_py3 import EntityParentGroupInfo + from ._models_py3 import ErrorDetails + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import HierarchySettings + from ._models_py3 import HierarchySettingsInfo + from ._models_py3 import HierarchySettingsList + from ._models_py3 import ManagementGroup + from ._models_py3 import ManagementGroupChildInfo + from ._models_py3 import ManagementGroupDetails + from ._models_py3 import ManagementGroupInfo + from ._models_py3 import ManagementGroupPathElement + from ._models_py3 import Operation + from ._models_py3 import OperationDisplayProperties + from ._models_py3 import OperationResults + from ._models_py3 import ParentGroupInfo + from ._models_py3 import PatchManagementGroupRequest + from ._models_py3 import SubscriptionUnderManagementGroup + from ._models_py3 import TenantBackfillStatusResult except (SyntaxError, ImportError): - from .error_details import ErrorDetails - from .error_response import ErrorResponse, ErrorResponseException - from .operation_display_properties import OperationDisplayProperties - from .operation import Operation - from .check_name_availability_result import CheckNameAvailabilityResult - from .tenant_backfill_status_result import TenantBackfillStatusResult - from .management_group_info import ManagementGroupInfo - from .parent_group_info import ParentGroupInfo - from .management_group_details import ManagementGroupDetails - from .management_group_child_info import ManagementGroupChildInfo - from .management_group import ManagementGroup - from .operation_results import OperationResults - from .entity_parent_group_info import EntityParentGroupInfo - from .entity_info import EntityInfo - from .entity_hierarchy_item import EntityHierarchyItem - from .patch_management_group_request import PatchManagementGroupRequest - from .create_parent_group_info import CreateParentGroupInfo - from .create_management_group_details import CreateManagementGroupDetails - from .create_management_group_child_info import CreateManagementGroupChildInfo - from .create_management_group_request import CreateManagementGroupRequest - from .check_name_availability_request import CheckNameAvailabilityRequest -from .management_group_info_paged import ManagementGroupInfoPaged -from .operation_paged import OperationPaged -from .entity_info_paged import EntityInfoPaged -from .management_groups_api_enums import ( + from ._models import AzureAsyncOperationResults + from ._models import CheckNameAvailabilityRequest + from ._models import CheckNameAvailabilityResult + from ._models import CreateManagementGroupChildInfo + from ._models import CreateManagementGroupDetails + from ._models import CreateManagementGroupRequest + from ._models import CreateOrUpdateSettingsRequest + from ._models import CreateParentGroupInfo + from ._models import DescendantInfo + from ._models import DescendantParentGroupInfo + from ._models import EntityHierarchyItem + from ._models import EntityInfo + from ._models import EntityParentGroupInfo + from ._models import ErrorDetails + from ._models import ErrorResponse, ErrorResponseException + from ._models import HierarchySettings + from ._models import HierarchySettingsInfo + from ._models import HierarchySettingsList + from ._models import ManagementGroup + from ._models import ManagementGroupChildInfo + from ._models import ManagementGroupDetails + from ._models import ManagementGroupInfo + from ._models import ManagementGroupPathElement + from ._models import Operation + from ._models import OperationDisplayProperties + from ._models import OperationResults + from ._models import ParentGroupInfo + from ._models import PatchManagementGroupRequest + from ._models import SubscriptionUnderManagementGroup + from ._models import TenantBackfillStatusResult +from ._paged_models import DescendantInfoPaged +from ._paged_models import EntityInfoPaged +from ._paged_models import ManagementGroupInfoPaged +from ._paged_models import OperationPaged +from ._paged_models import SubscriptionUnderManagementGroupPaged +from ._management_groups_api_enums import ( Reason, Status, Type, ) __all__ = [ + 'AzureAsyncOperationResults', + 'CheckNameAvailabilityRequest', + 'CheckNameAvailabilityResult', + 'CreateManagementGroupChildInfo', + 'CreateManagementGroupDetails', + 'CreateManagementGroupRequest', + 'CreateOrUpdateSettingsRequest', + 'CreateParentGroupInfo', + 'DescendantInfo', + 'DescendantParentGroupInfo', + 'EntityHierarchyItem', + 'EntityInfo', + 'EntityParentGroupInfo', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', - 'OperationDisplayProperties', - 'Operation', - 'CheckNameAvailabilityResult', - 'TenantBackfillStatusResult', - 'ManagementGroupInfo', - 'ParentGroupInfo', - 'ManagementGroupDetails', - 'ManagementGroupChildInfo', + 'HierarchySettings', + 'HierarchySettingsInfo', + 'HierarchySettingsList', 'ManagementGroup', + 'ManagementGroupChildInfo', + 'ManagementGroupDetails', + 'ManagementGroupInfo', + 'ManagementGroupPathElement', + 'Operation', + 'OperationDisplayProperties', 'OperationResults', - 'EntityParentGroupInfo', - 'EntityInfo', - 'EntityHierarchyItem', + 'ParentGroupInfo', 'PatchManagementGroupRequest', - 'CreateParentGroupInfo', - 'CreateManagementGroupDetails', - 'CreateManagementGroupChildInfo', - 'CreateManagementGroupRequest', - 'CheckNameAvailabilityRequest', + 'SubscriptionUnderManagementGroup', + 'TenantBackfillStatusResult', 'ManagementGroupInfoPaged', + 'DescendantInfoPaged', + 'SubscriptionUnderManagementGroupPaged', 'OperationPaged', 'EntityInfoPaged', 'Reason', diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_groups_api_enums.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_management_groups_api_enums.py similarity index 88% rename from sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_groups_api_enums.py rename to sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_management_groups_api_enums.py index 3fa750f98cf8..759d9633738f 100644 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_groups_api_enums.py +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_management_groups_api_enums.py @@ -30,4 +30,4 @@ class Status(str, Enum): class Type(str, Enum): - providers_microsoft_managementmanagement_groups = "/providers/Microsoft.Management/managementGroups" + microsoft_managementmanagement_groups = "Microsoft.Management/managementGroups" diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_models.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_models.py new file mode 100644 index 000000000000..5e67607bf43c --- /dev/null +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_models.py @@ -0,0 +1,1185 @@ +# 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 AzureAsyncOperationResults(Model): + """The results of Azure-AsyncOperation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :ivar status: The current status of the asynchronous operation performed . + For example, Running, Succeeded, Failed + :vartype status: str + :param tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureAsyncOperationResults, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.status = None + self.tenant_id = kwargs.get('tenant_id', None) + self.display_name = kwargs.get('display_name', None) + + +class CheckNameAvailabilityRequest(Model): + """Management group name availability check parameters. + + :param name: the name to check for availability + :type name: str + :param type: fully qualified resource type which includes provider + namespace. Possible values include: + 'Microsoft.Management/managementGroups' + :type type: str or ~azure.mgmt.managementgroups.models.Type + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'Type'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class CheckNameAvailabilityResult(Model): + """Describes the result of the request to check management group name + availability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Required. True indicates name is valid and + available. False indicates the name is invalid, unavailable, or both. + :vartype name_available: bool + :ivar reason: Required if nameAvailable == false. Invalid indicates the + name provided does not match the resource provider's naming requirements + (incorrect length, unsupported characters, etc.) AlreadyExists indicates + that the name is already in use and is therefore unavailable. Possible + values include: 'Invalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.managementgroups.models.Reason + :ivar message: Required if nameAvailable == false. Localized. If reason == + invalid, provide the user with the reason why the given name is invalid, + and provide the resource naming requirements so that the user can select a + valid name. If reason == AlreadyExists, explain that is already in use, + and direct them to select a different name. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CreateManagementGroupChildInfo(Model): + """The child information of a management group used during creation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of child resource. The fully qualified resource type + which includes provider namespace (e.g. + Microsoft.Management/managementGroups). Possible values include: + 'Microsoft.Management/managementGroups', '/subscriptions' + :vartype type: str or ~azure.mgmt.managementgroups.models.enum + :ivar id: The fully qualified ID for the child resource (management group + or subscription). For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar name: The name of the child entity. + :vartype name: str + :ivar display_name: The friendly name of the child resource. + :vartype display_name: str + :ivar children: The list of children. + :vartype children: + list[~azure.mgmt.managementgroups.models.CreateManagementGroupChildInfo] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[CreateManagementGroupChildInfo]'}, + } + + def __init__(self, **kwargs): + super(CreateManagementGroupChildInfo, self).__init__(**kwargs) + self.type = None + self.id = None + self.name = None + self.display_name = None + self.children = None + + +class CreateManagementGroupDetails(Model): + """The details of a management group used during creation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar version: The version number of the object. + :vartype version: float + :ivar updated_time: The date and time when this object was last updated. + :vartype updated_time: datetime + :ivar updated_by: The identity of the principal or process that updated + the object. + :vartype updated_by: str + :param parent: Parent. + :type parent: ~azure.mgmt.managementgroups.models.CreateParentGroupInfo + """ + + _validation = { + 'version': {'readonly': True}, + 'updated_time': {'readonly': True}, + 'updated_by': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'float'}, + 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, + 'updated_by': {'key': 'updatedBy', 'type': 'str'}, + 'parent': {'key': 'parent', 'type': 'CreateParentGroupInfo'}, + } + + def __init__(self, **kwargs): + super(CreateManagementGroupDetails, self).__init__(**kwargs) + self.version = None + self.updated_time = None + self.updated_by = None + self.parent = kwargs.get('parent', None) + + +class CreateManagementGroupRequest(Model): + """Management group creation parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :param name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :type name: str + :ivar tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :vartype tenant_id: str + :param display_name: The friendly name of the management group. If no + value is passed then this field will be set to the groupId. + :type display_name: str + :param details: Details. + :type details: + ~azure.mgmt.managementgroups.models.CreateManagementGroupDetails + :ivar children: The list of children. + :vartype children: + list[~azure.mgmt.managementgroups.models.CreateManagementGroupChildInfo] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'CreateManagementGroupDetails'}, + 'children': {'key': 'properties.children', 'type': '[CreateManagementGroupChildInfo]'}, + } + + def __init__(self, **kwargs): + super(CreateManagementGroupRequest, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = kwargs.get('name', None) + self.tenant_id = None + self.display_name = kwargs.get('display_name', None) + self.details = kwargs.get('details', None) + self.children = None + + +class CreateOrUpdateSettingsRequest(Model): + """Parameters for creating or updating Management Group settings. + + :param require_authorization_for_group_creation: Indicates whether RBAC + access is required upon group creation under the root Management Group. If + set to true, user will require Microsoft.Management/managementGroups/write + action on the root Management Group scope in order to create new Groups + directly under the root. This will prevent new users from creating new + Management Groups, unless they are given access. + :type require_authorization_for_group_creation: bool + :param default_management_group: Settings that sets the default Management + Group under which new subscriptions get added in this tenant. For example, + /providers/Microsoft.Management/managementGroups/defaultGroup + :type default_management_group: str + """ + + _attribute_map = { + 'require_authorization_for_group_creation': {'key': 'properties.requireAuthorizationForGroupCreation', 'type': 'bool'}, + 'default_management_group': {'key': 'properties.defaultManagementGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CreateOrUpdateSettingsRequest, self).__init__(**kwargs) + self.require_authorization_for_group_creation = kwargs.get('require_authorization_for_group_creation', None) + self.default_management_group = kwargs.get('default_management_group', None) + + +class CreateParentGroupInfo(Model): + """(Optional) The ID of the parent management group used during creation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + :ivar name: The name of the parent management group + :vartype name: str + :ivar display_name: The friendly name of the parent management group. + :vartype display_name: str + """ + + _validation = { + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CreateParentGroupInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.display_name = None + + +class DescendantInfo(Model): + """The descendant. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the descendant. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + or /subscriptions/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups or /subscriptions + :vartype type: str + :ivar name: The name of the descendant. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent: Parent. + :type parent: + ~azure.mgmt.managementgroups.models.DescendantParentGroupInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'DescendantParentGroupInfo'}, + } + + def __init__(self, **kwargs): + super(DescendantInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.display_name = kwargs.get('display_name', None) + self.parent = kwargs.get('parent', None) + + +class DescendantParentGroupInfo(Model): + """The ID of the parent management group. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DescendantParentGroupInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class EntityHierarchyItem(Model): + """The management group details for the hierarchy view. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param permissions: Permissions. Possible values include: 'noaccess', + 'view', 'edit', 'delete' + :type permissions: str or ~azure.mgmt.managementgroups.models.enum + :param children: The list of children. + :type children: + list[~azure.mgmt.managementgroups.models.EntityHierarchyItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'permissions': {'key': 'properties.permissions', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[EntityHierarchyItem]'}, + } + + def __init__(self, **kwargs): + super(EntityHierarchyItem, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.display_name = kwargs.get('display_name', None) + self.permissions = kwargs.get('permissions', None) + self.children = kwargs.get('children', None) + + +class EntityInfo(Model): + """The entity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the entity. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the entity. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the entity. For + example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent: Parent. + :type parent: ~azure.mgmt.managementgroups.models.EntityParentGroupInfo + :param permissions: Permissions. Possible values include: 'noaccess', + 'view', 'edit', 'delete' + :type permissions: str or ~azure.mgmt.managementgroups.models.enum + :param inherited_permissions: Inherited Permissions. Possible values + include: 'noaccess', 'view', 'edit', 'delete' + :type inherited_permissions: str or + ~azure.mgmt.managementgroups.models.enum + :param number_of_descendants: Number of Descendants. + :type number_of_descendants: int + :param number_of_children: Number of Children. Number of children is the + number of Groups and Subscriptions that are exactly one level underneath + the current Group. + :type number_of_children: int + :param number_of_child_groups: Number of Child Groups. Number of children + is the number of Groups that are exactly one level underneath the current + Group. + :type number_of_child_groups: int + :param parent_display_name_chain: The parent display name chain from the + root group to the immediate parent + :type parent_display_name_chain: list[str] + :param parent_name_chain: The parent name chain from the root group to the + immediate parent + :type parent_name_chain: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, + 'permissions': {'key': 'properties.permissions', 'type': 'str'}, + 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, + 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, + 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, + 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, + 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, + 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(EntityInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = kwargs.get('tenant_id', None) + self.display_name = kwargs.get('display_name', None) + self.parent = kwargs.get('parent', None) + self.permissions = kwargs.get('permissions', None) + self.inherited_permissions = kwargs.get('inherited_permissions', None) + self.number_of_descendants = kwargs.get('number_of_descendants', None) + self.number_of_children = kwargs.get('number_of_children', None) + self.number_of_child_groups = kwargs.get('number_of_child_groups', None) + self.parent_display_name_chain = kwargs.get('parent_display_name_chain', None) + self.parent_name_chain = kwargs.get('parent_name_chain', None) + + +class EntityParentGroupInfo(Model): + """(Optional) The ID of the parent management group. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityParentGroupInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ErrorDetails(Model): + """The details of the error. + + :param code: One of a server-defined set of error codes. + :type code: str + :param message: A human-readable representation of the error. + :type message: str + :param details: A human-readable representation of the error's details. + :type details: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class ErrorResponse(Model): + """The error object. + + :param error: Error. + :type error: ~azure.mgmt.managementgroups.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class HierarchySettings(Model): + """Settings defined at the Management Group scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the settings object. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default. + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups/settings. + :vartype type: str + :ivar name: The name of the object. In this case, default. + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the hierarchy + settings. For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param require_authorization_for_group_creation: Indicates whether RBAC + access is required upon group creation under the root Management Group. If + set to true, user will require Microsoft.Management/managementGroups/write + action on the root Management Group scope in order to create new Groups + directly under the root. This will prevent new users from creating new + Management Groups, unless they are given access. + :type require_authorization_for_group_creation: bool + :param default_management_group: Settings that sets the default Management + Group under which new subscriptions get added in this tenant. For example, + /providers/Microsoft.Management/managementGroups/defaultGroup + :type default_management_group: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'require_authorization_for_group_creation': {'key': 'properties.requireAuthorizationForGroupCreation', 'type': 'bool'}, + 'default_management_group': {'key': 'properties.defaultManagementGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HierarchySettings, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = kwargs.get('tenant_id', None) + self.require_authorization_for_group_creation = kwargs.get('require_authorization_for_group_creation', None) + self.default_management_group = kwargs.get('default_management_group', None) + + +class HierarchySettingsInfo(Model): + """The hierarchy settings resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the settings object. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default. + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups/settings. + :vartype type: str + :ivar name: The name of the object. In this case, default. + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the hierarchy + settings. For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param require_authorization_for_group_creation: Indicates whether RBAC + access is required upon group creation under the root Management Group. If + set to true, user will require Microsoft.Management/managementGroups/write + action on the root Management Group scope in order to create new Groups + directly under the root. This will prevent new users from creating new + Management Groups, unless they are given access. + :type require_authorization_for_group_creation: bool + :param default_management_group: Settings that sets the default Management + Group under which new subscriptions get added in this tenant. For example, + /providers/Microsoft.Management/managementGroups/defaultGroup + :type default_management_group: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'require_authorization_for_group_creation': {'key': 'properties.requireAuthorizationForGroupCreation', 'type': 'bool'}, + 'default_management_group': {'key': 'properties.defaultManagementGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HierarchySettingsInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = kwargs.get('tenant_id', None) + self.require_authorization_for_group_creation = kwargs.get('require_authorization_for_group_creation', None) + self.default_management_group = kwargs.get('default_management_group', None) + + +class HierarchySettingsList(Model): + """Lists all hierarchy settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: The list of hierarchy settings. + :type value: + list[~azure.mgmt.managementgroups.models.HierarchySettingsInfo] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HierarchySettingsInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HierarchySettingsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ManagementGroup(Model): + """The management group details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param details: Details. + :type details: ~azure.mgmt.managementgroups.models.ManagementGroupDetails + :param children: The list of children. + :type children: + list[~azure.mgmt.managementgroups.models.ManagementGroupChildInfo] + :param path: The path from the root to the current group. + :type path: + list[~azure.mgmt.managementgroups.models.ManagementGroupPathElement] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'ManagementGroupDetails'}, + 'children': {'key': 'properties.children', 'type': '[ManagementGroupChildInfo]'}, + 'path': {'key': 'properties.path', 'type': '[ManagementGroupPathElement]'}, + } + + def __init__(self, **kwargs): + super(ManagementGroup, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = kwargs.get('tenant_id', None) + self.display_name = kwargs.get('display_name', None) + self.details = kwargs.get('details', None) + self.children = kwargs.get('children', None) + self.path = kwargs.get('path', None) + + +class ManagementGroupChildInfo(Model): + """The child information of a management group. + + :param type: The type of child resource. The fully qualified resource type + which includes provider namespace (e.g. + Microsoft.Management/managementGroups). Possible values include: + 'Microsoft.Management/managementGroups', '/subscriptions' + :type type: str or ~azure.mgmt.managementgroups.models.enum + :param id: The fully qualified ID for the child resource (management group + or subscription). For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + :param name: The name of the child entity. + :type name: str + :param display_name: The friendly name of the child resource. + :type display_name: str + :param children: The list of children. + :type children: + list[~azure.mgmt.managementgroups.models.ManagementGroupChildInfo] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ManagementGroupChildInfo]'}, + } + + def __init__(self, **kwargs): + super(ManagementGroupChildInfo, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.children = kwargs.get('children', None) + + +class ManagementGroupDetails(Model): + """The details of a management group. + + :param version: The version number of the object. + :type version: float + :param updated_time: The date and time when this object was last updated. + :type updated_time: datetime + :param updated_by: The identity of the principal or process that updated + the object. + :type updated_by: str + :param parent: Parent. + :type parent: ~azure.mgmt.managementgroups.models.ParentGroupInfo + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'float'}, + 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, + 'updated_by': {'key': 'updatedBy', 'type': 'str'}, + 'parent': {'key': 'parent', 'type': 'ParentGroupInfo'}, + } + + def __init__(self, **kwargs): + super(ManagementGroupDetails, self).__init__(**kwargs) + self.version = kwargs.get('version', None) + self.updated_time = kwargs.get('updated_time', None) + self.updated_by = kwargs.get('updated_by', None) + self.parent = kwargs.get('parent', None) + + +class ManagementGroupInfo(Model): + """The management group resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagementGroupInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = kwargs.get('tenant_id', None) + self.display_name = kwargs.get('display_name', None) + + +class ManagementGroupPathElement(Model): + """A path element of a management group ancestors. + + :param name: The name of the group. + :type name: str + :param display_name: The friendly name of the group. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagementGroupPathElement, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Operation(Model): + """Operation supported by the Microsoft.Management resource provider. + + 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: Display. + :type display: + ~azure.mgmt.managementgroups.models.OperationDisplayProperties + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayProperties'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplayProperties(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The name of the provider. + :vartype provider: str + :ivar resource: The resource on which the operation is performed. + :vartype resource: str + :ivar operation: The operation that can be performed. + :vartype operation: str + :ivar description: Operation description. + :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(OperationDisplayProperties, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationResults(Model): + """The results of an asynchronous operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationResults, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = kwargs.get('tenant_id', None) + self.display_name = kwargs.get('display_name', None) + + +class ParentGroupInfo(Model): + """(Optional) The ID of the parent management group. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + :param name: The name of the parent management group + :type name: str + :param display_name: The friendly name of the parent management group. + :type display_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ParentGroupInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class PatchManagementGroupRequest(Model): + """Management group patch parameters. + + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent_group_id: (Optional) The fully qualified ID for the parent + management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type parent_group_id: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'parent_group_id': {'key': 'parentGroupId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PatchManagementGroupRequest, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.parent_group_id = kwargs.get('parent_group_id', None) + + +class SubscriptionUnderManagementGroup(Model): + """The details of subscription under management group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the subscription. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/subscriptions/0000000-0000-0000-0000-000000000001 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups/subscriptions + :vartype type: str + :ivar name: The stringified id of the subscription. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant: The AAD Tenant ID associated with the subscription. For + example, 00000000-0000-0000-0000-000000000000 + :type tenant: str + :param display_name: The friendly name of the subscription. + :type display_name: str + :param parent: Parent. + :type parent: + ~azure.mgmt.managementgroups.models.DescendantParentGroupInfo + :param state: The state of the subscription. + :type state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant': {'key': 'properties.tenant', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'DescendantParentGroupInfo'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubscriptionUnderManagementGroup, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant = kwargs.get('tenant', None) + self.display_name = kwargs.get('display_name', None) + self.parent = kwargs.get('parent', None) + self.state = kwargs.get('state', None) + + +class TenantBackfillStatusResult(Model): + """The tenant backfill status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :vartype tenant_id: str + :ivar status: The status of the Tenant Backfill. Possible values include: + 'NotStarted', 'NotStartedButGroupsExist', 'Started', 'Failed', + 'Cancelled', 'Completed' + :vartype status: str or ~azure.mgmt.managementgroups.models.Status + """ + + _validation = { + 'tenant_id': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'Status'}, + } + + def __init__(self, **kwargs): + super(TenantBackfillStatusResult, self).__init__(**kwargs) + self.tenant_id = None + self.status = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_models_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_models_py3.py new file mode 100644 index 000000000000..4ef88f0b6ace --- /dev/null +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_models_py3.py @@ -0,0 +1,1185 @@ +# 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 AzureAsyncOperationResults(Model): + """The results of Azure-AsyncOperation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :ivar status: The current status of the asynchronous operation performed . + For example, Running, Succeeded, Failed + :vartype status: str + :param tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, display_name: str=None, **kwargs) -> None: + super(AzureAsyncOperationResults, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.status = None + self.tenant_id = tenant_id + self.display_name = display_name + + +class CheckNameAvailabilityRequest(Model): + """Management group name availability check parameters. + + :param name: the name to check for availability + :type name: str + :param type: fully qualified resource type which includes provider + namespace. Possible values include: + 'Microsoft.Management/managementGroups' + :type type: str or ~azure.mgmt.managementgroups.models.Type + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'Type'}, + } + + def __init__(self, *, name: str=None, type=None, **kwargs) -> None: + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CheckNameAvailabilityResult(Model): + """Describes the result of the request to check management group name + availability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Required. True indicates name is valid and + available. False indicates the name is invalid, unavailable, or both. + :vartype name_available: bool + :ivar reason: Required if nameAvailable == false. Invalid indicates the + name provided does not match the resource provider's naming requirements + (incorrect length, unsupported characters, etc.) AlreadyExists indicates + that the name is already in use and is therefore unavailable. Possible + values include: 'Invalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.managementgroups.models.Reason + :ivar message: Required if nameAvailable == false. Localized. If reason == + invalid, provide the user with the reason why the given name is invalid, + and provide the resource naming requirements so that the user can select a + valid name. If reason == AlreadyExists, explain that is already in use, + and direct them to select a different name. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CreateManagementGroupChildInfo(Model): + """The child information of a management group used during creation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of child resource. The fully qualified resource type + which includes provider namespace (e.g. + Microsoft.Management/managementGroups). Possible values include: + 'Microsoft.Management/managementGroups', '/subscriptions' + :vartype type: str or ~azure.mgmt.managementgroups.models.enum + :ivar id: The fully qualified ID for the child resource (management group + or subscription). For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar name: The name of the child entity. + :vartype name: str + :ivar display_name: The friendly name of the child resource. + :vartype display_name: str + :ivar children: The list of children. + :vartype children: + list[~azure.mgmt.managementgroups.models.CreateManagementGroupChildInfo] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[CreateManagementGroupChildInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(CreateManagementGroupChildInfo, self).__init__(**kwargs) + self.type = None + self.id = None + self.name = None + self.display_name = None + self.children = None + + +class CreateManagementGroupDetails(Model): + """The details of a management group used during creation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar version: The version number of the object. + :vartype version: float + :ivar updated_time: The date and time when this object was last updated. + :vartype updated_time: datetime + :ivar updated_by: The identity of the principal or process that updated + the object. + :vartype updated_by: str + :param parent: Parent. + :type parent: ~azure.mgmt.managementgroups.models.CreateParentGroupInfo + """ + + _validation = { + 'version': {'readonly': True}, + 'updated_time': {'readonly': True}, + 'updated_by': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'float'}, + 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, + 'updated_by': {'key': 'updatedBy', 'type': 'str'}, + 'parent': {'key': 'parent', 'type': 'CreateParentGroupInfo'}, + } + + def __init__(self, *, parent=None, **kwargs) -> None: + super(CreateManagementGroupDetails, self).__init__(**kwargs) + self.version = None + self.updated_time = None + self.updated_by = None + self.parent = parent + + +class CreateManagementGroupRequest(Model): + """Management group creation parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :param name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :type name: str + :ivar tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :vartype tenant_id: str + :param display_name: The friendly name of the management group. If no + value is passed then this field will be set to the groupId. + :type display_name: str + :param details: Details. + :type details: + ~azure.mgmt.managementgroups.models.CreateManagementGroupDetails + :ivar children: The list of children. + :vartype children: + list[~azure.mgmt.managementgroups.models.CreateManagementGroupChildInfo] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'CreateManagementGroupDetails'}, + 'children': {'key': 'properties.children', 'type': '[CreateManagementGroupChildInfo]'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, details=None, **kwargs) -> None: + super(CreateManagementGroupRequest, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = name + self.tenant_id = None + self.display_name = display_name + self.details = details + self.children = None + + +class CreateOrUpdateSettingsRequest(Model): + """Parameters for creating or updating Management Group settings. + + :param require_authorization_for_group_creation: Indicates whether RBAC + access is required upon group creation under the root Management Group. If + set to true, user will require Microsoft.Management/managementGroups/write + action on the root Management Group scope in order to create new Groups + directly under the root. This will prevent new users from creating new + Management Groups, unless they are given access. + :type require_authorization_for_group_creation: bool + :param default_management_group: Settings that sets the default Management + Group under which new subscriptions get added in this tenant. For example, + /providers/Microsoft.Management/managementGroups/defaultGroup + :type default_management_group: str + """ + + _attribute_map = { + 'require_authorization_for_group_creation': {'key': 'properties.requireAuthorizationForGroupCreation', 'type': 'bool'}, + 'default_management_group': {'key': 'properties.defaultManagementGroup', 'type': 'str'}, + } + + def __init__(self, *, require_authorization_for_group_creation: bool=None, default_management_group: str=None, **kwargs) -> None: + super(CreateOrUpdateSettingsRequest, self).__init__(**kwargs) + self.require_authorization_for_group_creation = require_authorization_for_group_creation + self.default_management_group = default_management_group + + +class CreateParentGroupInfo(Model): + """(Optional) The ID of the parent management group used during creation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + :ivar name: The name of the parent management group + :vartype name: str + :ivar display_name: The friendly name of the parent management group. + :vartype display_name: str + """ + + _validation = { + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(CreateParentGroupInfo, self).__init__(**kwargs) + self.id = id + self.name = None + self.display_name = None + + +class DescendantInfo(Model): + """The descendant. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the descendant. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + or /subscriptions/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups or /subscriptions + :vartype type: str + :ivar name: The name of the descendant. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent: Parent. + :type parent: + ~azure.mgmt.managementgroups.models.DescendantParentGroupInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'DescendantParentGroupInfo'}, + } + + def __init__(self, *, display_name: str=None, parent=None, **kwargs) -> None: + super(DescendantInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.display_name = display_name + self.parent = parent + + +class DescendantParentGroupInfo(Model): + """The ID of the parent management group. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(DescendantParentGroupInfo, self).__init__(**kwargs) + self.id = id + + +class EntityHierarchyItem(Model): + """The management group details for the hierarchy view. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param permissions: Permissions. Possible values include: 'noaccess', + 'view', 'edit', 'delete' + :type permissions: str or ~azure.mgmt.managementgroups.models.enum + :param children: The list of children. + :type children: + list[~azure.mgmt.managementgroups.models.EntityHierarchyItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'permissions': {'key': 'properties.permissions', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[EntityHierarchyItem]'}, + } + + def __init__(self, *, display_name: str=None, permissions=None, children=None, **kwargs) -> None: + super(EntityHierarchyItem, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.display_name = display_name + self.permissions = permissions + self.children = children + + +class EntityInfo(Model): + """The entity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the entity. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the entity. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the entity. For + example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent: Parent. + :type parent: ~azure.mgmt.managementgroups.models.EntityParentGroupInfo + :param permissions: Permissions. Possible values include: 'noaccess', + 'view', 'edit', 'delete' + :type permissions: str or ~azure.mgmt.managementgroups.models.enum + :param inherited_permissions: Inherited Permissions. Possible values + include: 'noaccess', 'view', 'edit', 'delete' + :type inherited_permissions: str or + ~azure.mgmt.managementgroups.models.enum + :param number_of_descendants: Number of Descendants. + :type number_of_descendants: int + :param number_of_children: Number of Children. Number of children is the + number of Groups and Subscriptions that are exactly one level underneath + the current Group. + :type number_of_children: int + :param number_of_child_groups: Number of Child Groups. Number of children + is the number of Groups that are exactly one level underneath the current + Group. + :type number_of_child_groups: int + :param parent_display_name_chain: The parent display name chain from the + root group to the immediate parent + :type parent_display_name_chain: list[str] + :param parent_name_chain: The parent name chain from the root group to the + immediate parent + :type parent_name_chain: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, + 'permissions': {'key': 'properties.permissions', 'type': 'str'}, + 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, + 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, + 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, + 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, + 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, + 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, + } + + def __init__(self, *, tenant_id: str=None, display_name: str=None, parent=None, permissions=None, inherited_permissions=None, number_of_descendants: int=None, number_of_children: int=None, number_of_child_groups: int=None, parent_display_name_chain=None, parent_name_chain=None, **kwargs) -> None: + super(EntityInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = tenant_id + self.display_name = display_name + self.parent = parent + self.permissions = permissions + self.inherited_permissions = inherited_permissions + self.number_of_descendants = number_of_descendants + self.number_of_children = number_of_children + self.number_of_child_groups = number_of_child_groups + self.parent_display_name_chain = parent_display_name_chain + self.parent_name_chain = parent_name_chain + + +class EntityParentGroupInfo(Model): + """(Optional) The ID of the parent management group. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EntityParentGroupInfo, self).__init__(**kwargs) + self.id = id + + +class ErrorDetails(Model): + """The details of the error. + + :param code: One of a server-defined set of error codes. + :type code: str + :param message: A human-readable representation of the error. + :type message: str + :param details: A human-readable representation of the error's details. + :type details: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, details: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class ErrorResponse(Model): + """The error object. + + :param error: Error. + :type error: ~azure.mgmt.managementgroups.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class HierarchySettings(Model): + """Settings defined at the Management Group scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the settings object. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default. + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups/settings. + :vartype type: str + :ivar name: The name of the object. In this case, default. + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the hierarchy + settings. For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param require_authorization_for_group_creation: Indicates whether RBAC + access is required upon group creation under the root Management Group. If + set to true, user will require Microsoft.Management/managementGroups/write + action on the root Management Group scope in order to create new Groups + directly under the root. This will prevent new users from creating new + Management Groups, unless they are given access. + :type require_authorization_for_group_creation: bool + :param default_management_group: Settings that sets the default Management + Group under which new subscriptions get added in this tenant. For example, + /providers/Microsoft.Management/managementGroups/defaultGroup + :type default_management_group: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'require_authorization_for_group_creation': {'key': 'properties.requireAuthorizationForGroupCreation', 'type': 'bool'}, + 'default_management_group': {'key': 'properties.defaultManagementGroup', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, require_authorization_for_group_creation: bool=None, default_management_group: str=None, **kwargs) -> None: + super(HierarchySettings, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = tenant_id + self.require_authorization_for_group_creation = require_authorization_for_group_creation + self.default_management_group = default_management_group + + +class HierarchySettingsInfo(Model): + """The hierarchy settings resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the settings object. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default. + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups/settings. + :vartype type: str + :ivar name: The name of the object. In this case, default. + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the hierarchy + settings. For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param require_authorization_for_group_creation: Indicates whether RBAC + access is required upon group creation under the root Management Group. If + set to true, user will require Microsoft.Management/managementGroups/write + action on the root Management Group scope in order to create new Groups + directly under the root. This will prevent new users from creating new + Management Groups, unless they are given access. + :type require_authorization_for_group_creation: bool + :param default_management_group: Settings that sets the default Management + Group under which new subscriptions get added in this tenant. For example, + /providers/Microsoft.Management/managementGroups/defaultGroup + :type default_management_group: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'require_authorization_for_group_creation': {'key': 'properties.requireAuthorizationForGroupCreation', 'type': 'bool'}, + 'default_management_group': {'key': 'properties.defaultManagementGroup', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, require_authorization_for_group_creation: bool=None, default_management_group: str=None, **kwargs) -> None: + super(HierarchySettingsInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = tenant_id + self.require_authorization_for_group_creation = require_authorization_for_group_creation + self.default_management_group = default_management_group + + +class HierarchySettingsList(Model): + """Lists all hierarchy settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: The list of hierarchy settings. + :type value: + list[~azure.mgmt.managementgroups.models.HierarchySettingsInfo] + :ivar next_link: The URL to use for getting the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HierarchySettingsInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(HierarchySettingsList, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagementGroup(Model): + """The management group details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param details: Details. + :type details: ~azure.mgmt.managementgroups.models.ManagementGroupDetails + :param children: The list of children. + :type children: + list[~azure.mgmt.managementgroups.models.ManagementGroupChildInfo] + :param path: The path from the root to the current group. + :type path: + list[~azure.mgmt.managementgroups.models.ManagementGroupPathElement] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'ManagementGroupDetails'}, + 'children': {'key': 'properties.children', 'type': '[ManagementGroupChildInfo]'}, + 'path': {'key': 'properties.path', 'type': '[ManagementGroupPathElement]'}, + } + + def __init__(self, *, tenant_id: str=None, display_name: str=None, details=None, children=None, path=None, **kwargs) -> None: + super(ManagementGroup, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = tenant_id + self.display_name = display_name + self.details = details + self.children = children + self.path = path + + +class ManagementGroupChildInfo(Model): + """The child information of a management group. + + :param type: The type of child resource. The fully qualified resource type + which includes provider namespace (e.g. + Microsoft.Management/managementGroups). Possible values include: + 'Microsoft.Management/managementGroups', '/subscriptions' + :type type: str or ~azure.mgmt.managementgroups.models.enum + :param id: The fully qualified ID for the child resource (management group + or subscription). For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + :param name: The name of the child entity. + :type name: str + :param display_name: The friendly name of the child resource. + :type display_name: str + :param children: The list of children. + :type children: + list[~azure.mgmt.managementgroups.models.ManagementGroupChildInfo] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ManagementGroupChildInfo]'}, + } + + def __init__(self, *, type=None, id: str=None, name: str=None, display_name: str=None, children=None, **kwargs) -> None: + super(ManagementGroupChildInfo, self).__init__(**kwargs) + self.type = type + self.id = id + self.name = name + self.display_name = display_name + self.children = children + + +class ManagementGroupDetails(Model): + """The details of a management group. + + :param version: The version number of the object. + :type version: float + :param updated_time: The date and time when this object was last updated. + :type updated_time: datetime + :param updated_by: The identity of the principal or process that updated + the object. + :type updated_by: str + :param parent: Parent. + :type parent: ~azure.mgmt.managementgroups.models.ParentGroupInfo + """ + + _attribute_map = { + 'version': {'key': 'version', 'type': 'float'}, + 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, + 'updated_by': {'key': 'updatedBy', 'type': 'str'}, + 'parent': {'key': 'parent', 'type': 'ParentGroupInfo'}, + } + + def __init__(self, *, version: float=None, updated_time=None, updated_by: str=None, parent=None, **kwargs) -> None: + super(ManagementGroupDetails, self).__init__(**kwargs) + self.version = version + self.updated_time = updated_time + self.updated_by = updated_by + self.parent = parent + + +class ManagementGroupInfo(Model): + """The management group resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, display_name: str=None, **kwargs) -> None: + super(ManagementGroupInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = tenant_id + self.display_name = display_name + + +class ManagementGroupPathElement(Model): + """A path element of a management group ancestors. + + :param name: The name of the group. + :type name: str + :param display_name: The friendly name of the group. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(ManagementGroupPathElement, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Operation(Model): + """Operation supported by the Microsoft.Management resource provider. + + 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: Display. + :type display: + ~azure.mgmt.managementgroups.models.OperationDisplayProperties + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayProperties'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplayProperties(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The name of the provider. + :vartype provider: str + :ivar resource: The resource on which the operation is performed. + :vartype resource: str + :ivar operation: The operation that can be performed. + :vartype operation: str + :ivar description: Operation description. + :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(OperationDisplayProperties, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationResults(Model): + """The results of an asynchronous operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the management group. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, display_name: str=None, **kwargs) -> None: + super(OperationResults, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant_id = tenant_id + self.display_name = display_name + + +class ParentGroupInfo(Model): + """(Optional) The ID of the parent management group. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + :param name: The name of the parent management group + :type name: str + :param display_name: The friendly name of the parent management group. + :type display_name: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, display_name: str=None, **kwargs) -> None: + super(ParentGroupInfo, self).__init__(**kwargs) + self.id = id + self.name = name + self.display_name = display_name + + +class PatchManagementGroupRequest(Model): + """Management group patch parameters. + + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent_group_id: (Optional) The fully qualified ID for the parent + management group. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type parent_group_id: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'parent_group_id': {'key': 'parentGroupId', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, parent_group_id: str=None, **kwargs) -> None: + super(PatchManagementGroupRequest, self).__init__(**kwargs) + self.display_name = display_name + self.parent_group_id = parent_group_id + + +class SubscriptionUnderManagementGroup(Model): + """The details of subscription under management group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the subscription. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/subscriptions/0000000-0000-0000-0000-000000000001 + :vartype id: str + :ivar type: The type of the resource. For example, + Microsoft.Management/managementGroups/subscriptions + :vartype type: str + :ivar name: The stringified id of the subscription. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :param tenant: The AAD Tenant ID associated with the subscription. For + example, 00000000-0000-0000-0000-000000000000 + :type tenant: str + :param display_name: The friendly name of the subscription. + :type display_name: str + :param parent: Parent. + :type parent: + ~azure.mgmt.managementgroups.models.DescendantParentGroupInfo + :param state: The state of the subscription. + :type state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant': {'key': 'properties.tenant', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'DescendantParentGroupInfo'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, tenant: str=None, display_name: str=None, parent=None, state: str=None, **kwargs) -> None: + super(SubscriptionUnderManagementGroup, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.tenant = tenant + self.display_name = display_name + self.parent = parent + self.state = state + + +class TenantBackfillStatusResult(Model): + """The tenant backfill status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tenant_id: The AAD Tenant ID associated with the management group. + For example, 00000000-0000-0000-0000-000000000000 + :vartype tenant_id: str + :ivar status: The status of the Tenant Backfill. Possible values include: + 'NotStarted', 'NotStartedButGroupsExist', 'Started', 'Failed', + 'Cancelled', 'Completed' + :vartype status: str or ~azure.mgmt.managementgroups.models.Status + """ + + _validation = { + 'tenant_id': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'Status'}, + } + + def __init__(self, **kwargs) -> None: + super(TenantBackfillStatusResult, self).__init__(**kwargs) + self.tenant_id = None + self.status = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_paged_models.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_paged_models.py new file mode 100644 index 000000000000..cde2c93cbf32 --- /dev/null +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/_paged_models.py @@ -0,0 +1,79 @@ +# 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 ManagementGroupInfoPaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagementGroupInfo ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagementGroupInfo]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagementGroupInfoPaged, self).__init__(*args, **kwargs) +class DescendantInfoPaged(Paged): + """ + A paging container for iterating over a list of :class:`DescendantInfo ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DescendantInfo]'} + } + + def __init__(self, *args, **kwargs): + + super(DescendantInfoPaged, self).__init__(*args, **kwargs) +class SubscriptionUnderManagementGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`SubscriptionUnderManagementGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SubscriptionUnderManagementGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(SubscriptionUnderManagementGroupPaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class EntityInfoPaged(Paged): + """ + A paging container for iterating over a list of :class:`EntityInfo ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EntityInfo]'} + } + + def __init__(self, *args, **kwargs): + + super(EntityInfoPaged, self).__init__(*args, **kwargs) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_request.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_request.py deleted file mode 100644 index 9bc8379bb94f..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_request.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 CheckNameAvailabilityRequest(Model): - """Management group name availability check parameters. - - :param name: the name to check for availability - :type name: str - :param type: fully qualified resource type which includes provider - namespace. Possible values include: - '/providers/Microsoft.Management/managementGroups' - :type type: str or ~azure.mgmt.managementgroups.models.Type - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'Type'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityRequest, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_request_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_request_py3.py deleted file mode 100644 index 2b020be13871..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_request_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 CheckNameAvailabilityRequest(Model): - """Management group name availability check parameters. - - :param name: the name to check for availability - :type name: str - :param type: fully qualified resource type which includes provider - namespace. Possible values include: - '/providers/Microsoft.Management/managementGroups' - :type type: str or ~azure.mgmt.managementgroups.models.Type - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'Type'}, - } - - def __init__(self, *, name: str=None, type=None, **kwargs) -> None: - super(CheckNameAvailabilityRequest, self).__init__(**kwargs) - self.name = name - self.type = type diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_result.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_result.py deleted file mode 100644 index f6cd42f2279e..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_result.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """Describes the result of the request to check management group name - availability. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Required. True indicates name is valid and - available. False indicates the name is invalid, unavailable, or both. - :vartype name_available: bool - :ivar reason: Required if nameAvailable == false. Invalid indicates the - name provided does not match the resource provider's naming requirements - (incorrect length, unsupported characters, etc.) AlreadyExists indicates - that the name is already in use and is therefore unavailable. Possible - values include: 'Invalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.managementgroups.models.Reason - :ivar message: Required if nameAvailable == false. Localized. If reason == - invalid, provide the user with the reason why the given name is invalid, - and provide the resource naming requirements so that the user can select a - valid name. If reason == AlreadyExists, explain that is already in use, - and direct them to select a different name. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_result_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_result_py3.py deleted file mode 100644 index 94a0cbc8ae0b..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """Describes the result of the request to check management group name - availability. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Required. True indicates name is valid and - available. False indicates the name is invalid, unavailable, or both. - :vartype name_available: bool - :ivar reason: Required if nameAvailable == false. Invalid indicates the - name provided does not match the resource provider's naming requirements - (incorrect length, unsupported characters, etc.) AlreadyExists indicates - that the name is already in use and is therefore unavailable. Possible - values include: 'Invalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.managementgroups.models.Reason - :ivar message: Required if nameAvailable == false. Localized. If reason == - invalid, provide the user with the reason why the given name is invalid, - and provide the resource naming requirements so that the user can select a - valid name. If reason == AlreadyExists, explain that is already in use, - and direct them to select a different name. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_child_info.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_child_info.py deleted file mode 100644 index 05c0e10b664e..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_child_info.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 CreateManagementGroupChildInfo(Model): - """The child information of a management group used during creation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of child resource. The fully qualified resource type - which includes provider namespace (e.g. - /providers/Microsoft.Management/managementGroups). Possible values - include: '/providers/Microsoft.Management/managementGroups', - '/subscriptions' - :vartype type: str or ~azure.mgmt.managementgroups.models.enum - :ivar id: The fully qualified ID for the child resource (management group - or subscription). For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar name: The name of the child entity. - :vartype name: str - :ivar display_name: The friendly name of the child resource. - :vartype display_name: str - :ivar roles: The roles definitions associated with the management group. - :vartype roles: list[str] - :ivar children: The list of children. - :vartype children: - list[~azure.mgmt.managementgroups.models.CreateManagementGroupChildInfo] - """ - - _validation = { - 'type': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'roles': {'readonly': True}, - 'children': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - 'children': {'key': 'children', 'type': '[CreateManagementGroupChildInfo]'}, - } - - def __init__(self, **kwargs): - super(CreateManagementGroupChildInfo, self).__init__(**kwargs) - self.type = None - self.id = None - self.name = None - self.display_name = None - self.roles = None - self.children = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_child_info_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_child_info_py3.py deleted file mode 100644 index 9a9850a4edf6..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_child_info_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 CreateManagementGroupChildInfo(Model): - """The child information of a management group used during creation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of child resource. The fully qualified resource type - which includes provider namespace (e.g. - /providers/Microsoft.Management/managementGroups). Possible values - include: '/providers/Microsoft.Management/managementGroups', - '/subscriptions' - :vartype type: str or ~azure.mgmt.managementgroups.models.enum - :ivar id: The fully qualified ID for the child resource (management group - or subscription). For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar name: The name of the child entity. - :vartype name: str - :ivar display_name: The friendly name of the child resource. - :vartype display_name: str - :ivar roles: The roles definitions associated with the management group. - :vartype roles: list[str] - :ivar children: The list of children. - :vartype children: - list[~azure.mgmt.managementgroups.models.CreateManagementGroupChildInfo] - """ - - _validation = { - 'type': {'readonly': True}, - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'roles': {'readonly': True}, - 'children': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - 'children': {'key': 'children', 'type': '[CreateManagementGroupChildInfo]'}, - } - - def __init__(self, **kwargs) -> None: - super(CreateManagementGroupChildInfo, self).__init__(**kwargs) - self.type = None - self.id = None - self.name = None - self.display_name = None - self.roles = None - self.children = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_details.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_details.py deleted file mode 100644 index 1c35ff148136..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_details.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CreateManagementGroupDetails(Model): - """The details of a management group used during creation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar version: The version number of the object. - :vartype version: float - :ivar updated_time: The date and time when this object was last updated. - :vartype updated_time: datetime - :ivar updated_by: The identity of the principal or process that updated - the object. - :vartype updated_by: str - :param parent: Parent. - :type parent: ~azure.mgmt.managementgroups.models.CreateParentGroupInfo - """ - - _validation = { - 'version': {'readonly': True}, - 'updated_time': {'readonly': True}, - 'updated_by': {'readonly': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'float'}, - 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, - 'updated_by': {'key': 'updatedBy', 'type': 'str'}, - 'parent': {'key': 'parent', 'type': 'CreateParentGroupInfo'}, - } - - def __init__(self, **kwargs): - super(CreateManagementGroupDetails, self).__init__(**kwargs) - self.version = None - self.updated_time = None - self.updated_by = None - self.parent = kwargs.get('parent', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_details_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_details_py3.py deleted file mode 100644 index d0b2dab1aacf..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_details_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CreateManagementGroupDetails(Model): - """The details of a management group used during creation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar version: The version number of the object. - :vartype version: float - :ivar updated_time: The date and time when this object was last updated. - :vartype updated_time: datetime - :ivar updated_by: The identity of the principal or process that updated - the object. - :vartype updated_by: str - :param parent: Parent. - :type parent: ~azure.mgmt.managementgroups.models.CreateParentGroupInfo - """ - - _validation = { - 'version': {'readonly': True}, - 'updated_time': {'readonly': True}, - 'updated_by': {'readonly': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'float'}, - 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, - 'updated_by': {'key': 'updatedBy', 'type': 'str'}, - 'parent': {'key': 'parent', 'type': 'CreateParentGroupInfo'}, - } - - def __init__(self, *, parent=None, **kwargs) -> None: - super(CreateManagementGroupDetails, self).__init__(**kwargs) - self.version = None - self.updated_time = None - self.updated_by = None - self.parent = parent diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_request.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_request.py deleted file mode 100644 index ac64070a79c4..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_request.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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 CreateManagementGroupRequest(Model): - """Management group creation parameters. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :param name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :type name: str - :ivar tenant_id: The AAD Tenant ID associated with the management group. - For example, 00000000-0000-0000-0000-000000000000 - :vartype tenant_id: str - :param display_name: The friendly name of the management group. If no - value is passed then this field will be set to the groupId. - :type display_name: str - :ivar roles: The roles definitions associated with the management group. - :vartype roles: list[str] - :param details: Details. - :type details: - ~azure.mgmt.managementgroups.models.CreateManagementGroupDetails - :ivar children: The list of children. - :vartype children: - list[~azure.mgmt.managementgroups.models.CreateManagementGroupChildInfo] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'roles': {'readonly': True}, - 'children': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'roles': {'key': 'properties.roles', 'type': '[str]'}, - 'details': {'key': 'properties.details', 'type': 'CreateManagementGroupDetails'}, - 'children': {'key': 'properties.children', 'type': '[CreateManagementGroupChildInfo]'}, - } - - def __init__(self, **kwargs): - super(CreateManagementGroupRequest, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = kwargs.get('name', None) - self.tenant_id = None - self.display_name = kwargs.get('display_name', None) - self.roles = None - self.details = kwargs.get('details', None) - self.children = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_request_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_request_py3.py deleted file mode 100644 index dfbcaa65a532..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_management_group_request_py3.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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 CreateManagementGroupRequest(Model): - """Management group creation parameters. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :param name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :type name: str - :ivar tenant_id: The AAD Tenant ID associated with the management group. - For example, 00000000-0000-0000-0000-000000000000 - :vartype tenant_id: str - :param display_name: The friendly name of the management group. If no - value is passed then this field will be set to the groupId. - :type display_name: str - :ivar roles: The roles definitions associated with the management group. - :vartype roles: list[str] - :param details: Details. - :type details: - ~azure.mgmt.managementgroups.models.CreateManagementGroupDetails - :ivar children: The list of children. - :vartype children: - list[~azure.mgmt.managementgroups.models.CreateManagementGroupChildInfo] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'roles': {'readonly': True}, - 'children': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'roles': {'key': 'properties.roles', 'type': '[str]'}, - 'details': {'key': 'properties.details', 'type': 'CreateManagementGroupDetails'}, - 'children': {'key': 'properties.children', 'type': '[CreateManagementGroupChildInfo]'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, details=None, **kwargs) -> None: - super(CreateManagementGroupRequest, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = name - self.tenant_id = None - self.display_name = display_name - self.roles = None - self.details = details - self.children = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_parent_group_info.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_parent_group_info.py deleted file mode 100644 index 34f31e6efcff..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_parent_group_info.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 CreateParentGroupInfo(Model): - """(Optional) The ID of the parent management group used during creation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - :ivar name: The name of the parent management group - :vartype name: str - :ivar display_name: The friendly name of the parent management group. - :vartype display_name: str - """ - - _validation = { - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CreateParentGroupInfo, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = None - self.display_name = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_parent_group_info_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_parent_group_info_py3.py deleted file mode 100644 index d71815c12e1b..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/create_parent_group_info_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 CreateParentGroupInfo(Model): - """(Optional) The ID of the parent management group used during creation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - :ivar name: The name of the parent management group - :vartype name: str - :ivar display_name: The friendly name of the parent management group. - :vartype display_name: str - """ - - _validation = { - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(CreateParentGroupInfo, self).__init__(**kwargs) - self.id = id - self.name = None - self.display_name = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_hierarchy_item.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_hierarchy_item.py deleted file mode 100644 index 9ea06db4eecf..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_hierarchy_item.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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 EntityHierarchyItem(Model): - """The management group details for the hierarchy view. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param permissions: Permissions. Possible values include: 'noaccess', - 'view', 'edit', 'delete' - :type permissions: str or ~azure.mgmt.managementgroups.models.enum - :param children: The list of children. - :type children: - list[~azure.mgmt.managementgroups.models.EntityHierarchyItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'permissions': {'key': 'properties.permissions', 'type': 'str'}, - 'children': {'key': 'properties.children', 'type': '[EntityHierarchyItem]'}, - } - - def __init__(self, **kwargs): - super(EntityHierarchyItem, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.display_name = kwargs.get('display_name', None) - self.permissions = kwargs.get('permissions', None) - self.children = kwargs.get('children', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_hierarchy_item_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_hierarchy_item_py3.py deleted file mode 100644 index a1c51a63ae21..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_hierarchy_item_py3.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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 EntityHierarchyItem(Model): - """The management group details for the hierarchy view. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param permissions: Permissions. Possible values include: 'noaccess', - 'view', 'edit', 'delete' - :type permissions: str or ~azure.mgmt.managementgroups.models.enum - :param children: The list of children. - :type children: - list[~azure.mgmt.managementgroups.models.EntityHierarchyItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'permissions': {'key': 'properties.permissions', 'type': 'str'}, - 'children': {'key': 'properties.children', 'type': '[EntityHierarchyItem]'}, - } - - def __init__(self, *, display_name: str=None, permissions=None, children=None, **kwargs) -> None: - super(EntityHierarchyItem, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.display_name = display_name - self.permissions = permissions - self.children = children diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info.py deleted file mode 100644 index 20e8451492b7..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 EntityInfo(Model): - """The entity. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the entity. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the entity. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param tenant_id: The AAD Tenant ID associated with the entity. For - example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param parent: Parent. - :type parent: ~azure.mgmt.managementgroups.models.EntityParentGroupInfo - :param permissions: Permissions. Possible values include: 'noaccess', - 'view', 'edit', 'delete' - :type permissions: str or ~azure.mgmt.managementgroups.models.enum - :param inherited_permissions: Inherited Permissions. Possible values - include: 'noaccess', 'view', 'edit', 'delete' - :type inherited_permissions: str or - ~azure.mgmt.managementgroups.models.enum - :param number_of_descendants: Number of Descendants. - :type number_of_descendants: int - :param number_of_children: Number of Children. Number of children is the - number of Groups and Subscriptions that are exactly one level underneath - the current Group. - :type number_of_children: int - :param number_of_child_groups: Number of Child Groups. Number of child - groups is the number of Groups that are exactly one level underneath the - current Group. - :type number_of_child_groups: int - :param parent_display_name_chain: The parent display name chain from the - root group to the immediate parent - :type parent_display_name_chain: list[str] - :param parent_name_chain: The parent name chain from the root group to the - immediate parent - :type parent_name_chain: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, - 'permissions': {'key': 'properties.permissions', 'type': 'str'}, - 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, - 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, - 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, - 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, - 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, - 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(EntityInfo, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.tenant_id = kwargs.get('tenant_id', None) - self.display_name = kwargs.get('display_name', None) - self.parent = kwargs.get('parent', None) - self.permissions = kwargs.get('permissions', None) - self.inherited_permissions = kwargs.get('inherited_permissions', None) - self.number_of_descendants = kwargs.get('number_of_descendants', None) - self.number_of_children = kwargs.get('number_of_children', None) - self.number_of_child_groups = kwargs.get('number_of_child_groups', None) - self.parent_display_name_chain = kwargs.get('parent_display_name_chain', None) - self.parent_name_chain = kwargs.get('parent_name_chain', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info_paged.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info_paged.py deleted file mode 100644 index 0bcfc102560d..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 EntityInfoPaged(Paged): - """ - A paging container for iterating over a list of :class:`EntityInfo ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EntityInfo]'} - } - - def __init__(self, *args, **kwargs): - - super(EntityInfoPaged, self).__init__(*args, **kwargs) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info_py3.py deleted file mode 100644 index f639fff8f613..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_info_py3.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 EntityInfo(Model): - """The entity. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the entity. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the entity. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param tenant_id: The AAD Tenant ID associated with the entity. For - example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param parent: Parent. - :type parent: ~azure.mgmt.managementgroups.models.EntityParentGroupInfo - :param permissions: Permissions. Possible values include: 'noaccess', - 'view', 'edit', 'delete' - :type permissions: str or ~azure.mgmt.managementgroups.models.enum - :param inherited_permissions: Inherited Permissions. Possible values - include: 'noaccess', 'view', 'edit', 'delete' - :type inherited_permissions: str or - ~azure.mgmt.managementgroups.models.enum - :param number_of_descendants: Number of Descendants. - :type number_of_descendants: int - :param number_of_children: Number of Children. Number of children is the - number of Groups and Subscriptions that are exactly one level underneath - the current Group. - :type number_of_children: int - :param number_of_child_groups: Number of Child Groups. Number of child - groups is the number of Groups that are exactly one level underneath the - current Group. - :type number_of_child_groups: int - :param parent_display_name_chain: The parent display name chain from the - root group to the immediate parent - :type parent_display_name_chain: list[str] - :param parent_name_chain: The parent name chain from the root group to the - immediate parent - :type parent_name_chain: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, - 'permissions': {'key': 'properties.permissions', 'type': 'str'}, - 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, - 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, - 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, - 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, - 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, - 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, - } - - def __init__(self, *, tenant_id: str=None, display_name: str=None, parent=None, permissions=None, inherited_permissions=None, number_of_descendants: int=None, number_of_children: int=None, number_of_child_groups: int=None, parent_display_name_chain=None, parent_name_chain=None, **kwargs) -> None: - super(EntityInfo, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.tenant_id = tenant_id - self.display_name = display_name - self.parent = parent - self.permissions = permissions - self.inherited_permissions = inherited_permissions - self.number_of_descendants = number_of_descendants - self.number_of_children = number_of_children - self.number_of_child_groups = number_of_child_groups - self.parent_display_name_chain = parent_display_name_chain - self.parent_name_chain = parent_name_chain diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_parent_group_info.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_parent_group_info.py deleted file mode 100644 index 7e26dca6f12c..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_parent_group_info.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 EntityParentGroupInfo(Model): - """(Optional) The ID of the parent management group. - - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EntityParentGroupInfo, self).__init__(**kwargs) - self.id = kwargs.get('id', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_parent_group_info_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_parent_group_info_py3.py deleted file mode 100644 index b0275df6a41f..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/entity_parent_group_info_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 EntityParentGroupInfo(Model): - """(Optional) The ID of the parent management group. - - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(EntityParentGroupInfo, self).__init__(**kwargs) - self.id = id diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_details.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_details.py deleted file mode 100644 index 11dab3905b6e..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_details.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ErrorDetails(Model): - """The details of the error. - - :param code: One of a server-defined set of error codes. - :type code: str - :param message: A human-readable representation of the error. - :type message: str - :param details: A human-readable representation of the error's details. - :type details: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorDetails, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_details_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_details_py3.py deleted file mode 100644 index e5d31f18a57b..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_details_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ErrorDetails(Model): - """The details of the error. - - :param code: One of a server-defined set of error codes. - :type code: str - :param message: A human-readable representation of the error. - :type message: str - :param details: A human-readable representation of the error's details. - :type details: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - } - - def __init__(self, *, code: str=None, message: str=None, details: str=None, **kwargs) -> None: - super(ErrorDetails, self).__init__(**kwargs) - self.code = code - self.message = message - self.details = details diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_response.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_response.py deleted file mode 100644 index 206717b3e423..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_response.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ErrorResponse(Model): - """The error object. - - :param error: Error. - :type error: ~azure.mgmt.managementgroups.models.ErrorDetails - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetails'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_response_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_response_py3.py deleted file mode 100644 index f371695bb4c6..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/error_response_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ErrorResponse(Model): - """The error object. - - :param error: Error. - :type error: ~azure.mgmt.managementgroups.models.ErrorDetails - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetails'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group.py deleted file mode 100644 index 6c77afda9581..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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 ManagementGroup(Model): - """The management group details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param tenant_id: The AAD Tenant ID associated with the management group. - For example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param roles: The role definitions associated with the management group. - :type roles: list[str] - :param details: Details. - :type details: ~azure.mgmt.managementgroups.models.ManagementGroupDetails - :param children: The list of children. - :type children: - list[~azure.mgmt.managementgroups.models.ManagementGroupChildInfo] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'roles': {'key': 'properties.roles', 'type': '[str]'}, - 'details': {'key': 'properties.details', 'type': 'ManagementGroupDetails'}, - 'children': {'key': 'properties.children', 'type': '[ManagementGroupChildInfo]'}, - } - - def __init__(self, **kwargs): - super(ManagementGroup, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.tenant_id = kwargs.get('tenant_id', None) - self.display_name = kwargs.get('display_name', None) - self.roles = kwargs.get('roles', None) - self.details = kwargs.get('details', None) - self.children = kwargs.get('children', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_child_info.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_child_info.py deleted file mode 100644 index a5f0ca517200..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_child_info.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 ManagementGroupChildInfo(Model): - """The child information of a management group. - - :param type: The type of child resource. The fully qualified resource type - which includes provider namespace (e.g. - /providers/Microsoft.Management/managementGroups). Possible values - include: '/providers/Microsoft.Management/managementGroups', - '/subscriptions' - :type type: str or ~azure.mgmt.managementgroups.models.enum - :param id: The fully qualified ID for the child resource (management group - or subscription). For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - :param name: The name of the child entity. - :type name: str - :param display_name: The friendly name of the child resource. - :type display_name: str - :param roles: The roles definitions associated with the management group. - :type roles: list[str] - :param children: The list of children. - :type children: - list[~azure.mgmt.managementgroups.models.ManagementGroupChildInfo] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - 'children': {'key': 'children', 'type': '[ManagementGroupChildInfo]'}, - } - - def __init__(self, **kwargs): - super(ManagementGroupChildInfo, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.roles = kwargs.get('roles', None) - self.children = kwargs.get('children', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_child_info_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_child_info_py3.py deleted file mode 100644 index fd0917339900..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_child_info_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 ManagementGroupChildInfo(Model): - """The child information of a management group. - - :param type: The type of child resource. The fully qualified resource type - which includes provider namespace (e.g. - /providers/Microsoft.Management/managementGroups). Possible values - include: '/providers/Microsoft.Management/managementGroups', - '/subscriptions' - :type type: str or ~azure.mgmt.managementgroups.models.enum - :param id: The fully qualified ID for the child resource (management group - or subscription). For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - :param name: The name of the child entity. - :type name: str - :param display_name: The friendly name of the child resource. - :type display_name: str - :param roles: The roles definitions associated with the management group. - :type roles: list[str] - :param children: The list of children. - :type children: - list[~azure.mgmt.managementgroups.models.ManagementGroupChildInfo] - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'roles': {'key': 'roles', 'type': '[str]'}, - 'children': {'key': 'children', 'type': '[ManagementGroupChildInfo]'}, - } - - def __init__(self, *, type=None, id: str=None, name: str=None, display_name: str=None, roles=None, children=None, **kwargs) -> None: - super(ManagementGroupChildInfo, self).__init__(**kwargs) - self.type = type - self.id = id - self.name = name - self.display_name = display_name - self.roles = roles - self.children = children diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_details.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_details.py deleted file mode 100644 index 499faa92f9c7..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_details.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementGroupDetails(Model): - """The details of a management group. - - :param version: The version number of the object. - :type version: float - :param updated_time: The date and time when this object was last updated. - :type updated_time: datetime - :param updated_by: The identity of the principal or process that updated - the object. - :type updated_by: str - :param parent: Parent. - :type parent: ~azure.mgmt.managementgroups.models.ParentGroupInfo - """ - - _attribute_map = { - 'version': {'key': 'version', 'type': 'float'}, - 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, - 'updated_by': {'key': 'updatedBy', 'type': 'str'}, - 'parent': {'key': 'parent', 'type': 'ParentGroupInfo'}, - } - - def __init__(self, **kwargs): - super(ManagementGroupDetails, self).__init__(**kwargs) - self.version = kwargs.get('version', None) - self.updated_time = kwargs.get('updated_time', None) - self.updated_by = kwargs.get('updated_by', None) - self.parent = kwargs.get('parent', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_details_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_details_py3.py deleted file mode 100644 index 1d47be815022..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_details_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementGroupDetails(Model): - """The details of a management group. - - :param version: The version number of the object. - :type version: float - :param updated_time: The date and time when this object was last updated. - :type updated_time: datetime - :param updated_by: The identity of the principal or process that updated - the object. - :type updated_by: str - :param parent: Parent. - :type parent: ~azure.mgmt.managementgroups.models.ParentGroupInfo - """ - - _attribute_map = { - 'version': {'key': 'version', 'type': 'float'}, - 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, - 'updated_by': {'key': 'updatedBy', 'type': 'str'}, - 'parent': {'key': 'parent', 'type': 'ParentGroupInfo'}, - } - - def __init__(self, *, version: float=None, updated_time=None, updated_by: str=None, parent=None, **kwargs) -> None: - super(ManagementGroupDetails, self).__init__(**kwargs) - self.version = version - self.updated_time = updated_time - self.updated_by = updated_by - self.parent = parent diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info.py deleted file mode 100644 index 7e016651bf34..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 ManagementGroupInfo(Model): - """The management group resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param tenant_id: The AAD Tenant ID associated with the management group. - For example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ManagementGroupInfo, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.tenant_id = kwargs.get('tenant_id', None) - self.display_name = kwargs.get('display_name', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info_paged.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info_paged.py deleted file mode 100644 index 0ac3a4df1475..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 ManagementGroupInfoPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagementGroupInfo ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagementGroupInfo]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagementGroupInfoPaged, self).__init__(*args, **kwargs) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info_py3.py deleted file mode 100644 index b9d250177747..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_info_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 ManagementGroupInfo(Model): - """The management group resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param tenant_id: The AAD Tenant ID associated with the management group. - For example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - } - - def __init__(self, *, tenant_id: str=None, display_name: str=None, **kwargs) -> None: - super(ManagementGroupInfo, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.tenant_id = tenant_id - self.display_name = display_name diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_py3.py deleted file mode 100644 index 21f12f9bc209..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/management_group_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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 ManagementGroup(Model): - """The management group details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param tenant_id: The AAD Tenant ID associated with the management group. - For example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param roles: The role definitions associated with the management group. - :type roles: list[str] - :param details: Details. - :type details: ~azure.mgmt.managementgroups.models.ManagementGroupDetails - :param children: The list of children. - :type children: - list[~azure.mgmt.managementgroups.models.ManagementGroupChildInfo] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'roles': {'key': 'properties.roles', 'type': '[str]'}, - 'details': {'key': 'properties.details', 'type': 'ManagementGroupDetails'}, - 'children': {'key': 'properties.children', 'type': '[ManagementGroupChildInfo]'}, - } - - def __init__(self, *, tenant_id: str=None, display_name: str=None, roles=None, details=None, children=None, **kwargs) -> None: - super(ManagementGroup, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.tenant_id = tenant_id - self.display_name = display_name - self.roles = roles - self.details = details - self.children = children diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation.py deleted file mode 100644 index 3114ff739ced..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 Operation(Model): - """Operation supported by the Microsoft.Management resource provider. - - 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: Display. - :type display: - ~azure.mgmt.managementgroups.models.OperationDisplayProperties - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayProperties'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = kwargs.get('display', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_display_properties.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_display_properties.py deleted file mode 100644 index cd3859eddd07..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_display_properties.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 OperationDisplayProperties(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: The name of the provider. - :vartype provider: str - :ivar resource: The resource on which the operation is performed. - :vartype resource: str - :ivar operation: The operation that can be performed. - :vartype operation: str - :ivar description: Operation description. - :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(OperationDisplayProperties, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_display_properties_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_display_properties_py3.py deleted file mode 100644 index 9e10f38005c8..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_display_properties_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 OperationDisplayProperties(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: The name of the provider. - :vartype provider: str - :ivar resource: The resource on which the operation is performed. - :vartype resource: str - :ivar operation: The operation that can be performed. - :vartype operation: str - :ivar description: Operation description. - :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(OperationDisplayProperties, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_paged.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_paged.py deleted file mode 100644 index e6d9157f4c05..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_py3.py deleted file mode 100644 index af5129cb8f7c..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 Operation(Model): - """Operation supported by the Microsoft.Management resource provider. - - 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: Display. - :type display: - ~azure.mgmt.managementgroups.models.OperationDisplayProperties - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayProperties'}, - } - - def __init__(self, *, display=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = display diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_results.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_results.py deleted file mode 100644 index e4503472bdaa..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_results.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 OperationResults(Model): - """The results of an asynchronous operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param provisioning_state: Provisioning State. Possible values include: - 'Updating' - :type provisioning_state: str or ~azure.mgmt.managementgroups.models.enum - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationResults, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_results_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_results_py3.py deleted file mode 100644 index 04308fb22f02..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/operation_results_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 OperationResults(Model): - """The results of an asynchronous operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the management group. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :param provisioning_state: Provisioning State. Possible values include: - 'Updating' - :type provisioning_state: str or ~azure.mgmt.managementgroups.models.enum - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, *, provisioning_state=None, **kwargs) -> None: - super(OperationResults, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.provisioning_state = provisioning_state diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/parent_group_info.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/parent_group_info.py deleted file mode 100644 index 4f6672a63570..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/parent_group_info.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 ParentGroupInfo(Model): - """(Optional) The ID of the parent management group. - - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - :param name: The name of the parent management group - :type name: str - :param display_name: The friendly name of the parent management group. - :type display_name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ParentGroupInfo, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/parent_group_info_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/parent_group_info_py3.py deleted file mode 100644 index 16ed06de5838..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/parent_group_info_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 ParentGroupInfo(Model): - """(Optional) The ID of the parent management group. - - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - :param name: The name of the parent management group - :type name: str - :param display_name: The friendly name of the parent management group. - :type display_name: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, name: str=None, display_name: str=None, **kwargs) -> None: - super(ParentGroupInfo, self).__init__(**kwargs) - self.id = id - self.name = name - self.display_name = display_name diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/patch_management_group_request.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/patch_management_group_request.py deleted file mode 100644 index a48de68753cd..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/patch_management_group_request.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 PatchManagementGroupRequest(Model): - """Management group patch parameters. - - :param display_name: The friendly name of the management group. - :type display_name: str - :param parent_id: (Optional) The fully qualified ID for the parent - management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type parent_id: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'parent_id': {'key': 'parentId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PatchManagementGroupRequest, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.parent_id = kwargs.get('parent_id', None) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/patch_management_group_request_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/patch_management_group_request_py3.py deleted file mode 100644 index 5a5b4cc26d76..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/patch_management_group_request_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 PatchManagementGroupRequest(Model): - """Management group patch parameters. - - :param display_name: The friendly name of the management group. - :type display_name: str - :param parent_id: (Optional) The fully qualified ID for the parent - management group. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type parent_id: str - """ - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'parent_id': {'key': 'parentId', 'type': 'str'}, - } - - def __init__(self, *, display_name: str=None, parent_id: str=None, **kwargs) -> None: - super(PatchManagementGroupRequest, self).__init__(**kwargs) - self.display_name = display_name - self.parent_id = parent_id diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/tenant_backfill_status_result.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/tenant_backfill_status_result.py deleted file mode 100644 index e13bbd7119dc..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/tenant_backfill_status_result.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 TenantBackfillStatusResult(Model): - """The tenant backfill status. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tenant_id: The AAD Tenant ID associated with the management group. - For example, 00000000-0000-0000-0000-000000000000 - :vartype tenant_id: str - :ivar status: The status of the Tenant Backfill. Possible values include: - 'NotStarted', 'NotStartedButGroupsExist', 'Started', 'Failed', - 'Cancelled', 'Completed' - :vartype status: str or ~azure.mgmt.managementgroups.models.Status - """ - - _validation = { - 'tenant_id': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'Status'}, - } - - def __init__(self, **kwargs): - super(TenantBackfillStatusResult, self).__init__(**kwargs) - self.tenant_id = None - self.status = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/tenant_backfill_status_result_py3.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/tenant_backfill_status_result_py3.py deleted file mode 100644 index 61dddcc78e84..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/models/tenant_backfill_status_result_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 TenantBackfillStatusResult(Model): - """The tenant backfill status. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tenant_id: The AAD Tenant ID associated with the management group. - For example, 00000000-0000-0000-0000-000000000000 - :vartype tenant_id: str - :ivar status: The status of the Tenant Backfill. Possible values include: - 'NotStarted', 'NotStartedButGroupsExist', 'Started', 'Failed', - 'Cancelled', 'Completed' - :vartype status: str or ~azure.mgmt.managementgroups.models.Status - """ - - _validation = { - 'tenant_id': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'Status'}, - } - - def __init__(self, **kwargs) -> None: - super(TenantBackfillStatusResult, self).__init__(**kwargs) - self.tenant_id = None - self.status = None diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/__init__.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/__init__.py index 3baf43e0f0a7..d1a633aab8e0 100644 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/__init__.py +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/__init__.py @@ -9,14 +9,18 @@ # regenerated. # -------------------------------------------------------------------------- -from .management_groups_operations import ManagementGroupsOperations -from .management_group_subscriptions_operations import ManagementGroupSubscriptionsOperations -from .operations import Operations -from .entities_operations import EntitiesOperations +from ._management_groups_operations import ManagementGroupsOperations +from ._management_group_subscriptions_operations import ManagementGroupSubscriptionsOperations +from ._hierarchy_settings_operations import HierarchySettingsOperations +from ._operations import Operations +from ._entities_operations import EntitiesOperations +from ._management_groups_api_operations import ManagementGroupsAPIOperationsMixin __all__ = [ 'ManagementGroupsOperations', 'ManagementGroupSubscriptionsOperations', + 'HierarchySettingsOperations', 'Operations', 'EntitiesOperations', + 'ManagementGroupsAPIOperationsMixin', ] diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/entities_operations.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_entities_operations.py similarity index 77% rename from sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/entities_operations.py rename to sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_entities_operations.py index 7b0f2e6e5b6a..8d8ea5bbd429 100644 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/entities_operations.py +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_entities_operations.py @@ -18,11 +18,13 @@ class EntitiesOperations(object): """EntitiesOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :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: Version of the API to be used with the client request. The current version is 2018-01-01-preview. Constant value: "2018-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-01-preview. Constant value: "2020-05-01". """ models = models @@ -32,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-01-preview" + self.api_version = "2020-05-01" self.config = config @@ -40,12 +42,13 @@ def list( self, skiptoken=None, skip=None, top=None, select=None, search=None, filter=None, view=None, group_name=None, cache_control="no-cache", custom_headers=None, raw=False, **operation_config): """List all entities (Management Groups, Subscriptions, etc.) for the authenticated user. + . :param skiptoken: Page continuation token is only used if a previous - operation returned a partial result. If a previous response contains a - nextLink element, the value of the nextLink element will include a - token parameter that specifies a starting point to use for subsequent - calls. + operation returned a partial result. + If a previous response contains a nextLink element, the value of the + nextLink element will include a token parameter that specifies a + starting point to use for subsequent calls. :type skiptoken: str :param skip: Number of entities to skip over when retrieving results. Passing this in will override $skipToken. @@ -62,21 +65,28 @@ def list( :type select: str :param search: The $search parameter is used in conjunction with the $filter parameter to return three different outputs depending on the - parameter passed in. With $search=AllowedParents the API will return - the entity info of all groups that the requested entity will be able - to reparent to as determined by the user's permissions. With - $search=AllowedChildren the API will return the entity info of all - entities that can be added as children of the requested entity. With - $search=ParentAndFirstLevelChildren the API will return the parent and - first level of children that the user has either direct access to or - indirect access via one of their descendants. Possible values include: + parameter passed in. + With $search=AllowedParents the API will return the entity info of all + groups that the requested entity will be able to reparent to as + determined by the user's permissions. + With $search=AllowedChildren the API will return the entity info of + all entities that can be added as children of the requested entity. + With $search=ParentAndFirstLevelChildren the API will return the + parent and first level of children that the user has either direct + access to or indirect access via one of their descendants. + With $search=ParentOnly the API will return only the group if the user + has access to at least one of the descendants of the group. + With $search=ChildrenOnly the API will return only the first level of + children of the group entity info specified in $filter. The user must + have direct access to the children entities or one of it's descendants + for it to show up in the results. Possible values include: 'AllowedParents', 'AllowedChildren', 'ParentAndFirstLevelChildren', 'ParentOnly', 'ChildrenOnly' :type search: str - :param filter: The filter parameter allows you to filter on the name - or display name fields. You can check for equality on the name field - (e.g. name eq '{entityName}') and you can check for substrings on - either the name or display name fields(e.g. contains(name, + :param filter: The filter parameter allows you to filter on the the + name or display name fields. You can check for equality on the name + field (e.g. name eq '{entityName}') and you can check for substrings + on either the name or display name fields(e.g. contains(name, '{substringToSearch}'), contains(displayName, '{substringToSearch')). Note that the '{entityName}' and '{substringToSearch}' fields are checked case insensitively. @@ -102,8 +112,7 @@ def list( :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -146,6 +155,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -154,12 +168,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.Management/getEntities'} diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_hierarchy_settings_operations.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_hierarchy_settings_operations.py new file mode 100644 index 000000000000..3fcf7dbe65ed --- /dev/null +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_hierarchy_settings_operations.py @@ -0,0 +1,335 @@ +# 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 HierarchySettingsOperations(object): + """HierarchySettingsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Version of the API to be used with the client request. The current version is 2018-01-01-preview. Constant value: "2020-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-01" + + self.config = config + + def list( + self, group_id, custom_headers=None, raw=False, **operation_config): + """Gets all the hierarchy settings defined at the Management Group level. + Settings can only be set on the root Management Group of the hierarchy. + . + + :param group_id: Management Group ID. + :type group_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: HierarchySettingsList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managementgroups.models.HierarchySettingsList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_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' + 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HierarchySettingsList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings'} + + def get( + self, group_id, custom_headers=None, raw=False, **operation_config): + """Gets the hierarchy settings defined at the Management Group level. + Settings can only be set on the root Management Group of the hierarchy. + . + + :param group_id: Management Group ID. + :type group_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: HierarchySettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managementgroups.models.HierarchySettings or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_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' + 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HierarchySettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} + + def create_or_update( + self, group_id, create_tenant_settings_request, custom_headers=None, raw=False, **operation_config): + """Creates or updates the hierarchy settings defined at the Management + Group level. + . + + :param group_id: Management Group ID. + :type group_id: str + :param create_tenant_settings_request: Tenant level settings request + parameter. + :type create_tenant_settings_request: + ~azure.mgmt.managementgroups.models.CreateOrUpdateSettingsRequest + :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: HierarchySettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managementgroups.models.HierarchySettings or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_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(create_tenant_settings_request, 'CreateOrUpdateSettingsRequest') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HierarchySettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} + + def update( + self, group_id, create_tenant_settings_request, custom_headers=None, raw=False, **operation_config): + """Updates the hierarchy settings defined at the Management Group level. + . + + :param group_id: Management Group ID. + :type group_id: str + :param create_tenant_settings_request: Tenant level settings request + parameter. + :type create_tenant_settings_request: + ~azure.mgmt.managementgroups.models.CreateOrUpdateSettingsRequest + :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: HierarchySettings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managementgroups.models.HierarchySettings or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_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(create_tenant_settings_request, 'CreateOrUpdateSettingsRequest') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HierarchySettings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} + + def delete( + self, group_id, custom_headers=None, raw=False, **operation_config): + """Deletes the hierarchy settings defined at the Management Group level. + . + + :param group_id: Management Group ID. + :type group_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_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 = {} + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_group_subscriptions_operations.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_group_subscriptions_operations.py new file mode 100644 index 000000000000..459b674c7dec --- /dev/null +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_group_subscriptions_operations.py @@ -0,0 +1,308 @@ +# 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 ManagementGroupSubscriptionsOperations(object): + """ManagementGroupSubscriptionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Version of the API to be used with the client request. The current version is 2018-01-01-preview. Constant value: "2020-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-01" + + self.config = config + + def create( + self, group_id, subscription_id, cache_control="no-cache", custom_headers=None, raw=False, **operation_config): + """Associates existing subscription with the management group. + . + + :param group_id: Management Group ID. + :type group_id: str + :param subscription_id: Subscription ID. + :type subscription_id: str + :param cache_control: Indicates that the request shouldn't utilize any + caches. + :type cache_control: 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: SubscriptionUnderManagementGroup or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.managementgroups.models.SubscriptionUnderManagementGroup + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", 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' + 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 cache_control is not None: + header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str') + 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.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubscriptionUnderManagementGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} + + def delete( + self, group_id, subscription_id, cache_control="no-cache", custom_headers=None, raw=False, **operation_config): + """De-associates subscription from the management group. + . + + :param group_id: Management Group ID. + :type group_id: str + :param subscription_id: Subscription ID. + :type subscription_id: str + :param cache_control: Indicates that the request shouldn't utilize any + caches. + :type cache_control: 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:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", 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 = {} + 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 cache_control is not None: + header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str') + 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} + + def get_subscription( + self, group_id, subscription_id, cache_control="no-cache", custom_headers=None, raw=False, **operation_config): + """Retrieves details about given subscription which is associated with the + management group. + . + + :param group_id: Management Group ID. + :type group_id: str + :param subscription_id: Subscription ID. + :type subscription_id: str + :param cache_control: Indicates that the request shouldn't utilize any + caches. + :type cache_control: 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: SubscriptionUnderManagementGroup or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.managementgroups.models.SubscriptionUnderManagementGroup + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_subscription.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_id, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", 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' + 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 cache_control is not None: + header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str') + 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubscriptionUnderManagementGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_subscription.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} + + def get_subscriptions_under_management_group( + self, group_id, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Retrieves details about all subscriptions which are associated with the + management group. + . + + :param group_id: Management Group ID. + :type group_id: str + :param skiptoken: Page continuation token is only used if a previous + operation returned a partial result. + If a previous response contains a nextLink element, the value of the + nextLink element will include a token parameter that specifies a + starting point to use for subsequent calls. + :type skiptoken: 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 SubscriptionUnderManagementGroup + :rtype: + ~azure.mgmt.managementgroups.models.SubscriptionUnderManagementGroupPaged[~azure.mgmt.managementgroups.models.SubscriptionUnderManagementGroup] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get_subscriptions_under_management_group.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_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 skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, '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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SubscriptionUnderManagementGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get_subscriptions_under_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions'} diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/management_groups_api.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_groups_api_operations.py similarity index 68% rename from sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/management_groups_api.py rename to sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_groups_api_operations.py index decd5ff43306..22aee480be81 100644 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/management_groups_api.py +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_groups_api_operations.py @@ -9,88 +9,14 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION from msrest.pipeline import ClientRawResponse from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling +from .. import models import uuid -from .operations.management_groups_operations import ManagementGroupsOperations -from .operations.management_group_subscriptions_operations import ManagementGroupSubscriptionsOperations -from .operations.operations import Operations -from .operations.entities_operations import EntitiesOperations -from . import models -class ManagementGroupsAPIConfiguration(AzureConfiguration): - """Configuration for ManagementGroupsAPI - 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 str base_url: Service URL - """ - - def __init__( - self, credentials, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(ManagementGroupsAPIConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-managementgroups/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - - -class ManagementGroupsAPI(SDKClient): - """The Azure Management Groups API enables consolidation of multiple subscriptions/resources into an organizational hierarchy and centrally manage access control, policies, alerting and reporting for those resources. - - :ivar config: Configuration for client. - :vartype config: ManagementGroupsAPIConfiguration - - :ivar management_groups: ManagementGroups operations - :vartype management_groups: azure.mgmt.managementgroups.operations.ManagementGroupsOperations - :ivar management_group_subscriptions: ManagementGroupSubscriptions operations - :vartype management_group_subscriptions: azure.mgmt.managementgroups.operations.ManagementGroupSubscriptionsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.managementgroups.operations.Operations - :ivar entities: Entities operations - :vartype entities: azure.mgmt.managementgroups.operations.EntitiesOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param str base_url: Service URL - """ - - def __init__( - self, credentials, base_url=None): - - self.config = ManagementGroupsAPIConfiguration(credentials, base_url) - super(ManagementGroupsAPI, 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-03-01-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.management_groups = ManagementGroupsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.management_group_subscriptions = ManagementGroupSubscriptionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.entities = EntitiesOperations( - self._client, self.config, self._serialize, self._deserialize) +class ManagementGroupsAPIOperationsMixin(object): def check_name_availability( self, check_name_availability_request, custom_headers=None, raw=False, **operation_config): @@ -141,7 +67,6 @@ def check_name_availability( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CheckNameAvailabilityResult', response) @@ -192,7 +117,6 @@ def start_tenant_backfill( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('TenantBackfillStatusResult', response) @@ -243,7 +167,6 @@ def tenant_backfill_status( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('TenantBackfillStatusResult', response) diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/management_groups_operations.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_groups_operations.py similarity index 75% rename from sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/management_groups_operations.py rename to sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_groups_operations.py index bfffc6c47fe9..30561435a50f 100644 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/management_groups_operations.py +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_management_groups_operations.py @@ -20,11 +20,13 @@ class ManagementGroupsOperations(object): """ManagementGroupsOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :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: Version of the API to be used with the client request. The current version is 2018-01-01-preview. Constant value: "2018-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-01-preview. Constant value: "2020-05-01". """ models = models @@ -34,22 +36,23 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-01-preview" + self.api_version = "2020-05-01" self.config = config def list( self, cache_control="no-cache", skiptoken=None, custom_headers=None, raw=False, **operation_config): """List management groups for the authenticated user. + . :param cache_control: Indicates that the request shouldn't utilize any caches. :type cache_control: str :param skiptoken: Page continuation token is only used if a previous - operation returned a partial result. If a previous response contains a - nextLink element, the value of the nextLink element will include a - token parameter that specifies a starting point to use for subsequent - calls. + operation returned a partial result. + If a previous response contains a nextLink element, the value of the + nextLink element will include a token parameter that specifies a + starting point to use for subsequent calls. :type skiptoken: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -62,8 +65,7 @@ def list( :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -92,6 +94,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -100,12 +107,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ManagementGroupInfoPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.ManagementGroupInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.ManagementGroupInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.Management/managementGroups'} @@ -113,12 +118,14 @@ def internal_paging(next_link=None, raw=False): def get( self, group_id, expand=None, recurse=None, filter=None, cache_control="no-cache", custom_headers=None, raw=False, **operation_config): """Get the details of the management group. + . :param group_id: Management Group ID. :type group_id: str :param expand: The $expand=children query string parameter allows clients to request inclusion of children in the response payload. - Possible values include: 'children' + $expand=path includes the path from the root group to the current + group. Possible values include: 'children', 'path' :type expand: str :param recurse: The $recurse=true query string parameter allows clients to request inclusion of entire hierarchy in the response @@ -179,7 +186,6 @@ def get( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ManagementGroup', response) @@ -228,23 +234,35 @@ def _create_or_update_initial( raise models.ErrorResponseException(self._deserialize, response) deserialized = None + header_dict = {} if response.status_code == 200: deserialized = self._deserialize('ManagementGroup', response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + } if response.status_code == 202: - deserialized = self._deserialize('OperationResults', response) + deserialized = self._deserialize('AzureAsyncOperationResults', response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized def create_or_update( self, group_id, create_management_group_request, cache_control="no-cache", custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update a management group. If a management group is already - created and a subsequent create request is issued with different - properties, the management group properties will be updated. + """Create or update a management group. + If a management group is already created and a subsequent create + request is issued with different properties, the management group + properties will be updated. + . :param group_id: Management Group ID. :type group_id: str @@ -277,10 +295,15 @@ def create_or_update( ) def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + } deserialized = self._deserialize('object', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized @@ -297,6 +320,7 @@ def get_long_running_output(response): def update( self, group_id, patch_group_request, cache_control="no-cache", custom_headers=None, raw=False, **operation_config): """Update a management group. + . :param group_id: Management Group ID. :type group_id: str @@ -352,7 +376,6 @@ def update( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ManagementGroup', response) @@ -397,20 +420,27 @@ def _delete_initial( raise models.ErrorResponseException(self._deserialize, response) deserialized = None + header_dict = {} if response.status_code == 202: - deserialized = self._deserialize('OperationResults', response) + deserialized = self._deserialize('AzureAsyncOperationResults', response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized def delete( self, group_id, cache_control="no-cache", custom_headers=None, raw=False, polling=True, **operation_config): - """Delete management group. If a management group contains child - resources, the request will fail. + """Delete management group. + If a management group contains child resources, the request will fail. + . :param group_id: Management Group ID. :type group_id: str @@ -422,12 +452,13 @@ def delete( 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 OperationResults or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns + AzureAsyncOperationResults or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.managementgroups.models.OperationResults] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.managementgroups.models.AzureAsyncOperationResults] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.managementgroups.models.OperationResults]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.managementgroups.models.AzureAsyncOperationResults]] :raises: :class:`ErrorResponseException` """ @@ -440,10 +471,15 @@ def delete( ) def get_long_running_output(response): - deserialized = self._deserialize('OperationResults', response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('AzureAsyncOperationResults', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized @@ -456,3 +492,84 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} + + def get_descendants( + self, group_id, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all entities that descend from a management group. + . + + :param group_id: Management Group ID. + :type group_id: str + :param skiptoken: Page continuation token is only used if a previous + operation returned a partial result. + If a previous response contains a nextLink element, the value of the + nextLink element will include a token parameter that specifies a + starting point to use for subsequent calls. + :type skiptoken: str + :param top: Number of elements to return when retrieving results. + Passing this in will override $skipToken. + :type top: int + :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 DescendantInfo + :rtype: + ~azure.mgmt.managementgroups.models.DescendantInfoPaged[~azure.mgmt.managementgroups.models.DescendantInfo] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get_descendants.metadata['url'] + path_format_arguments = { + 'groupId': self._serialize.url("group_id", group_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 skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DescendantInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get_descendants.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/descendants'} diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/operations.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_operations.py similarity index 88% rename from sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/operations.py rename to sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_operations.py index 9e7f9a68a123..dd28d470e76e 100644 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/operations.py +++ b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/_operations.py @@ -18,11 +18,13 @@ class Operations(object): """Operations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :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: Version of the API to be used with the client request. The current version is 2018-01-01-preview. Constant value: "2018-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-01-preview. Constant value: "2020-05-01". """ models = models @@ -32,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-01-preview" + self.api_version = "2020-05-01" self.config = config @@ -51,8 +53,7 @@ def list( :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -77,6 +78,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -85,12 +91,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.Management/operations'} diff --git a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/management_group_subscriptions_operations.py b/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/management_group_subscriptions_operations.py deleted file mode 100644 index 408bfd37de34..000000000000 --- a/sdk/managementgroups/azure-mgmt-managementgroups/azure/mgmt/managementgroups/operations/management_group_subscriptions_operations.py +++ /dev/null @@ -1,149 +0,0 @@ -# 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 ManagementGroupSubscriptionsOperations(object): - """ManagementGroupSubscriptionsOperations 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: Version of the API to be used with the client request. The current version is 2018-01-01-preview. Constant value: "2018-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - - self.config = config - - def create( - self, group_id, subscription_id, cache_control="no-cache", custom_headers=None, raw=False, **operation_config): - """Associates existing subscription with the management group. - - :param group_id: Management Group ID. - :type group_id: str - :param subscription_id: Subscription ID. - :type subscription_id: str - :param cache_control: Indicates that the request shouldn't utilize any - caches. - :type cache_control: 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:`ErrorResponseException` - """ - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'groupId': self._serialize.url("group_id", group_id, 'str'), - 'subscriptionId': self._serialize.url("subscription_id", 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 = {} - 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 cache_control is not None: - header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str') - 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.put(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - create.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} - - def delete( - self, group_id, subscription_id, cache_control="no-cache", custom_headers=None, raw=False, **operation_config): - """De-associates subscription from the management group. - - :param group_id: Management Group ID. - :type group_id: str - :param subscription_id: Subscription ID. - :type subscription_id: str - :param cache_control: Indicates that the request shouldn't utilize any - caches. - :type cache_control: 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:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'groupId': self._serialize.url("group_id", group_id, 'str'), - 'subscriptionId': self._serialize.url("subscription_id", 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 = {} - 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 cache_control is not None: - header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str') - 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 [204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'}