diff --git a/src/managementgroup/HISTORY.rst b/src/managementgroup/HISTORY.rst
new file mode 100644
index 00000000000..1c139576ba0
--- /dev/null
+++ b/src/managementgroup/HISTORY.rst
@@ -0,0 +1,8 @@
+.. :changelog:
+
+Release History
+===============
+
+0.1.0
+++++++
+* Initial release.
diff --git a/src/managementgroup/README.md b/src/managementgroup/README.md
new file mode 100644
index 00000000000..e4f5f183b5a
--- /dev/null
+++ b/src/managementgroup/README.md
@@ -0,0 +1,117 @@
+# Azure CLI managementgroup Extension #
+This is the extension for managementgroup
+
+### How to use ###
+Install this extension using the below CLI command
+```
+az extension add --name managementgroup
+```
+
+### Included Features ###
+#### managementgroup management-group ####
+##### Create #####
+```
+az managementgroup management-group create --cache-control "no-cache" --display-name "ChildGroup" \
+ --id "/providers/Microsoft.Management/managementGroups/RootGroup" --group-id "ChildGroup"
+```
+##### Show #####
+```
+az managementgroup management-group show --cache-control "no-cache" --group-id "20000000-0001-0000-0000-000000000000"
+```
+##### Show #####
+```
+az managementgroup management-group show --expand "ancestors" --cache-control "no-cache" \
+ --group-id "20000000-0001-0000-0000-00000000000"
+```
+##### Show #####
+```
+az managementgroup management-group show --expand "children" --cache-control "no-cache" \
+ --group-id "20000000-0001-0000-0000-000000000000"
+```
+##### Show #####
+```
+az managementgroup management-group show --expand "path" --cache-control "no-cache" \
+ --group-id "20000000-0001-0000-0000-000000000000"
+```
+##### Show #####
+```
+az managementgroup management-group show --expand "children" --recurse true --cache-control "no-cache" \
+ --group-id "20000000-0001-0000-0000-000000000000"
+```
+##### List #####
+```
+az managementgroup management-group list --cache-control "no-cache"
+```
+##### Update #####
+```
+az managementgroup management-group update --cache-control "no-cache" --group-id "ChildGroup" \
+ --display-name "AlternateDisplayName" \
+ --parent-group-id "/providers/Microsoft.Management/managementGroups/AlternateRootGroup"
+```
+##### Show-descendant #####
+```
+az managementgroup management-group show-descendant --group-id "20000000-0000-0000-0000-000000000000"
+```
+##### Delete #####
+```
+az managementgroup management-group delete --cache-control "no-cache" --group-id "GroupToDelete"
+```
+#### managementgroup management-group-subscription ####
+##### Create #####
+```
+az managementgroup management-group-subscription create --cache-control "no-cache" --group-id "Group" \
+ --subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
+```
+##### Show-subscription #####
+```
+az managementgroup management-group-subscription show-subscription --cache-control "no-cache" --group-id "Group" \
+ --subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
+```
+##### Show-subscription-under-management-group #####
+```
+az managementgroup management-group-subscription show-subscription-under-management-group --group-id "Group"
+```
+##### Delete #####
+```
+az managementgroup management-group-subscription delete --cache-control "no-cache" --group-id "Group" \
+ --subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
+```
+#### managementgroup hierarchy-setting ####
+##### Create #####
+```
+az managementgroup hierarchy-setting create \
+ --default-management-group "/providers/Microsoft.Management/managementGroups/DefaultGroup" \
+ --require-authorization-for-group-creation true --group-id "root"
+```
+##### Show #####
+```
+az managementgroup hierarchy-setting show --group-id "root"
+```
+##### List #####
+```
+az managementgroup hierarchy-setting list --group-id "root"
+```
+##### Update #####
+```
+az managementgroup hierarchy-setting update \
+ --default-management-group "/providers/Microsoft.Management/managementGroups/DefaultGroup" \
+ --require-authorization-for-group-creation true --group-id "root"
+```
+##### Delete #####
+```
+az managementgroup hierarchy-setting delete --group-id "root"
+```
+#### managementgroup ####
+##### Start-tenant-backfill #####
+```
+az managementgroup start-tenant-backfill
+```
+##### Tenant-backfill-status #####
+```
+az managementgroup tenant-backfill-status
+```
+#### managementgroup entity ####
+##### List #####
+```
+az managementgroup entity list
+```
\ No newline at end of file
diff --git a/src/managementgroup/azext_managementgroup/__init__.py b/src/managementgroup/azext_managementgroup/__init__.py
new file mode 100644
index 00000000000..4ecd4a8fbf9
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/__init__.py
@@ -0,0 +1,50 @@
+# --------------------------------------------------------------------------
+# 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 azure.cli.core import AzCommandsLoader
+from azext_managementgroup.generated._help import helps # pylint: disable=unused-import
+try:
+ from azext_managementgroup.manual._help import helps # pylint: disable=reimported
+except ImportError:
+ pass
+
+
+class ManagementGroupsAPICommandsLoader(AzCommandsLoader):
+
+ def __init__(self, cli_ctx=None):
+ from azure.cli.core.commands import CliCommandType
+ from azext_managementgroup.generated._client_factory import cf_managementgroup_cl
+ managementgroup_custom = CliCommandType(
+ operations_tmpl='azext_managementgroup.custom#{}',
+ client_factory=cf_managementgroup_cl)
+ parent = super(ManagementGroupsAPICommandsLoader, self)
+ parent.__init__(cli_ctx=cli_ctx, custom_command_type=managementgroup_custom)
+
+ def load_command_table(self, args):
+ from azext_managementgroup.generated.commands import load_command_table
+ load_command_table(self, args)
+ try:
+ from azext_managementgroup.manual.commands import load_command_table as load_command_table_manual
+ load_command_table_manual(self, args)
+ except ImportError:
+ pass
+ return self.command_table
+
+ def load_arguments(self, command):
+ from azext_managementgroup.generated._params import load_arguments
+ load_arguments(self, command)
+ try:
+ from azext_managementgroup.manual._params import load_arguments as load_arguments_manual
+ load_arguments_manual(self, command)
+ except ImportError:
+ pass
+
+
+COMMAND_LOADER_CLS = ManagementGroupsAPICommandsLoader
diff --git a/src/managementgroup/azext_managementgroup/action.py b/src/managementgroup/azext_managementgroup/action.py
new file mode 100644
index 00000000000..d95d53bf711
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/action.py
@@ -0,0 +1,17 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=wildcard-import
+# pylint: disable=unused-wildcard-import
+
+from .generated.action import * # noqa: F403
+try:
+ from .manual.action import * # noqa: F403
+except ImportError:
+ pass
diff --git a/src/managementgroup/azext_managementgroup/azext_metadata.json b/src/managementgroup/azext_managementgroup/azext_metadata.json
new file mode 100644
index 00000000000..cfc30c747c7
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/azext_metadata.json
@@ -0,0 +1,4 @@
+{
+ "azext.isExperimental": true,
+ "azext.minCliCoreVersion": "2.15.0"
+}
\ No newline at end of file
diff --git a/src/managementgroup/azext_managementgroup/custom.py b/src/managementgroup/azext_managementgroup/custom.py
new file mode 100644
index 00000000000..dbe9d5f9742
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/custom.py
@@ -0,0 +1,17 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=wildcard-import
+# pylint: disable=unused-wildcard-import
+
+from .generated.custom import * # noqa: F403
+try:
+ from .manual.custom import * # noqa: F403
+except ImportError:
+ pass
diff --git a/src/managementgroup/azext_managementgroup/generated/__init__.py b/src/managementgroup/azext_managementgroup/generated/__init__.py
new file mode 100644
index 00000000000..c9cfdc73e77
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/generated/__init__.py
@@ -0,0 +1,12 @@
+# 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.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/managementgroup/azext_managementgroup/generated/_client_factory.py b/src/managementgroup/azext_managementgroup/generated/_client_factory.py
new file mode 100644
index 00000000000..4121cfe6283
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/generated/_client_factory.py
@@ -0,0 +1,34 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+
+
+def cf_managementgroup_cl(cli_ctx, *_):
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
+ from azext_managementgroup.vendored_sdks.managementgroup import ManagementGroupsAPI
+ return get_mgmt_service_client(cli_ctx,
+ ManagementGroupsAPI,
+ subscription_bound=False,
+ base_url_bound=True)
+
+
+def cf_management_group(cli_ctx, *_):
+ return cf_managementgroup_cl(cli_ctx).management_groups
+
+
+def cf_management_group_subscription(cli_ctx, *_):
+ return cf_managementgroup_cl(cli_ctx).management_group_subscriptions
+
+
+def cf_hierarchy_setting(cli_ctx, *_):
+ return cf_managementgroup_cl(cli_ctx).hierarchy_settings
+
+
+def cf_entity(cli_ctx, *_):
+ return cf_managementgroup_cl(cli_ctx).entities
diff --git a/src/managementgroup/azext_managementgroup/generated/_help.py b/src/managementgroup/azext_managementgroup/generated/_help.py
new file mode 100644
index 00000000000..f12a76c8066
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/generated/_help.py
@@ -0,0 +1,245 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-lines
+
+from knack.help_files import helps
+
+
+helps['managementgroup management-group'] = """
+ type: group
+ short-summary: Manage management group with managementgroup
+"""
+
+helps['managementgroup management-group list'] = """
+ type: command
+ short-summary: "List management groups for the authenticated user."
+ examples:
+ - name: ListManagementGroups
+ text: |-
+ az managementgroup management-group list --cache-control "no-cache"
+"""
+
+helps['managementgroup management-group show'] = """
+ type: command
+ short-summary: "Get the details of the management group."
+ examples:
+ - name: GetManagementGroup
+ text: |-
+ az managementgroup management-group show --cache-control "no-cache" --group-id \
+"20000000-0001-0000-0000-000000000000"
+ - name: GetManagementGroupWithAncestors
+ text: |-
+ az managementgroup management-group show --expand "ancestors" --cache-control "no-cache" --group-id \
+"20000000-0001-0000-0000-00000000000"
+ - name: GetManagementGroupWithExpand
+ text: |-
+ az managementgroup management-group show --expand "children" --cache-control "no-cache" --group-id \
+"20000000-0001-0000-0000-000000000000"
+ - name: GetManagementGroupWithPath
+ text: |-
+ az managementgroup management-group show --expand "path" --cache-control "no-cache" --group-id \
+"20000000-0001-0000-0000-000000000000"
+ - name: GetManagementGroupsWithExpandAndRecurse
+ text: |-
+ az managementgroup management-group show --expand "children" --recurse true --cache-control "no-cache" \
+--group-id "20000000-0001-0000-0000-000000000000"
+"""
+
+helps['managementgroup management-group create'] = """
+ type: command
+ short-summary: "Create 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."
+ examples:
+ - name: PutManagementGroup
+ text: |-
+ az managementgroup management-group create --cache-control "no-cache" --display-name "ChildGroup" --id \
+"/providers/Microsoft.Management/managementGroups/RootGroup" --group-id "ChildGroup"
+"""
+
+helps['managementgroup management-group update'] = """
+ type: command
+ short-summary: "Update a management group."
+ examples:
+ - name: PatchManagementGroup
+ text: |-
+ az managementgroup management-group update --cache-control "no-cache" --group-id "ChildGroup" \
+--display-name "AlternateDisplayName" --parent-group-id "/providers/Microsoft.Management/managementGroups/AlternateRoot\
+Group"
+"""
+
+helps['managementgroup management-group delete'] = """
+ type: command
+ short-summary: "Delete management group. If a management group contains child resources, the request will fail."
+ examples:
+ - name: DeleteManagementGroup
+ text: |-
+ az managementgroup management-group delete --cache-control "no-cache" --group-id "GroupToDelete"
+"""
+
+helps['managementgroup management-group show-descendant'] = """
+ type: command
+ short-summary: "List all entities that descend from a management group."
+ examples:
+ - name: GetDescendants
+ text: |-
+ az managementgroup management-group show-descendant --group-id "20000000-0000-0000-0000-000000000000"
+"""
+
+helps['managementgroup management-group wait'] = """
+ type: command
+ short-summary: Place the CLI in a waiting state until a condition of the managementgroup management-group is met.
+ examples:
+ - name: Pause executing next line of CLI script until the managementgroup management-group is successfully \
+created.
+ text: |-
+ az managementgroup management-group wait --expand "children" --recurse true --cache-control "no-cache" \
+--group-id "20000000-0001-0000-0000-000000000000" --created
+ - name: Pause executing next line of CLI script until the managementgroup management-group is successfully \
+deleted.
+ text: |-
+ az managementgroup management-group wait --expand "children" --recurse true --cache-control "no-cache" \
+--group-id "20000000-0001-0000-0000-000000000000" --deleted
+"""
+
+helps['managementgroup management-group-subscription'] = """
+ type: group
+ short-summary: Manage management group subscription with managementgroup
+"""
+
+helps['managementgroup management-group-subscription create'] = """
+ type: command
+ short-summary: "Associates existing subscription with the management group."
+ examples:
+ - name: AddSubscriptionToManagementGroup
+ text: |-
+ az managementgroup management-group-subscription create --cache-control "no-cache" --group-id "Group" \
+--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
+"""
+
+helps['managementgroup management-group-subscription delete'] = """
+ type: command
+ short-summary: "De-associates subscription from the management group."
+ examples:
+ - name: DeleteSubscriptionFromManagementGroup
+ text: |-
+ az managementgroup management-group-subscription delete --cache-control "no-cache" --group-id "Group" \
+--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
+"""
+
+helps['managementgroup management-group-subscription show-subscription'] = """
+ type: command
+ short-summary: "Retrieves details about given subscription which is associated with the management group."
+ examples:
+ - name: GetSubscriptionFromManagementGroup
+ text: |-
+ az managementgroup management-group-subscription show-subscription --cache-control "no-cache" \
+--group-id "Group" --subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
+"""
+
+helps['managementgroup management-group-subscription show-subscription-under-management-group'] = """
+ type: command
+ short-summary: "Retrieves details about all subscriptions which are associated with the management group."
+ examples:
+ - name: GetAllSubscriptionsFromManagementGroup
+ text: |-
+ az managementgroup management-group-subscription show-subscription-under-management-group --group-id \
+"Group"
+"""
+
+helps['managementgroup hierarchy-setting'] = """
+ type: group
+ short-summary: Manage hierarchy setting with managementgroup
+"""
+
+helps['managementgroup hierarchy-setting list'] = """
+ type: command
+ short-summary: "Gets all the hierarchy settings defined at the Management Group level. Settings can only be set on \
+the root Management Group of the hierarchy."
+ examples:
+ - name: ListGroupSettings
+ text: |-
+ az managementgroup hierarchy-setting list --group-id "root"
+"""
+
+helps['managementgroup hierarchy-setting show'] = """
+ type: command
+ short-summary: "Gets the hierarchy settings defined at the Management Group level. Settings can only be set on the \
+root Management Group of the hierarchy."
+ examples:
+ - name: GetGroupSettings
+ text: |-
+ az managementgroup hierarchy-setting show --group-id "root"
+"""
+
+helps['managementgroup hierarchy-setting create'] = """
+ type: command
+ short-summary: "Create the hierarchy settings defined at the Management Group level."
+ examples:
+ - name: GetGroupSettings
+ text: |-
+ az managementgroup hierarchy-setting create --default-management-group "/providers/Microsoft.Management/\
+managementGroups/DefaultGroup" --require-authorization-for-group-creation true --group-id "root"
+"""
+
+helps['managementgroup hierarchy-setting update'] = """
+ type: command
+ short-summary: "Updates the hierarchy settings defined at the Management Group level."
+ examples:
+ - name: GetGroupSettings
+ text: |-
+ az managementgroup hierarchy-setting update --default-management-group "/providers/Microsoft.Management/\
+managementGroups/DefaultGroup" --require-authorization-for-group-creation true --group-id "root"
+"""
+
+helps['managementgroup hierarchy-setting delete'] = """
+ type: command
+ short-summary: "Deletes the hierarchy settings defined at the Management Group level."
+ examples:
+ - name: GetGroupSettings
+ text: |-
+ az managementgroup hierarchy-setting delete --group-id "root"
+"""
+
+helps['managementgroup'] = """
+ type: group
+ short-summary: Manage with managementgroup
+"""
+
+helps['managementgroup start-tenant-backfill'] = """
+ type: command
+ short-summary: "Starts backfilling subscriptions for the Tenant."
+ examples:
+ - name: StartTenantBackfill
+ text: |-
+ az managementgroup start-tenant-backfill
+"""
+
+helps['managementgroup tenant-backfill-status'] = """
+ type: command
+ short-summary: "Gets tenant backfill status."
+ examples:
+ - name: TenantBackfillStatus
+ text: |-
+ az managementgroup tenant-backfill-status
+"""
+
+helps['managementgroup entity'] = """
+ type: group
+ short-summary: Manage entity with managementgroup
+"""
+
+helps['managementgroup entity list'] = """
+ type: command
+ short-summary: "List all entities (Management Groups, Subscriptions, etc.) for the authenticated user."
+ examples:
+ - name: GetEntities
+ text: |-
+ az managementgroup entity list
+"""
diff --git a/src/managementgroup/azext_managementgroup/generated/_params.py b/src/managementgroup/azext_managementgroup/generated/_params.py
new file mode 100644
index 00000000000..dfd95e133c4
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/generated/_params.py
@@ -0,0 +1,186 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=line-too-long
+# pylint: disable=too-many-lines
+# pylint: disable=too-many-statements
+
+from azure.cli.core.commands.parameters import (
+ get_three_state_flag,
+ get_enum_type
+)
+
+
+def load_arguments(self, _):
+
+ with self.argument_context('managementgroup management-group list') as c:
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
+ c.argument('skiptoken', type=str, help='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.')
+
+ with self.argument_context('managementgroup management-group show') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('expand', arg_type=get_enum_type(['children', 'path', 'ancestors']), help='The $expand=children '
+ 'query string parameter allows clients to request inclusion of children in the response payload. '
+ '$expand=path includes the path from the root group to the current group. $expand=ancestors '
+ 'includes the ancestor Ids of the current group.')
+ c.argument('recurse', arg_type=get_three_state_flag(), help='The $recurse=true query string parameter allows '
+ 'clients to request inclusion of entire hierarchy in the response payload. Note that '
+ '$expand=children must be passed up if $recurse is set to true.')
+ c.argument('filter_', options_list=['--filter'], type=str, help='A filter which allows the exclusion of '
+ 'subscriptions from results (i.e. \'$filter=children.childType ne Subscription\')')
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
+
+ with self.argument_context('managementgroup management-group create') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
+ c.argument('name', type=str, help='The name of the management group. For example, '
+ '00000000-0000-0000-0000-000000000000')
+ c.argument('display_name', type=str, help='The friendly name of the management group. If no value is passed '
+ 'then this field will be set to the groupId.')
+ c.argument('id_', options_list=['--id'], type=str, help='The fully qualified ID for the parent management '
+ 'group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000'
+ '000000', arg_group='Details Parent')
+
+ with self.argument_context('managementgroup management-group update') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
+ c.argument('display_name', type=str, help='The friendly name of the management group.')
+ c.argument('parent_group_id', type=str, help='(Optional) The fully qualified ID for the parent management '
+ 'group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000'
+ '000000')
+
+ with self.argument_context('managementgroup management-group delete') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
+
+ with self.argument_context('managementgroup management-group show-descendant') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('skiptoken', type=str, help='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.')
+ c.argument('top', type=int, help='Number of elements to return when retrieving results. Passing this in will '
+ 'override $skipToken.')
+
+ with self.argument_context('managementgroup management-group wait') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('expand', arg_type=get_enum_type(['children', 'path', 'ancestors']), help='The $expand=children '
+ 'query string parameter allows clients to request inclusion of children in the response payload. '
+ '$expand=path includes the path from the root group to the current group. $expand=ancestors '
+ 'includes the ancestor Ids of the current group.')
+ c.argument('recurse', arg_type=get_three_state_flag(), help='The $recurse=true query string parameter allows '
+ 'clients to request inclusion of entire hierarchy in the response payload. Note that '
+ '$expand=children must be passed up if $recurse is set to true.')
+ c.argument('filter_', options_list=['--filter'], type=str, help='A filter which allows the exclusion of '
+ 'subscriptions from results (i.e. \'$filter=children.childType ne Subscription\')')
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
+
+ with self.argument_context('managementgroup management-group-subscription create') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('subscription_id', type=str, help='Subscription ID.')
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
+
+ with self.argument_context('managementgroup management-group-subscription delete') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('subscription_id', type=str, help='Subscription ID.', id_part='subscription')
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
+
+ with self.argument_context('managementgroup management-group-subscription show-subscription') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('subscription_id', type=str, help='Subscription ID.', id_part='subscription')
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
+
+ with self.argument_context('managementgroup management-group-subscription show-subscription-under-management-group') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('skiptoken', type=str, help='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.')
+
+ with self.argument_context('managementgroup hierarchy-setting list') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+
+ with self.argument_context('managementgroup hierarchy-setting show') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+
+ with self.argument_context('managementgroup hierarchy-setting create') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('require_authorization_for_group_creation', arg_type=get_three_state_flag(), help='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.')
+ c.argument('default_management_group', type=str, help='Settings that sets the default Management Group under '
+ 'which new subscriptions get added in this tenant. For example, /providers/Microsoft.Management/mana'
+ 'gementGroups/defaultGroup')
+
+ with self.argument_context('managementgroup hierarchy-setting update') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+ c.argument('require_authorization_for_group_creation', arg_type=get_three_state_flag(), help='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.')
+ c.argument('default_management_group', type=str, help='Settings that sets the default Management Group under '
+ 'which new subscriptions get added in this tenant. For example, /providers/Microsoft.Management/mana'
+ 'gementGroups/defaultGroup')
+
+ with self.argument_context('managementgroup hierarchy-setting delete') as c:
+ c.argument('group_id', type=str, help='Management Group ID.')
+
+ with self.argument_context('managementgroup entity list') as c:
+ c.argument('skiptoken', type=str, help='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.')
+ c.argument('skip', type=int, help='Number of entities to skip over when retrieving results. Passing this in '
+ 'will override $skipToken.')
+ c.argument('top', type=int, help='Number of elements to return when retrieving results. Passing this in will '
+ 'override $skipToken.')
+ c.argument('select', type=str, help='This parameter specifies the fields to include in the response. Can '
+ 'include any combination of Name,DisplayName,Type,ParentDisplayNameChain,ParentChain, e.g. '
+ '\'$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain\'. When specified the '
+ '$select parameter can override select in $skipToken.')
+ c.argument('search', arg_type=get_enum_type(['AllowedParents', 'AllowedChildren',
+ 'ParentAndFirstLevelChildren', 'ParentOnly', 'ChildrenOnly']),
+ help='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. 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.')
+ c.argument('filter_', options_list=['--filter'], type=str, help='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.')
+ c.argument('view', arg_type=get_enum_type(['FullHierarchy', 'GroupsOnly', 'SubscriptionsOnly', 'Audit']),
+ help='The view parameter allows clients to filter the type of data that is returned by the '
+ 'getEntities call.')
+ c.argument('group_name', type=str, help='A filter which allows the get entities call to focus on a particular '
+ 'group (i.e. "$filter=name eq \'groupName\'")')
+ c.argument('cache_control', type=str, help='Indicates whether the request should utilize any caches. Populate '
+ 'the header with \'no-cache\' value to bypass existing caches.')
diff --git a/src/managementgroup/azext_managementgroup/generated/_validators.py b/src/managementgroup/azext_managementgroup/generated/_validators.py
new file mode 100644
index 00000000000..b33a44c1ebf
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/generated/_validators.py
@@ -0,0 +1,9 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
diff --git a/src/managementgroup/azext_managementgroup/generated/action.py b/src/managementgroup/azext_managementgroup/generated/action.py
new file mode 100644
index 00000000000..b49bfaeeefe
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/generated/action.py
@@ -0,0 +1,10 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=protected-access
diff --git a/src/managementgroup/azext_managementgroup/generated/commands.py b/src/managementgroup/azext_managementgroup/generated/commands.py
new file mode 100644
index 00000000000..dfd6a527e52
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/generated/commands.py
@@ -0,0 +1,77 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-statements
+# pylint: disable=too-many-locals
+
+from azure.cli.core.commands import CliCommandType
+
+
+def load_command_table(self, _):
+
+ from azext_managementgroup.generated._client_factory import cf_management_group
+ managementgroup_management_group = CliCommandType(
+ operations_tmpl='azext_managementgroup.vendored_sdks.managementgroup.operations._management_groups_operations#M'
+ 'anagementGroupsOperations.{}',
+ client_factory=cf_management_group)
+ with self.command_group('managementgroup management-group', managementgroup_management_group,
+ client_factory=cf_management_group) as g:
+ g.custom_command('list', 'managementgroup_management_group_list')
+ g.custom_show_command('show', 'managementgroup_management_group_show')
+ g.custom_command('create', 'managementgroup_management_group_create', supports_no_wait=True)
+ g.custom_command('update', 'managementgroup_management_group_update')
+ g.custom_command('delete', 'managementgroup_management_group_delete', supports_no_wait=True,
+ confirmation=True)
+ g.custom_command('show-descendant', 'managementgroup_management_group_show_descendant')
+ g.custom_wait_command('wait', 'managementgroup_management_group_show')
+
+ from azext_managementgroup.generated._client_factory import cf_management_group_subscription
+ managementgroup_management_group_subscription = CliCommandType(
+ operations_tmpl='azext_managementgroup.vendored_sdks.managementgroup.operations._management_group_subscriptions'
+ '_operations#ManagementGroupSubscriptionsOperations.{}',
+ client_factory=cf_management_group_subscription)
+ with self.command_group('managementgroup management-group-subscription',
+ managementgroup_management_group_subscription,
+ client_factory=cf_management_group_subscription) as g:
+ g.custom_command('create', 'managementgroup_management_group_subscription_create')
+ g.custom_command('delete', 'managementgroup_management_group_subscription_delete', confirmation=True)
+ g.custom_command('show-subscription', 'managementgroup_management_group_subscription_show_subscription')
+ g.custom_command('show-subscription-under-management-group', 'managementgroup_management_group_subscription_sho'
+ 'w_subscription_under_management_group')
+
+ from azext_managementgroup.generated._client_factory import cf_hierarchy_setting
+ managementgroup_hierarchy_setting = CliCommandType(
+ operations_tmpl='azext_managementgroup.vendored_sdks.managementgroup.operations._hierarchy_settings_operations#'
+ 'HierarchySettingsOperations.{}',
+ client_factory=cf_hierarchy_setting)
+ with self.command_group('managementgroup hierarchy-setting', managementgroup_hierarchy_setting,
+ client_factory=cf_hierarchy_setting) as g:
+ g.custom_command('list', 'managementgroup_hierarchy_setting_list')
+ g.custom_show_command('show', 'managementgroup_hierarchy_setting_show')
+ g.custom_command('create', 'managementgroup_hierarchy_setting_create')
+ g.custom_command('update', 'managementgroup_hierarchy_setting_update')
+ g.custom_command('delete', 'managementgroup_hierarchy_setting_delete', confirmation=True)
+
+ from azext_managementgroup.generated._client_factory import cf_managementgroup
+ managementgroup_ = CliCommandType(
+ operations_tmpl='azext_managementgroup.vendored_sdks.managementgroup.operations._model_operations#ManagementGro'
+ 'upsAPIOperationsMixin.{}',
+ client_factory=cf_managementgroup)
+ with self.command_group('managementgroup', managementgroup_, client_factory=cf_managementgroup,
+ is_experimental=True) as g:
+ g.custom_command('start-tenant-backfill', 'managementgroup_start_tenant_backfill')
+ g.custom_command('tenant-backfill-status', 'managementgroup_tenant_backfill_status')
+
+ from azext_managementgroup.generated._client_factory import cf_entity
+ managementgroup_entity = CliCommandType(
+ operations_tmpl='azext_managementgroup.vendored_sdks.managementgroup.operations._entities_operations#EntitiesOp'
+ 'erations.{}',
+ client_factory=cf_entity)
+ with self.command_group('managementgroup entity', managementgroup_entity, client_factory=cf_entity) as g:
+ g.custom_command('list', 'managementgroup_entity_list')
diff --git a/src/managementgroup/azext_managementgroup/generated/custom.py b/src/managementgroup/azext_managementgroup/generated/custom.py
new file mode 100644
index 00000000000..438f4a07442
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/generated/custom.py
@@ -0,0 +1,202 @@
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+# pylint: disable=line-too-long
+# pylint: disable=too-many-lines
+
+from azure.cli.core.util import sdk_no_wait
+
+
+def managementgroup_management_group_list(client,
+ cache_control=None,
+ skiptoken=None):
+ if cache_control is None:
+ cache_control = "no-cache"
+ return client.list(cache_control=cache_control,
+ skiptoken=skiptoken)
+
+
+def managementgroup_management_group_show(client,
+ group_id,
+ expand=None,
+ recurse=None,
+ filter_=None,
+ cache_control=None):
+ if cache_control is None:
+ cache_control = "no-cache"
+ return client.get(group_id=group_id,
+ expand=expand,
+ recurse=recurse,
+ filter=filter_,
+ cache_control=cache_control)
+
+
+def managementgroup_management_group_create(client,
+ group_id,
+ cache_control=None,
+ name=None,
+ display_name=None,
+ id_=None,
+ no_wait=False):
+ if cache_control is None:
+ cache_control = "no-cache"
+ create_management_group_request = {}
+ create_management_group_request['name'] = name
+ create_management_group_request['display_name'] = display_name
+ create_management_group_request['parent'] = {}
+ create_management_group_request['parent']['id'] = id_
+ return sdk_no_wait(no_wait,
+ client.begin_create_or_update,
+ group_id=group_id,
+ cache_control=cache_control,
+ create_management_group_request=create_management_group_request)
+
+
+def managementgroup_management_group_update(client,
+ group_id,
+ cache_control=None,
+ display_name=None,
+ parent_group_id=None):
+ if cache_control is None:
+ cache_control = "no-cache"
+ patch_group_request = {}
+ patch_group_request['display_name'] = display_name
+ patch_group_request['parent_group_id'] = parent_group_id
+ return client.update(group_id=group_id,
+ cache_control=cache_control,
+ patch_group_request=patch_group_request)
+
+
+def managementgroup_management_group_delete(client,
+ group_id,
+ cache_control=None,
+ no_wait=False):
+ if cache_control is None:
+ cache_control = "no-cache"
+ return sdk_no_wait(no_wait,
+ client.begin_delete,
+ group_id=group_id,
+ cache_control=cache_control)
+
+
+def managementgroup_management_group_show_descendant(client,
+ group_id,
+ skiptoken=None,
+ top=None):
+ return client.get_descendants(group_id=group_id,
+ skiptoken=skiptoken,
+ top=top)
+
+
+def managementgroup_management_group_subscription_create(client,
+ group_id,
+ subscription_id,
+ cache_control=None):
+ if cache_control is None:
+ cache_control = "no-cache"
+ return client.create(group_id=group_id,
+ subscription_id=subscription_id,
+ cache_control=cache_control)
+
+
+def managementgroup_management_group_subscription_delete(client,
+ group_id,
+ subscription_id,
+ cache_control=None):
+ if cache_control is None:
+ cache_control = "no-cache"
+ return client.delete(group_id=group_id,
+ subscription_id=subscription_id,
+ cache_control=cache_control)
+
+
+def managementgroup_management_group_subscription_show_subscription(client,
+ group_id,
+ subscription_id,
+ cache_control=None):
+ if cache_control is None:
+ cache_control = "no-cache"
+ return client.get_subscription(group_id=group_id,
+ subscription_id=subscription_id,
+ cache_control=cache_control)
+
+
+def managementgroup_management_group_subscription_show_subscription_under_management_group(client,
+ group_id,
+ skiptoken=None):
+ return client.get_subscriptions_under_management_group(group_id=group_id,
+ skiptoken=skiptoken)
+
+
+def managementgroup_hierarchy_setting_list(client,
+ group_id):
+ return client.list(group_id=group_id)
+
+
+def managementgroup_hierarchy_setting_show(client,
+ group_id):
+ return client.get(group_id=group_id)
+
+
+def managementgroup_hierarchy_setting_create(client,
+ group_id,
+ require_authorization_for_group_creation=None,
+ default_management_group=None):
+ create_tenant_settings_request = {}
+ create_tenant_settings_request['require_authorization_for_group_creation'] = require_authorization_for_group_creation
+ create_tenant_settings_request['default_management_group'] = default_management_group
+ return client.create_or_update(group_id=group_id,
+ create_tenant_settings_request=create_tenant_settings_request)
+
+
+def managementgroup_hierarchy_setting_update(client,
+ group_id,
+ require_authorization_for_group_creation=None,
+ default_management_group=None):
+ create_tenant_settings_request = {}
+ create_tenant_settings_request['require_authorization_for_group_creation'] = require_authorization_for_group_creation
+ create_tenant_settings_request['default_management_group'] = default_management_group
+ return client.update(group_id=group_id,
+ create_tenant_settings_request=create_tenant_settings_request)
+
+
+def managementgroup_hierarchy_setting_delete(client,
+ group_id):
+ return client.delete(group_id=group_id)
+
+
+def managementgroup_start_tenant_backfill(client):
+ return client.start_tenant_backfill()
+
+
+def managementgroup_tenant_backfill_status(client):
+ return client.tenant_backfill_status()
+
+
+def managementgroup_entity_list(client,
+ skiptoken=None,
+ skip=None,
+ top=None,
+ select=None,
+ search=None,
+ filter_=None,
+ view=None,
+ group_name=None,
+ cache_control=None):
+ if cache_control is None:
+ cache_control = "no-cache"
+ return client.list(skiptoken=skiptoken,
+ skip=skip,
+ top=top,
+ select=select,
+ search=search,
+ filter=filter_,
+ view=view,
+ group_name=group_name,
+ cache_control=cache_control)
diff --git a/src/managementgroup/azext_managementgroup/manual/__init__.py b/src/managementgroup/azext_managementgroup/manual/__init__.py
new file mode 100644
index 00000000000..c9cfdc73e77
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/manual/__init__.py
@@ -0,0 +1,12 @@
+# 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.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/managementgroup/azext_managementgroup/tests/__init__.py b/src/managementgroup/azext_managementgroup/tests/__init__.py
new file mode 100644
index 00000000000..70488e93851
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/tests/__init__.py
@@ -0,0 +1,116 @@
+# 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 inspect
+import logging
+import os
+import sys
+import traceback
+import datetime as dt
+
+from azure.core.exceptions import AzureError
+from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError
+
+
+logger = logging.getLogger('azure.cli.testsdk')
+logger.addHandler(logging.StreamHandler())
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
+exceptions = []
+test_map = dict()
+SUCCESSED = "successed"
+FAILED = "failed"
+
+
+def try_manual(func):
+ def import_manual_function(origin_func):
+ from importlib import import_module
+ decorated_path = inspect.getfile(origin_func).lower()
+ module_path = __path__[0].lower()
+ if not decorated_path.startswith(module_path):
+ raise Exception("Decorator can only be used in submodules!")
+ manual_path = os.path.join(
+ decorated_path[module_path.rfind(os.path.sep) + 1:])
+ manual_file_path, manual_file_name = os.path.split(manual_path)
+ module_name, _ = os.path.splitext(manual_file_name)
+ manual_module = "..manual." + \
+ ".".join(manual_file_path.split(os.path.sep) + [module_name, ])
+ return getattr(import_module(manual_module, package=__name__), origin_func.__name__)
+
+ def get_func_to_call():
+ func_to_call = func
+ try:
+ func_to_call = import_manual_function(func)
+ logger.info("Found manual override for %s(...)", func.__name__)
+ except (ImportError, AttributeError):
+ pass
+ return func_to_call
+
+ def wrapper(*args, **kwargs):
+ func_to_call = get_func_to_call()
+ logger.info("running %s()...", func.__name__)
+ try:
+ test_map[func.__name__] = dict()
+ test_map[func.__name__]["result"] = SUCCESSED
+ test_map[func.__name__]["error_message"] = ""
+ test_map[func.__name__]["error_stack"] = ""
+ test_map[func.__name__]["error_normalized"] = ""
+ test_map[func.__name__]["start_dt"] = dt.datetime.utcnow()
+ ret = func_to_call(*args, **kwargs)
+ except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit,
+ JMESPathCheckAssertionError) as e:
+ use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE")
+ if use_exception_cache is None or use_exception_cache.lower() != "true":
+ raise
+ test_map[func.__name__]["end_dt"] = dt.datetime.utcnow()
+ test_map[func.__name__]["result"] = FAILED
+ test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500]
+ test_map[func.__name__]["error_stack"] = traceback.format_exc().replace(
+ "\r\n", " ").replace("\n", " ")[:500]
+ logger.info("--------------------------------------")
+ logger.info("step exception: %s", e)
+ logger.error("--------------------------------------")
+ logger.error("step exception in %s: %s", func.__name__, e)
+ logger.info(traceback.format_exc())
+ exceptions.append((func.__name__, sys.exc_info()))
+ else:
+ test_map[func.__name__]["end_dt"] = dt.datetime.utcnow()
+ return ret
+
+ if inspect.isclass(func):
+ return get_func_to_call()
+ return wrapper
+
+
+def calc_coverage(filename):
+ filename = filename.split(".")[0]
+ coverage_name = filename + "_coverage.md"
+ with open(coverage_name, "w") as f:
+ f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n")
+ total = len(test_map)
+ covered = 0
+ for k, v in test_map.items():
+ if not k.startswith("step_"):
+ total -= 1
+ continue
+ if v["result"] == SUCCESSED:
+ covered += 1
+ f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|"
+ "{end_dt}|\n".format(step_name=k, **v))
+ f.write("Coverage: {}/{}\n".format(covered, total))
+ print("Create coverage\n", file=sys.stderr)
+
+
+def raise_if():
+ if exceptions:
+ if len(exceptions) <= 1:
+ raise exceptions[0][1][1]
+ message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1]))
+ message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]])
+ raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2])
diff --git a/src/managementgroup/azext_managementgroup/tests/latest/__init__.py b/src/managementgroup/azext_managementgroup/tests/latest/__init__.py
new file mode 100644
index 00000000000..c9cfdc73e77
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/tests/latest/__init__.py
@@ -0,0 +1,12 @@
+# 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.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/managementgroup/azext_managementgroup/tests/latest/example_steps.py b/src/managementgroup/azext_managementgroup/tests/latest/example_steps.py
new file mode 100644
index 00000000000..d611114652e
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/tests/latest/example_steps.py
@@ -0,0 +1,257 @@
+# --------------------------------------------------------------------------
+# 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 .. import try_manual
+
+
+# EXAMPLE: /Entities/post/GetEntities
+@try_manual
+def step_entity_list(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup entity list',
+ checks=checks)
+
+
+# EXAMPLE: /HierarchySettings/put/GetGroupSettings
+@try_manual
+def step_hierarchy_setting_create(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup hierarchy-setting create '
+ '--default-management-group "/providers/Microsoft.Management/managementGroups/DefaultGroup" '
+ '--require-authorization-for-group-creation true '
+ '--group-id "root"',
+ checks=checks)
+
+
+# EXAMPLE: /HierarchySettings/get/GetGroupSettings
+@try_manual
+def step_hierarchy_setting_show(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup hierarchy-setting show '
+ '--group-id "root"',
+ checks=checks)
+
+
+# EXAMPLE: /HierarchySettings/get/ListGroupSettings
+@try_manual
+def step_hierarchy_setting_list(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup hierarchy-setting list '
+ '--group-id "root"',
+ checks=checks)
+
+
+# EXAMPLE: /HierarchySettings/patch/GetGroupSettings
+@try_manual
+def step_hierarchy_setting_update(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup hierarchy-setting update '
+ '--default-management-group "/providers/Microsoft.Management/managementGroups/DefaultGroup" '
+ '--require-authorization-for-group-creation true '
+ '--group-id "root"',
+ checks=checks)
+
+
+# EXAMPLE: /HierarchySettings/delete/GetGroupSettings
+@try_manual
+def step_hierarchy_setting_delete(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup hierarchy-setting delete -y '
+ '--group-id "root"',
+ checks=checks)
+
+
+# EXAMPLE: /managementgroup/post/StartTenantBackfill
+@try_manual
+def step_start_tenant_backfill(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup start-tenant-backfill',
+ checks=checks)
+
+
+# EXAMPLE: /managementgroup/post/TenantBackfillStatus
+@try_manual
+def step_tenant_backfill_status(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup tenant-backfill-status',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/put/PutManagementGroup
+@try_manual
+def step_management_group_create(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group create '
+ '--cache-control "no-cache" '
+ '--display-name "ChildGroup" '
+ '--id "/providers/Microsoft.Management/managementGroups/RootGroup" '
+ '--group-id "ChildGroup"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/get/GetDescendants
+@try_manual
+def step_management_group_show_descendant(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group show-descendant '
+ '--group-id "20000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/get/GetManagementGroup
+@try_manual
+def step_management_group_show(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group show '
+ '--cache-control "no-cache" '
+ '--group-id "20000000-0001-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/get/GetManagementGroupsWithExpandAndRecurse
+@try_manual
+def step_management_group_show2(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group show '
+ '--expand "children" '
+ '--recurse true '
+ '--cache-control "no-cache" '
+ '--group-id "20000000-0001-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/get/GetManagementGroupWithAncestors
+@try_manual
+def step_management_group_show3(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group show '
+ '--expand "ancestors" '
+ '--cache-control "no-cache" '
+ '--group-id "20000000-0001-0000-0000-00000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/get/GetManagementGroupWithExpand
+@try_manual
+def step_management_group_show4(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group show '
+ '--expand "children" '
+ '--cache-control "no-cache" '
+ '--group-id "20000000-0001-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/get/GetManagementGroupWithPath
+@try_manual
+def step_management_group_show5(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group show '
+ '--expand "path" '
+ '--cache-control "no-cache" '
+ '--group-id "20000000-0001-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/get/ListManagementGroups
+@try_manual
+def step_management_group_list(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group list '
+ '--cache-control "no-cache"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/patch/PatchManagementGroup
+@try_manual
+def step_management_group_update(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group update '
+ '--cache-control "no-cache" '
+ '--group-id "ChildGroup" '
+ '--display-name "AlternateDisplayName" '
+ '--parent-group-id "/providers/Microsoft.Management/managementGroups/AlternateRootGroup"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroups/delete/DeleteManagementGroup
+@try_manual
+def step_management_group_delete(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group delete -y '
+ '--cache-control "no-cache" '
+ '--group-id "GroupToDelete"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroupSubscriptions/put/AddSubscriptionToManagementGroup
+@try_manual
+def step_management_group_subscription_create(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group-subscription create '
+ '--cache-control "no-cache" '
+ '--group-id "Group" '
+ '--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroupSubscriptions/get/GetAllSubscriptionsFromManagementGroup
+@try_manual
+def step_management_group_subscription(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group-subscription show-subscription-under-management-group '
+ '--group-id "Group"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroupSubscriptions/get/GetSubscriptionFromManagementGroup
+@try_manual
+def step_management_group_subscription2(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group-subscription show-subscription '
+ '--cache-control "no-cache" '
+ '--group-id "Group" '
+ '--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"',
+ checks=checks)
+
+
+# EXAMPLE: /ManagementGroupSubscriptions/delete/DeleteSubscriptionFromManagementGroup
+@try_manual
+def step_management_group_subscription_delete(test, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az managementgroup management-group-subscription delete -y '
+ '--cache-control "no-cache" '
+ '--group-id "Group" '
+ '--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"',
+ checks=checks)
+
diff --git a/src/managementgroup/azext_managementgroup/tests/latest/test_managementgroup_scenario.py b/src/managementgroup/azext_managementgroup/tests/latest/test_managementgroup_scenario.py
new file mode 100644
index 00000000000..9b0db68fb30
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/tests/latest/test_managementgroup_scenario.py
@@ -0,0 +1,98 @@
+# --------------------------------------------------------------------------
+# 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 os
+from azure.cli.testsdk import ScenarioTest
+from .example_steps import step_entity_list
+from .example_steps import step_hierarchy_setting_create
+from .example_steps import step_hierarchy_setting_show
+from .example_steps import step_hierarchy_setting_list
+from .example_steps import step_hierarchy_setting_update
+from .example_steps import step_hierarchy_setting_delete
+from .example_steps import step_start_tenant_backfill
+from .example_steps import step_tenant_backfill_status
+from .example_steps import step_management_group_create
+from .example_steps import step_management_group_show_descendant
+from .example_steps import step_management_group_show
+from .example_steps import step_management_group_show2
+from .example_steps import step_management_group_show3
+from .example_steps import step_management_group_show4
+from .example_steps import step_management_group_show5
+from .example_steps import step_management_group_list
+from .example_steps import step_management_group_update
+from .example_steps import step_management_group_delete
+from .example_steps import step_management_group_subscription_create
+from .example_steps import step_management_group_subscription
+from .example_steps import step_management_group_subscription2
+from .example_steps import step_management_group_subscription_delete
+from .. import (
+ try_manual,
+ raise_if,
+ calc_coverage
+)
+
+
+TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
+
+
+# Env setup_scenario
+@try_manual
+def setup_scenario(test):
+ pass
+
+
+# Env cleanup_scenario
+@try_manual
+def cleanup_scenario(test):
+ pass
+
+
+# Testcase: Scenario
+@try_manual
+def call_scenario(test):
+ setup_scenario(test)
+ step_entity_list(test, checks=[])
+ step_hierarchy_setting_create(test, checks=[])
+ step_hierarchy_setting_show(test, checks=[])
+ step_hierarchy_setting_list(test, checks=[])
+ step_hierarchy_setting_update(test, checks=[])
+ step_hierarchy_setting_delete(test, checks=[])
+ step_start_tenant_backfill(test, checks=[])
+ step_tenant_backfill_status(test, checks=[])
+ step_management_group_create(test, checks=[])
+ step_management_group_show_descendant(test, checks=[])
+ step_management_group_show(test, checks=[])
+ step_management_group_show2(test, checks=[])
+ step_management_group_show3(test, checks=[])
+ step_management_group_show4(test, checks=[])
+ step_management_group_show5(test, checks=[])
+ step_management_group_list(test, checks=[])
+ step_management_group_update(test, checks=[])
+ step_management_group_delete(test, checks=[])
+ step_management_group_subscription_create(test, checks=[])
+ step_management_group_subscription(test, checks=[])
+ step_management_group_subscription2(test, checks=[])
+ step_management_group_subscription_delete(test, checks=[])
+ cleanup_scenario(test)
+
+
+# Test class for Scenario
+@try_manual
+class ManagementgroupScenarioTest(ScenarioTest):
+
+ def __init__(self, *args, **kwargs):
+ super(ManagementgroupScenarioTest, self).__init__(*args, **kwargs)
+
+
+ def test_managementgroup_Scenario(self):
+ call_scenario(self)
+ calc_coverage(__file__)
+ raise_if()
+
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/__init__.py b/src/managementgroup/azext_managementgroup/vendored_sdks/__init__.py
new file mode 100644
index 00000000000..c9cfdc73e77
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/__init__.py
@@ -0,0 +1,12 @@
+# 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.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/__init__.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/__init__.py
new file mode 100644
index 00000000000..5eaa93da940
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/__init__.py
@@ -0,0 +1,16 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from ._management_groups_api import ManagementGroupsAPI
+__all__ = ['ManagementGroupsAPI']
+
+try:
+ from ._patch import patch_sdk # type: ignore
+ patch_sdk()
+except ImportError:
+ pass
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/_configuration.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/_configuration.py
new file mode 100644
index 00000000000..6a5091947db
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/_configuration.py
@@ -0,0 +1,64 @@
+# 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 typing import TYPE_CHECKING
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+from azure.mgmt.core.policies import ARMHttpLoggingPolicy
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any
+
+ from azure.core.credentials import TokenCredential
+
+VERSION = "unknown"
+
+class ManagementGroupsAPIConfiguration(Configuration):
+ """Configuration for ManagementGroupsAPI.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials.TokenCredential
+ """
+
+ def __init__(
+ self,
+ credential, # type: "TokenCredential"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ if credential is None:
+ raise ValueError("Parameter 'credential' must not be None.")
+ super(ManagementGroupsAPIConfiguration, self).__init__(**kwargs)
+
+ self.credential = credential
+ self.api_version = "2021-04-01"
+ self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
+ kwargs.setdefault('sdk_moniker', 'managementgroupsapi/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
+ if self.credential and not self.authentication_policy:
+ self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/_management_groups_api.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/_management_groups_api.py
new file mode 100644
index 00000000000..c0ccdbd78f0
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/_management_groups_api.py
@@ -0,0 +1,89 @@
+# 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 typing import TYPE_CHECKING
+
+from azure.mgmt.core import ARMPipelineClient
+from msrest import Deserializer, Serializer
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Optional
+
+ from azure.core.credentials import TokenCredential
+
+from ._configuration import ManagementGroupsAPIConfiguration
+from .operations import ManagementGroupsOperations
+from .operations import ManagementGroupSubscriptionsOperations
+from .operations import HierarchySettingsOperations
+from .operations import Operations
+from .operations import ManagementGroupsAPIOperationsMixin
+from .operations import EntitiesOperations
+from . import models
+
+
+class ManagementGroupsAPI(ManagementGroupsAPIOperationsMixin):
+ """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 management_groups: ManagementGroupsOperations operations
+ :vartype management_groups: management_groups_api.operations.ManagementGroupsOperations
+ :ivar management_group_subscriptions: ManagementGroupSubscriptionsOperations operations
+ :vartype management_group_subscriptions: management_groups_api.operations.ManagementGroupSubscriptionsOperations
+ :ivar hierarchy_settings: HierarchySettingsOperations operations
+ :vartype hierarchy_settings: management_groups_api.operations.HierarchySettingsOperations
+ :ivar operations: Operations operations
+ :vartype operations: management_groups_api.operations.Operations
+ :ivar entities: EntitiesOperations operations
+ :vartype entities: management_groups_api.operations.EntitiesOperations
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials.TokenCredential
+ :param str base_url: Service URL
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ """
+
+ def __init__(
+ self,
+ credential, # type: "TokenCredential"
+ base_url=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ if not base_url:
+ base_url = 'https://management.azure.com'
+ self._config = ManagementGroupsAPIConfiguration(credential, **kwargs)
+ self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
+
+ client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
+ 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)
+
+ def close(self):
+ # type: () -> None
+ self._client.close()
+
+ def __enter__(self):
+ # type: () -> ManagementGroupsAPI
+ self._client.__enter__()
+ return self
+
+ def __exit__(self, *exc_details):
+ # type: (Any) -> None
+ self._client.__exit__(*exc_details)
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/__init__.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/__init__.py
new file mode 100644
index 00000000000..02de8eb547b
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/__init__.py
@@ -0,0 +1,10 @@
+# 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 ._management_groups_api import ManagementGroupsAPI
+__all__ = ['ManagementGroupsAPI']
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/_configuration.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/_configuration.py
new file mode 100644
index 00000000000..d5fca1f3f7d
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/_configuration.py
@@ -0,0 +1,60 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from typing import Any, TYPE_CHECKING
+
+from azure.core.configuration import Configuration
+from azure.core.pipeline import policies
+from azure.mgmt.core.policies import ARMHttpLoggingPolicy
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from azure.core.credentials_async import AsyncTokenCredential
+
+VERSION = "unknown"
+
+class ManagementGroupsAPIConfiguration(Configuration):
+ """Configuration for ManagementGroupsAPI.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
+ """
+
+ def __init__(
+ self,
+ credential: "AsyncTokenCredential",
+ **kwargs: Any
+ ) -> None:
+ if credential is None:
+ raise ValueError("Parameter 'credential' must not be None.")
+ super(ManagementGroupsAPIConfiguration, self).__init__(**kwargs)
+
+ self.credential = credential
+ self.api_version = "2021-04-01"
+ self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
+ kwargs.setdefault('sdk_moniker', 'managementgroupsapi/{}'.format(VERSION))
+ self._configure(**kwargs)
+
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
+ self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
+ self.authentication_policy = kwargs.get('authentication_policy')
+ if self.credential and not self.authentication_policy:
+ self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/_management_groups_api.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/_management_groups_api.py
new file mode 100644
index 00000000000..0a8db43b097
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/_management_groups_api.py
@@ -0,0 +1,83 @@
+# 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 typing import Any, Optional, TYPE_CHECKING
+
+from azure.mgmt.core import AsyncARMPipelineClient
+from msrest import Deserializer, Serializer
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from azure.core.credentials_async import AsyncTokenCredential
+
+from ._configuration import ManagementGroupsAPIConfiguration
+from .operations import ManagementGroupsOperations
+from .operations import ManagementGroupSubscriptionsOperations
+from .operations import HierarchySettingsOperations
+from .operations import Operations
+from .operations import ManagementGroupsAPIOperationsMixin
+from .operations import EntitiesOperations
+from .. import models
+
+
+class ManagementGroupsAPI(ManagementGroupsAPIOperationsMixin):
+ """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 management_groups: ManagementGroupsOperations operations
+ :vartype management_groups: management_groups_api.aio.operations.ManagementGroupsOperations
+ :ivar management_group_subscriptions: ManagementGroupSubscriptionsOperations operations
+ :vartype management_group_subscriptions: management_groups_api.aio.operations.ManagementGroupSubscriptionsOperations
+ :ivar hierarchy_settings: HierarchySettingsOperations operations
+ :vartype hierarchy_settings: management_groups_api.aio.operations.HierarchySettingsOperations
+ :ivar operations: Operations operations
+ :vartype operations: management_groups_api.aio.operations.Operations
+ :ivar entities: EntitiesOperations operations
+ :vartype entities: management_groups_api.aio.operations.EntitiesOperations
+ :param credential: Credential needed for the client to connect to Azure.
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
+ :param str base_url: Service URL
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ """
+
+ def __init__(
+ self,
+ credential: "AsyncTokenCredential",
+ base_url: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ if not base_url:
+ base_url = 'https://management.azure.com'
+ self._config = ManagementGroupsAPIConfiguration(credential, **kwargs)
+ self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
+
+ client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
+ 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)
+
+ async def close(self) -> None:
+ await self._client.close()
+
+ async def __aenter__(self) -> "ManagementGroupsAPI":
+ await self._client.__aenter__()
+ return self
+
+ async def __aexit__(self, *exc_details) -> None:
+ await self._client.__aexit__(*exc_details)
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/__init__.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/__init__.py
new file mode 100644
index 00000000000..d3c6bc42bbe
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/__init__.py
@@ -0,0 +1,23 @@
+# 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 ._management_groups_operations import ManagementGroupsOperations
+from ._management_group_subscriptions_operations import ManagementGroupSubscriptionsOperations
+from ._hierarchy_settings_operations import HierarchySettingsOperations
+from ._operations import Operations
+from ._management_groups_api_operations import ManagementGroupsAPIOperationsMixin
+from ._entities_operations import EntitiesOperations
+
+__all__ = [
+ 'ManagementGroupsOperations',
+ 'ManagementGroupSubscriptionsOperations',
+ 'HierarchySettingsOperations',
+ 'Operations',
+ 'ManagementGroupsAPIOperationsMixin',
+ 'EntitiesOperations',
+]
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_entities_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_entities_operations.py
new file mode 100644
index 00000000000..4cb6fe0f82a
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_entities_operations.py
@@ -0,0 +1,178 @@
+# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class EntitiesOperations:
+ """EntitiesOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ skiptoken: Optional[str] = None,
+ skip: Optional[int] = None,
+ top: Optional[int] = None,
+ select: Optional[str] = None,
+ search: Optional[Union[str, "models.Enum2"]] = None,
+ filter: Optional[str] = None,
+ view: Optional[Union[str, "models.Enum3"]] = None,
+ group_name: Optional[str] = None,
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> AsyncIterable["models.EntityListResult"]:
+ """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.
+ :type skiptoken: str
+ :param skip: Number of entities to skip over when retrieving results. Passing this in will
+ override $skipToken.
+ :type skip: int
+ :param top: Number of elements to return when retrieving results. Passing this in will override
+ $skipToken.
+ :type top: int
+ :param select: This parameter specifies the fields to include in the response. Can include any
+ combination of Name,DisplayName,Type,ParentDisplayNameChain,ParentChain, e.g.
+ '$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain'. When specified the
+ $select parameter can override select in $skipToken.
+ :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.
+ 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.
+ :type search: str or ~management_groups_api.models.Enum2
+ :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.
+ :type filter: str
+ :param view: The view parameter allows clients to filter the type of data that is returned by
+ the getEntities call.
+ :type view: str or ~management_groups_api.models.Enum3
+ :param group_name: A filter which allows the get entities call to focus on a particular group
+ (i.e. "$filter=name eq 'groupName'").
+ :type group_name: str
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either EntityListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~management_groups_api.models.EntityListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.EntityListResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+ if skiptoken is not None:
+ query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
+ if skip is not None:
+ query_parameters['$skip'] = self._serialize.query("skip", skip, 'int')
+ if top is not None:
+ query_parameters['$top'] = self._serialize.query("top", top, 'int')
+ if select is not None:
+ query_parameters['$select'] = self._serialize.query("select", select, 'str')
+ if search is not None:
+ query_parameters['$search'] = self._serialize.query("search", search, 'str')
+ if filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
+ if view is not None:
+ query_parameters['$view'] = self._serialize.query("view", view, 'str')
+ if group_name is not None:
+ query_parameters['groupName'] = self._serialize.query("group_name", group_name, 'str')
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('EntityListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ list.metadata = {'url': '/providers/Microsoft.Management/getEntities'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_hierarchy_settings_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_hierarchy_settings_operations.py
new file mode 100644
index 00000000000..10feb2d4587
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_hierarchy_settings_operations.py
@@ -0,0 +1,326 @@
+# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class HierarchySettingsOperations:
+ """HierarchySettingsOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ async def list(
+ self,
+ group_id: str,
+ **kwargs
+ ) -> "models.HierarchySettingsList":
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: HierarchySettingsList, or the result of cls(response)
+ :rtype: ~management_groups_api.models.HierarchySettingsList
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.HierarchySettingsList"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('HierarchySettingsList', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ list.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings'} # type: ignore
+
+ async def get(
+ self,
+ group_id: str,
+ **kwargs
+ ) -> "models.HierarchySettings":
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: HierarchySettings, or the result of cls(response)
+ :rtype: ~management_groups_api.models.HierarchySettings
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.HierarchySettings"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('HierarchySettings', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} # type: ignore
+
+ async def create_or_update(
+ self,
+ group_id: str,
+ create_tenant_settings_request: "models.CreateOrUpdateSettingsRequest",
+ **kwargs
+ ) -> "models.HierarchySettings":
+ """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: ~management_groups_api.models.CreateOrUpdateSettingsRequest
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: HierarchySettings, or the result of cls(response)
+ :rtype: ~management_groups_api.models.HierarchySettings
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.HierarchySettings"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.create_or_update.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(create_tenant_settings_request, 'CreateOrUpdateSettingsRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('HierarchySettings', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_or_update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} # type: ignore
+
+ async def update(
+ self,
+ group_id: str,
+ create_tenant_settings_request: "models.CreateOrUpdateSettingsRequest",
+ **kwargs
+ ) -> "models.HierarchySettings":
+ """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: ~management_groups_api.models.CreateOrUpdateSettingsRequest
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: HierarchySettings, or the result of cls(response)
+ :rtype: ~management_groups_api.models.HierarchySettings
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.HierarchySettings"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.update.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(create_tenant_settings_request, 'CreateOrUpdateSettingsRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('HierarchySettings', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} # type: ignore
+
+ async def delete(
+ self,
+ group_id: str,
+ **kwargs
+ ) -> None:
+ """Deletes the hierarchy settings defined at the Management Group level.
+
+ :param group_id: Management Group ID.
+ :type group_id: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.delete.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_management_group_subscriptions_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_management_group_subscriptions_operations.py
new file mode 100644
index 00000000000..6193a998b50
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_management_group_subscriptions_operations.py
@@ -0,0 +1,309 @@
+# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class ManagementGroupSubscriptionsOperations:
+ """ManagementGroupSubscriptionsOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ async def create(
+ self,
+ group_id: str,
+ subscription_id: str,
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> "models.SubscriptionUnderManagementGroup":
+ """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 whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SubscriptionUnderManagementGroup, or the result of cls(response)
+ :rtype: ~management_groups_api.models.SubscriptionUnderManagementGroup
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionUnderManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.create.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.put(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('SubscriptionUnderManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} # type: ignore
+
+ async def delete(
+ self,
+ group_id: str,
+ subscription_id: str,
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> None:
+ """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 whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.delete.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} # type: ignore
+
+ async def get_subscription(
+ self,
+ group_id: str,
+ subscription_id: str,
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> "models.SubscriptionUnderManagementGroup":
+ """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 whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SubscriptionUnderManagementGroup, or the result of cls(response)
+ :rtype: ~management_groups_api.models.SubscriptionUnderManagementGroup
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionUnderManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get_subscription.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('SubscriptionUnderManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_subscription.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} # type: ignore
+
+ def get_subscriptions_under_management_group(
+ self,
+ group_id: str,
+ skiptoken: Optional[str] = None,
+ **kwargs
+ ) -> AsyncIterable["models.ListSubscriptionUnderManagementGroup"]:
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ListSubscriptionUnderManagementGroup or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~management_groups_api.models.ListSubscriptionUnderManagementGroup]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ListSubscriptionUnderManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.get_subscriptions_under_management_group.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+ if skiptoken is not None:
+ query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('ListSubscriptionUnderManagementGroup', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_subscriptions_under_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_management_groups_api_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_management_groups_api_operations.py
new file mode 100644
index 00000000000..a7404e9b0d9
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_management_groups_api_operations.py
@@ -0,0 +1,170 @@
+# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class ManagementGroupsAPIOperationsMixin:
+
+ async def check_name_availability(
+ self,
+ check_name_availability_request: "models.CheckNameAvailabilityRequest",
+ **kwargs
+ ) -> "models.CheckNameAvailabilityResult":
+ """Checks if the specified management group name is valid and unique.
+
+ :param check_name_availability_request: Management group name availability check parameters.
+ :type check_name_availability_request: ~management_groups_api.models.CheckNameAvailabilityRequest
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CheckNameAvailabilityResult, or the result of cls(response)
+ :rtype: ~management_groups_api.models.CheckNameAvailabilityResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.check_name_availability.metadata['url'] # type: ignore
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(check_name_availability_request, 'CheckNameAvailabilityRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ check_name_availability.metadata = {'url': '/providers/Microsoft.Management/checkNameAvailability'} # type: ignore
+
+ async def start_tenant_backfill(
+ self,
+ **kwargs
+ ) -> "models.TenantBackfillStatusResult":
+ """Starts backfilling subscriptions for the Tenant.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TenantBackfillStatusResult, or the result of cls(response)
+ :rtype: ~management_groups_api.models.TenantBackfillStatusResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TenantBackfillStatusResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.start_tenant_backfill.metadata['url'] # type: ignore
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('TenantBackfillStatusResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ start_tenant_backfill.metadata = {'url': '/providers/Microsoft.Management/startTenantBackfill'} # type: ignore
+
+ async def tenant_backfill_status(
+ self,
+ **kwargs
+ ) -> "models.TenantBackfillStatusResult":
+ """Gets tenant backfill status.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TenantBackfillStatusResult, or the result of cls(response)
+ :rtype: ~management_groups_api.models.TenantBackfillStatusResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TenantBackfillStatusResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.tenant_backfill_status.metadata['url'] # type: ignore
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('TenantBackfillStatusResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ tenant_backfill_status.metadata = {'url': '/providers/Microsoft.Management/tenantBackfillStatus'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_management_groups_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_management_groups_operations.py
new file mode 100644
index 00000000000..7bbef111689
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_management_groups_operations.py
@@ -0,0 +1,610 @@
+# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class ManagementGroupsOperations:
+ """ManagementGroupsOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ cache_control: Optional[str] = "no-cache",
+ skiptoken: Optional[str] = None,
+ **kwargs
+ ) -> AsyncIterable["models.ManagementGroupListResult"]:
+ """List management groups for the authenticated user.
+
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing 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.
+ :type skiptoken: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ManagementGroupListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~management_groups_api.models.ManagementGroupListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupListResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+ if skiptoken is not None:
+ query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('ManagementGroupListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ list.metadata = {'url': '/providers/Microsoft.Management/managementGroups'} # type: ignore
+
+ async def get(
+ self,
+ group_id: str,
+ expand: Optional[Union[str, "models.Enum0"]] = None,
+ recurse: Optional[bool] = None,
+ filter: Optional[str] = None,
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> "models.ManagementGroup":
+ """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. $expand=path includes the path from the root group to the
+ current group. $expand=ancestors includes the ancestor Ids of the current group.
+ :type expand: str or ~management_groups_api.models.Enum0
+ :param recurse: The $recurse=true query string parameter allows clients to request inclusion of
+ entire hierarchy in the response payload. Note that $expand=children must be passed up if
+ $recurse is set to true.
+ :type recurse: bool
+ :param filter: A filter which allows the exclusion of subscriptions from results (i.e.
+ '$filter=children.childType ne Subscription').
+ :type filter: str
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: ManagementGroup, or the result of cls(response)
+ :rtype: ~management_groups_api.models.ManagementGroup
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+ if expand is not None:
+ query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
+ if recurse is not None:
+ query_parameters['$recurse'] = self._serialize.query("recurse", recurse, 'bool')
+ if filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('ManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ async def _create_or_update_initial(
+ self,
+ group_id: str,
+ create_management_group_request: "models.CreateManagementGroupRequest",
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> Union["models.ManagementGroup", "models.AzureAsyncOperationResults"]:
+ cls = kwargs.pop('cls', None) # type: ClsType[Union["models.ManagementGroup", "models.AzureAsyncOperationResults"]]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self._create_or_update_initial.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(create_management_group_request, 'CreateManagementGroupRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize('ManagementGroup', pipeline_response)
+
+ if response.status_code == 202:
+ response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
+ response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation'))
+ deserialized = self._deserialize('AzureAsyncOperationResults', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ _create_or_update_initial.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ async def begin_create_or_update(
+ self,
+ group_id: str,
+ create_management_group_request: "models.CreateManagementGroupRequest",
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> AsyncLROPoller[Union["models.ManagementGroup", "models.AzureAsyncOperationResults"]]:
+ """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
+ :param create_management_group_request: Management group creation parameters.
+ :type create_management_group_request: ~management_groups_api.models.CreateManagementGroupRequest
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either ManagementGroup or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~management_groups_api.models.ManagementGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType[Union["models.ManagementGroup", "models.AzureAsyncOperationResults"]]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = await self._create_or_update_initial(
+ group_id=group_id,
+ create_management_group_request=create_management_group_request,
+ cache_control=cache_control,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize('ManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ path_format_arguments = {
+ 'groupId': self._serialize.url("group_id", group_id, 'str'),
+ }
+
+ if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = AsyncNoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_create_or_update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ async def update(
+ self,
+ group_id: str,
+ patch_group_request: "models.PatchManagementGroupRequest",
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> "models.ManagementGroup":
+ """Update a management group.
+
+ :param group_id: Management Group ID.
+ :type group_id: str
+ :param patch_group_request: Management group patch parameters.
+ :type patch_group_request: ~management_groups_api.models.PatchManagementGroupRequest
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: ManagementGroup, or the result of cls(response)
+ :rtype: ~management_groups_api.models.ManagementGroup
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.update.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(patch_group_request, 'PatchManagementGroupRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('ManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ async def _delete_initial(
+ self,
+ group_id: str,
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> Optional["models.AzureAsyncOperationResults"]:
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureAsyncOperationResults"]]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self._delete_initial.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ deserialized = None
+ if response.status_code == 202:
+ response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
+ response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation'))
+ deserialized = self._deserialize('AzureAsyncOperationResults', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ _delete_initial.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ async def begin_delete(
+ self,
+ group_id: str,
+ cache_control: Optional[str] = "no-cache",
+ **kwargs
+ ) -> AsyncLROPoller["models.AzureAsyncOperationResults"]:
+ """Delete management group.
+ If a management group contains child resources, the request will fail.
+
+ :param group_id: Management Group ID.
+ :type group_id: str
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either AzureAsyncOperationResults or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[~management_groups_api.models.AzureAsyncOperationResults]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureAsyncOperationResults"]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = await self._delete_initial(
+ group_id=group_id,
+ cache_control=cache_control,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
+ response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation'))
+ deserialized = self._deserialize('AzureAsyncOperationResults', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+ return deserialized
+
+ path_format_arguments = {
+ 'groupId': self._serialize.url("group_id", group_id, 'str'),
+ }
+
+ if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = AsyncNoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ def get_descendants(
+ self,
+ group_id: str,
+ skiptoken: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs
+ ) -> AsyncIterable["models.DescendantListResult"]:
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DescendantListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~management_groups_api.models.DescendantListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DescendantListResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.get_descendants.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", 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')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('DescendantListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ get_descendants.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/descendants'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_operations.py
new file mode 100644
index 00000000000..231c4925493
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/aio/operations/_operations.py
@@ -0,0 +1,105 @@
+# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
+import warnings
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class Operations:
+ """Operations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ **kwargs
+ ) -> AsyncIterable["models.OperationListResult"]:
+ """Lists all of the available Management REST API operations.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either OperationListResult or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~management_groups_api.models.OperationListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize('OperationListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+ list.metadata = {'url': '/providers/Microsoft.Management/operations'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/__init__.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/__init__.py
new file mode 100644
index 00000000000..9fe767e89df
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/__init__.py
@@ -0,0 +1,135 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+try:
+ from ._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 DescendantListResult
+ from ._models_py3 import DescendantParentGroupInfo
+ from ._models_py3 import EntityHierarchyItem
+ from ._models_py3 import EntityInfo
+ from ._models_py3 import EntityListResult
+ from ._models_py3 import EntityParentGroupInfo
+ from ._models_py3 import ErrorDetails
+ from ._models_py3 import ErrorResponse
+ from ._models_py3 import HierarchySettings
+ from ._models_py3 import HierarchySettingsInfo
+ from ._models_py3 import HierarchySettingsList
+ from ._models_py3 import ListSubscriptionUnderManagementGroup
+ from ._models_py3 import ManagementGroup
+ from ._models_py3 import ManagementGroupChildInfo
+ from ._models_py3 import ManagementGroupDetails
+ from ._models_py3 import ManagementGroupInfo
+ from ._models_py3 import ManagementGroupListResult
+ from ._models_py3 import ManagementGroupPathElement
+ from ._models_py3 import Operation
+ from ._models_py3 import OperationDisplayProperties
+ from ._models_py3 import OperationListResult
+ 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 ._models import AzureAsyncOperationResults # type: ignore
+ from ._models import CheckNameAvailabilityRequest # type: ignore
+ from ._models import CheckNameAvailabilityResult # type: ignore
+ from ._models import CreateManagementGroupChildInfo # type: ignore
+ from ._models import CreateManagementGroupDetails # type: ignore
+ from ._models import CreateManagementGroupRequest # type: ignore
+ from ._models import CreateOrUpdateSettingsRequest # type: ignore
+ from ._models import CreateParentGroupInfo # type: ignore
+ from ._models import DescendantInfo # type: ignore
+ from ._models import DescendantListResult # type: ignore
+ from ._models import DescendantParentGroupInfo # type: ignore
+ from ._models import EntityHierarchyItem # type: ignore
+ from ._models import EntityInfo # type: ignore
+ from ._models import EntityListResult # type: ignore
+ from ._models import EntityParentGroupInfo # type: ignore
+ from ._models import ErrorDetails # type: ignore
+ from ._models import ErrorResponse # type: ignore
+ from ._models import HierarchySettings # type: ignore
+ from ._models import HierarchySettingsInfo # type: ignore
+ from ._models import HierarchySettingsList # type: ignore
+ from ._models import ListSubscriptionUnderManagementGroup # type: ignore
+ from ._models import ManagementGroup # type: ignore
+ from ._models import ManagementGroupChildInfo # type: ignore
+ from ._models import ManagementGroupDetails # type: ignore
+ from ._models import ManagementGroupInfo # type: ignore
+ from ._models import ManagementGroupListResult # type: ignore
+ from ._models import ManagementGroupPathElement # type: ignore
+ from ._models import Operation # type: ignore
+ from ._models import OperationDisplayProperties # type: ignore
+ from ._models import OperationListResult # type: ignore
+ from ._models import OperationResults # type: ignore
+ from ._models import ParentGroupInfo # type: ignore
+ from ._models import PatchManagementGroupRequest # type: ignore
+ from ._models import SubscriptionUnderManagementGroup # type: ignore
+ from ._models import TenantBackfillStatusResult # type: ignore
+
+from ._management_groups_api_enums import (
+ Enum0,
+ Enum2,
+ Enum3,
+ ManagementGroupChildType,
+ Permissions,
+ Reason,
+ Status,
+)
+
+__all__ = [
+ 'AzureAsyncOperationResults',
+ 'CheckNameAvailabilityRequest',
+ 'CheckNameAvailabilityResult',
+ 'CreateManagementGroupChildInfo',
+ 'CreateManagementGroupDetails',
+ 'CreateManagementGroupRequest',
+ 'CreateOrUpdateSettingsRequest',
+ 'CreateParentGroupInfo',
+ 'DescendantInfo',
+ 'DescendantListResult',
+ 'DescendantParentGroupInfo',
+ 'EntityHierarchyItem',
+ 'EntityInfo',
+ 'EntityListResult',
+ 'EntityParentGroupInfo',
+ 'ErrorDetails',
+ 'ErrorResponse',
+ 'HierarchySettings',
+ 'HierarchySettingsInfo',
+ 'HierarchySettingsList',
+ 'ListSubscriptionUnderManagementGroup',
+ 'ManagementGroup',
+ 'ManagementGroupChildInfo',
+ 'ManagementGroupDetails',
+ 'ManagementGroupInfo',
+ 'ManagementGroupListResult',
+ 'ManagementGroupPathElement',
+ 'Operation',
+ 'OperationDisplayProperties',
+ 'OperationListResult',
+ 'OperationResults',
+ 'ParentGroupInfo',
+ 'PatchManagementGroupRequest',
+ 'SubscriptionUnderManagementGroup',
+ 'TenantBackfillStatusResult',
+ 'Enum0',
+ 'Enum2',
+ 'Enum3',
+ 'ManagementGroupChildType',
+ 'Permissions',
+ 'Reason',
+ 'Status',
+]
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/_management_groups_api_enums.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/_management_groups_api_enums.py
new file mode 100644
index 00000000000..a4e30c01a20
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/_management_groups_api_enums.py
@@ -0,0 +1,84 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from enum import Enum, EnumMeta
+from six import with_metaclass
+
+class _CaseInsensitiveEnumMeta(EnumMeta):
+ def __getitem__(self, name):
+ return super().__getitem__(name.upper())
+
+ def __getattr__(cls, name):
+ """Return the enum member matching `name`
+ We use __getattr__ instead of descriptors or inserting into the enum
+ class' __dict__ in order to support `name` and `value` being both
+ properties for enum members (which live in the class' __dict__) and
+ enum members themselves.
+ """
+ try:
+ return cls._member_map_[name.upper()]
+ except KeyError:
+ raise AttributeError(name)
+
+
+class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+
+ CHILDREN = "children"
+ PATH = "path"
+ ANCESTORS = "ancestors"
+
+class Enum2(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+
+ ALLOWED_PARENTS = "AllowedParents"
+ ALLOWED_CHILDREN = "AllowedChildren"
+ PARENT_AND_FIRST_LEVEL_CHILDREN = "ParentAndFirstLevelChildren"
+ PARENT_ONLY = "ParentOnly"
+ CHILDREN_ONLY = "ChildrenOnly"
+
+class Enum3(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+
+ FULL_HIERARCHY = "FullHierarchy"
+ GROUPS_ONLY = "GroupsOnly"
+ SUBSCRIPTIONS_ONLY = "SubscriptionsOnly"
+ AUDIT = "Audit"
+
+class ManagementGroupChildType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The type of child resource.
+ """
+
+ MICROSOFT_MANAGEMENT_MANAGEMENT_GROUPS = "Microsoft.Management/managementGroups"
+ __SUBSCRIPTIONS = "/subscriptions"
+
+class Permissions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The users specific permissions to this item.
+ """
+
+ NOACCESS = "noaccess"
+ VIEW = "view"
+ EDIT = "edit"
+ DELETE = "delete"
+
+class Reason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """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.
+ """
+
+ INVALID = "Invalid"
+ ALREADY_EXISTS = "AlreadyExists"
+
+class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The status of the Tenant Backfill
+ """
+
+ NOT_STARTED = "NotStarted"
+ NOT_STARTED_BUT_GROUPS_EXIST = "NotStartedButGroupsExist"
+ STARTED = "Started"
+ FAILED = "Failed"
+ CANCELLED = "Cancelled"
+ COMPLETED = "Completed"
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/_models.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/_models.py
new file mode 100644
index 00000000000..c079766661e
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/_models.py
@@ -0,0 +1,1360 @@
+# 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 azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+
+class AzureAsyncOperationResults(msrest.serialization.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(msrest.serialization.Model):
+ """Management group name availability check parameters.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param name: the name to check for availability.
+ :type name: str
+ :ivar type: fully qualified resource type which includes provider namespace. Default value:
+ "Microsoft.Management/managementGroups".
+ :vartype type: str
+ """
+
+ _validation = {
+ 'type': {'constant': True},
+ }
+
+ _attribute_map = {
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ }
+
+ type = "Microsoft.Management/managementGroups"
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(CheckNameAvailabilityRequest, self).__init__(**kwargs)
+ self.name = kwargs.get('name', None)
+
+
+class CheckNameAvailabilityResult(msrest.serialization.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 ~management_groups_api.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': 'str'},
+ '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 CreateManagementGroupChildInfo(msrest.serialization.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 fully qualified resource type which includes provider namespace (e.g.
+ Microsoft.Management/managementGroups). Possible values include:
+ "Microsoft.Management/managementGroups", "/subscriptions".
+ :vartype type: str or ~management_groups_api.models.ManagementGroupChildType
+ :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[~management_groups_api.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(msrest.serialization.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: int
+ :ivar updated_time: The date and time when this object was last updated.
+ :vartype updated_time: ~datetime.datetime
+ :ivar updated_by: The identity of the principal or process that updated the object.
+ :vartype updated_by: str
+ :param parent: (Optional) The ID of the parent management group used during creation.
+ :type parent: ~management_groups_api.models.CreateParentGroupInfo
+ """
+
+ _validation = {
+ 'version': {'readonly': True},
+ 'updated_time': {'readonly': True},
+ 'updated_by': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'version': {'key': 'version', 'type': 'int'},
+ '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(msrest.serialization.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: The details of a management group used during creation.
+ :type details: ~management_groups_api.models.CreateManagementGroupDetails
+ :ivar children: The list of children.
+ :vartype children: list[~management_groups_api.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(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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: The ID of the parent management group.
+ :type parent: ~management_groups_api.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 DescendantListResult(msrest.serialization.Model):
+ """Describes the result of the request to view descendants.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param value: The list of descendants.
+ :type value: list[~management_groups_api.models.DescendantInfo]
+ :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': '[DescendantInfo]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(DescendantListResult, self).__init__(**kwargs)
+ self.value = kwargs.get('value', None)
+ self.next_link = None
+
+
+class DescendantParentGroupInfo(msrest.serialization.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(msrest.serialization.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: The users specific permissions to this item. Possible values include:
+ "noaccess", "view", "edit", "delete".
+ :type permissions: str or ~management_groups_api.models.Permissions
+ :param children: The list of children.
+ :type children: list[~management_groups_api.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(msrest.serialization.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: (Optional) The ID of the parent management group.
+ :type parent: ~management_groups_api.models.EntityParentGroupInfo
+ :param permissions: The users specific permissions to this item. Possible values include:
+ "noaccess", "view", "edit", "delete".
+ :type permissions: str or ~management_groups_api.models.Permissions
+ :param inherited_permissions: The users specific permissions to this item. Possible values
+ include: "noaccess", "view", "edit", "delete".
+ :type inherited_permissions: str or ~management_groups_api.models.Permissions
+ :param number_of_descendants: Number of Descendants.
+ :type number_of_descendants: int
+ :param 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 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 EntityListResult(msrest.serialization.Model):
+ """Describes the result of the request to view entities.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param value: The list of entities.
+ :type value: list[~management_groups_api.models.EntityInfo]
+ :ivar count: Total count of records that match the filter.
+ :vartype count: int
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'count': {'readonly': True},
+ 'next_link': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[EntityInfo]'},
+ 'count': {'key': 'count', 'type': 'int'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(EntityListResult, self).__init__(**kwargs)
+ self.value = kwargs.get('value', None)
+ self.count = None
+ self.next_link = None
+
+
+class EntityParentGroupInfo(msrest.serialization.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(msrest.serialization.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(msrest.serialization.Model):
+ """The error object.
+
+ :param error: The details of the error.
+ :type error: ~management_groups_api.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 HierarchySettings(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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[~management_groups_api.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 ListSubscriptionUnderManagementGroup(msrest.serialization.Model):
+ """The details of all subscriptions under management group.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param value: The list of subscriptions.
+ :type value: list[~management_groups_api.models.SubscriptionUnderManagementGroup]
+ :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': '[SubscriptionUnderManagementGroup]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ListSubscriptionUnderManagementGroup, self).__init__(**kwargs)
+ self.value = kwargs.get('value', None)
+ self.next_link = None
+
+
+class ManagementGroup(msrest.serialization.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: The details of a management group.
+ :type details: ~management_groups_api.models.ManagementGroupDetails
+ :param children: The list of children.
+ :type children: list[~management_groups_api.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'},
+ '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.details = kwargs.get('details', None)
+ self.children = kwargs.get('children', None)
+
+
+class ManagementGroupChildInfo(msrest.serialization.Model):
+ """The child information of a management group.
+
+ :param type: 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 ~management_groups_api.models.ManagementGroupChildType
+ :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[~management_groups_api.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(msrest.serialization.Model):
+ """The details of a management group.
+
+ :param version: The version number of the object.
+ :type version: int
+ :param updated_time: The date and time when this object was last updated.
+ :type updated_time: ~datetime.datetime
+ :param updated_by: The identity of the principal or process that updated the object.
+ :type updated_by: str
+ :param parent: (Optional) The ID of the parent management group.
+ :type parent: ~management_groups_api.models.ParentGroupInfo
+ :param path: The path from the root to the current group.
+ :type path: list[~management_groups_api.models.ManagementGroupPathElement]
+ :param management_group_ancestors: The ancestors of the management group.
+ :type management_group_ancestors: list[str]
+ :param management_group_ancestors_chain: The ancestors of the management group displayed in
+ reversed order, from immediate parent to the root.
+ :type management_group_ancestors_chain:
+ list[~management_groups_api.models.ManagementGroupPathElement]
+ """
+
+ _attribute_map = {
+ 'version': {'key': 'version', 'type': 'int'},
+ 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'},
+ 'updated_by': {'key': 'updatedBy', 'type': 'str'},
+ 'parent': {'key': 'parent', 'type': 'ParentGroupInfo'},
+ 'path': {'key': 'path', 'type': '[ManagementGroupPathElement]'},
+ 'management_group_ancestors': {'key': 'managementGroupAncestors', 'type': '[str]'},
+ 'management_group_ancestors_chain': {'key': 'managementGroupAncestorsChain', 'type': '[ManagementGroupPathElement]'},
+ }
+
+ 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)
+ self.path = kwargs.get('path', None)
+ self.management_group_ancestors = kwargs.get('management_group_ancestors', None)
+ self.management_group_ancestors_chain = kwargs.get('management_group_ancestors_chain', None)
+
+
+class ManagementGroupInfo(msrest.serialization.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 ManagementGroupListResult(msrest.serialization.Model):
+ """Describes the result of the request to list management groups.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param value: The list of management groups.
+ :type value: list[~management_groups_api.models.ManagementGroupInfo]
+ :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': '[ManagementGroupInfo]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ManagementGroupListResult, self).__init__(**kwargs)
+ self.value = kwargs.get('value', None)
+ self.next_link = None
+
+
+class ManagementGroupPathElement(msrest.serialization.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(msrest.serialization.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: The object that represents the operation.
+ :type display: ~management_groups_api.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(msrest.serialization.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 OperationListResult(msrest.serialization.Model):
+ """Describes the result of the request to list Microsoft.Management operations.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: List of operations supported by the Microsoft.Management resource provider.
+ :vartype value: list[~management_groups_api.models.Operation]
+ :ivar next_link: URL to get the next set of operation list results if there are any.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ 'next_link': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[Operation]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(OperationListResult, self).__init__(**kwargs)
+ self.value = None
+ self.next_link = None
+
+
+class OperationResults(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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(msrest.serialization.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: The ID of the parent management group.
+ :type parent: ~management_groups_api.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(msrest.serialization.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 ~management_groups_api.models.Status
+ """
+
+ _validation = {
+ 'tenant_id': {'readonly': True},
+ 'status': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'tenant_id': {'key': 'tenantId', 'type': 'str'},
+ 'status': {'key': 'status', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TenantBackfillStatusResult, self).__init__(**kwargs)
+ self.tenant_id = None
+ self.status = None
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/_models_py3.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/_models_py3.py
new file mode 100644
index 00000000000..7c12fbad0e6
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/models/_models_py3.py
@@ -0,0 +1,1469 @@
+# 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 datetime
+from typing import List, Optional, Union
+
+from azure.core.exceptions import HttpResponseError
+import msrest.serialization
+
+from ._management_groups_api_enums import *
+
+
+class AzureAsyncOperationResults(msrest.serialization.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: Optional[str] = None,
+ display_name: Optional[str] = None,
+ **kwargs
+ ):
+ 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(msrest.serialization.Model):
+ """Management group name availability check parameters.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param name: the name to check for availability.
+ :type name: str
+ :ivar type: fully qualified resource type which includes provider namespace. Default value:
+ "Microsoft.Management/managementGroups".
+ :vartype type: str
+ """
+
+ _validation = {
+ 'type': {'constant': True},
+ }
+
+ _attribute_map = {
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ }
+
+ type = "Microsoft.Management/managementGroups"
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ **kwargs
+ ):
+ super(CheckNameAvailabilityRequest, self).__init__(**kwargs)
+ self.name = name
+
+
+class CheckNameAvailabilityResult(msrest.serialization.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 ~management_groups_api.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': 'str'},
+ '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 CreateManagementGroupChildInfo(msrest.serialization.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 fully qualified resource type which includes provider namespace (e.g.
+ Microsoft.Management/managementGroups). Possible values include:
+ "Microsoft.Management/managementGroups", "/subscriptions".
+ :vartype type: str or ~management_groups_api.models.ManagementGroupChildType
+ :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[~management_groups_api.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(msrest.serialization.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: int
+ :ivar updated_time: The date and time when this object was last updated.
+ :vartype updated_time: ~datetime.datetime
+ :ivar updated_by: The identity of the principal or process that updated the object.
+ :vartype updated_by: str
+ :param parent: (Optional) The ID of the parent management group used during creation.
+ :type parent: ~management_groups_api.models.CreateParentGroupInfo
+ """
+
+ _validation = {
+ 'version': {'readonly': True},
+ 'updated_time': {'readonly': True},
+ 'updated_by': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'version': {'key': 'version', 'type': 'int'},
+ 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'},
+ 'updated_by': {'key': 'updatedBy', 'type': 'str'},
+ 'parent': {'key': 'parent', 'type': 'CreateParentGroupInfo'},
+ }
+
+ def __init__(
+ self,
+ *,
+ parent: Optional["CreateParentGroupInfo"] = None,
+ **kwargs
+ ):
+ super(CreateManagementGroupDetails, self).__init__(**kwargs)
+ self.version = None
+ self.updated_time = None
+ self.updated_by = None
+ self.parent = parent
+
+
+class CreateManagementGroupRequest(msrest.serialization.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: The details of a management group used during creation.
+ :type details: ~management_groups_api.models.CreateManagementGroupDetails
+ :ivar children: The list of children.
+ :vartype children: list[~management_groups_api.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: Optional[str] = None,
+ display_name: Optional[str] = None,
+ details: Optional["CreateManagementGroupDetails"] = None,
+ **kwargs
+ ):
+ 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(msrest.serialization.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: Optional[bool] = None,
+ default_management_group: Optional[str] = None,
+ **kwargs
+ ):
+ 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(msrest.serialization.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: Optional[str] = None,
+ **kwargs
+ ):
+ super(CreateParentGroupInfo, self).__init__(**kwargs)
+ self.id = id
+ self.name = None
+ self.display_name = None
+
+
+class DescendantInfo(msrest.serialization.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: The ID of the parent management group.
+ :type parent: ~management_groups_api.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: Optional[str] = None,
+ parent: Optional["DescendantParentGroupInfo"] = None,
+ **kwargs
+ ):
+ super(DescendantInfo, self).__init__(**kwargs)
+ self.id = None
+ self.type = None
+ self.name = None
+ self.display_name = display_name
+ self.parent = parent
+
+
+class DescendantListResult(msrest.serialization.Model):
+ """Describes the result of the request to view descendants.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param value: The list of descendants.
+ :type value: list[~management_groups_api.models.DescendantInfo]
+ :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': '[DescendantInfo]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[List["DescendantInfo"]] = None,
+ **kwargs
+ ):
+ super(DescendantListResult, self).__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class DescendantParentGroupInfo(msrest.serialization.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: Optional[str] = None,
+ **kwargs
+ ):
+ super(DescendantParentGroupInfo, self).__init__(**kwargs)
+ self.id = id
+
+
+class EntityHierarchyItem(msrest.serialization.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: The users specific permissions to this item. Possible values include:
+ "noaccess", "view", "edit", "delete".
+ :type permissions: str or ~management_groups_api.models.Permissions
+ :param children: The list of children.
+ :type children: list[~management_groups_api.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: Optional[str] = None,
+ permissions: Optional[Union[str, "Permissions"]] = None,
+ children: Optional[List["EntityHierarchyItem"]] = None,
+ **kwargs
+ ):
+ 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(msrest.serialization.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: (Optional) The ID of the parent management group.
+ :type parent: ~management_groups_api.models.EntityParentGroupInfo
+ :param permissions: The users specific permissions to this item. Possible values include:
+ "noaccess", "view", "edit", "delete".
+ :type permissions: str or ~management_groups_api.models.Permissions
+ :param inherited_permissions: The users specific permissions to this item. Possible values
+ include: "noaccess", "view", "edit", "delete".
+ :type inherited_permissions: str or ~management_groups_api.models.Permissions
+ :param number_of_descendants: Number of Descendants.
+ :type number_of_descendants: int
+ :param 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 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: Optional[str] = None,
+ display_name: Optional[str] = None,
+ parent: Optional["EntityParentGroupInfo"] = None,
+ permissions: Optional[Union[str, "Permissions"]] = None,
+ inherited_permissions: Optional[Union[str, "Permissions"]] = None,
+ number_of_descendants: Optional[int] = None,
+ number_of_children: Optional[int] = None,
+ number_of_child_groups: Optional[int] = None,
+ parent_display_name_chain: Optional[List[str]] = None,
+ parent_name_chain: Optional[List[str]] = None,
+ **kwargs
+ ):
+ 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 EntityListResult(msrest.serialization.Model):
+ """Describes the result of the request to view entities.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param value: The list of entities.
+ :type value: list[~management_groups_api.models.EntityInfo]
+ :ivar count: Total count of records that match the filter.
+ :vartype count: int
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'count': {'readonly': True},
+ 'next_link': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[EntityInfo]'},
+ 'count': {'key': 'count', 'type': 'int'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[List["EntityInfo"]] = None,
+ **kwargs
+ ):
+ super(EntityListResult, self).__init__(**kwargs)
+ self.value = value
+ self.count = None
+ self.next_link = None
+
+
+class EntityParentGroupInfo(msrest.serialization.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: Optional[str] = None,
+ **kwargs
+ ):
+ super(EntityParentGroupInfo, self).__init__(**kwargs)
+ self.id = id
+
+
+class ErrorDetails(msrest.serialization.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: Optional[str] = None,
+ message: Optional[str] = None,
+ details: Optional[str] = None,
+ **kwargs
+ ):
+ super(ErrorDetails, self).__init__(**kwargs)
+ self.code = code
+ self.message = message
+ self.details = details
+
+
+class ErrorResponse(msrest.serialization.Model):
+ """The error object.
+
+ :param error: The details of the error.
+ :type error: ~management_groups_api.models.ErrorDetails
+ """
+
+ _attribute_map = {
+ 'error': {'key': 'error', 'type': 'ErrorDetails'},
+ }
+
+ def __init__(
+ self,
+ *,
+ error: Optional["ErrorDetails"] = None,
+ **kwargs
+ ):
+ super(ErrorResponse, self).__init__(**kwargs)
+ self.error = error
+
+
+class HierarchySettings(msrest.serialization.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: Optional[str] = None,
+ require_authorization_for_group_creation: Optional[bool] = None,
+ default_management_group: Optional[str] = None,
+ **kwargs
+ ):
+ 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(msrest.serialization.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: Optional[str] = None,
+ require_authorization_for_group_creation: Optional[bool] = None,
+ default_management_group: Optional[str] = None,
+ **kwargs
+ ):
+ 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(msrest.serialization.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[~management_groups_api.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: Optional[List["HierarchySettingsInfo"]] = None,
+ **kwargs
+ ):
+ super(HierarchySettingsList, self).__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class ListSubscriptionUnderManagementGroup(msrest.serialization.Model):
+ """The details of all subscriptions under management group.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param value: The list of subscriptions.
+ :type value: list[~management_groups_api.models.SubscriptionUnderManagementGroup]
+ :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': '[SubscriptionUnderManagementGroup]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[List["SubscriptionUnderManagementGroup"]] = None,
+ **kwargs
+ ):
+ super(ListSubscriptionUnderManagementGroup, self).__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class ManagementGroup(msrest.serialization.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: The details of a management group.
+ :type details: ~management_groups_api.models.ManagementGroupDetails
+ :param children: The list of children.
+ :type children: list[~management_groups_api.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'},
+ 'details': {'key': 'properties.details', 'type': 'ManagementGroupDetails'},
+ 'children': {'key': 'properties.children', 'type': '[ManagementGroupChildInfo]'},
+ }
+
+ def __init__(
+ self,
+ *,
+ tenant_id: Optional[str] = None,
+ display_name: Optional[str] = None,
+ details: Optional["ManagementGroupDetails"] = None,
+ children: Optional[List["ManagementGroupChildInfo"]] = None,
+ **kwargs
+ ):
+ 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
+
+
+class ManagementGroupChildInfo(msrest.serialization.Model):
+ """The child information of a management group.
+
+ :param type: 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 ~management_groups_api.models.ManagementGroupChildType
+ :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[~management_groups_api.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: Optional[Union[str, "ManagementGroupChildType"]] = None,
+ id: Optional[str] = None,
+ name: Optional[str] = None,
+ display_name: Optional[str] = None,
+ children: Optional[List["ManagementGroupChildInfo"]] = None,
+ **kwargs
+ ):
+ super(ManagementGroupChildInfo, self).__init__(**kwargs)
+ self.type = type
+ self.id = id
+ self.name = name
+ self.display_name = display_name
+ self.children = children
+
+
+class ManagementGroupDetails(msrest.serialization.Model):
+ """The details of a management group.
+
+ :param version: The version number of the object.
+ :type version: int
+ :param updated_time: The date and time when this object was last updated.
+ :type updated_time: ~datetime.datetime
+ :param updated_by: The identity of the principal or process that updated the object.
+ :type updated_by: str
+ :param parent: (Optional) The ID of the parent management group.
+ :type parent: ~management_groups_api.models.ParentGroupInfo
+ :param path: The path from the root to the current group.
+ :type path: list[~management_groups_api.models.ManagementGroupPathElement]
+ :param management_group_ancestors: The ancestors of the management group.
+ :type management_group_ancestors: list[str]
+ :param management_group_ancestors_chain: The ancestors of the management group displayed in
+ reversed order, from immediate parent to the root.
+ :type management_group_ancestors_chain:
+ list[~management_groups_api.models.ManagementGroupPathElement]
+ """
+
+ _attribute_map = {
+ 'version': {'key': 'version', 'type': 'int'},
+ 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'},
+ 'updated_by': {'key': 'updatedBy', 'type': 'str'},
+ 'parent': {'key': 'parent', 'type': 'ParentGroupInfo'},
+ 'path': {'key': 'path', 'type': '[ManagementGroupPathElement]'},
+ 'management_group_ancestors': {'key': 'managementGroupAncestors', 'type': '[str]'},
+ 'management_group_ancestors_chain': {'key': 'managementGroupAncestorsChain', 'type': '[ManagementGroupPathElement]'},
+ }
+
+ def __init__(
+ self,
+ *,
+ version: Optional[int] = None,
+ updated_time: Optional[datetime.datetime] = None,
+ updated_by: Optional[str] = None,
+ parent: Optional["ParentGroupInfo"] = None,
+ path: Optional[List["ManagementGroupPathElement"]] = None,
+ management_group_ancestors: Optional[List[str]] = None,
+ management_group_ancestors_chain: Optional[List["ManagementGroupPathElement"]] = None,
+ **kwargs
+ ):
+ super(ManagementGroupDetails, self).__init__(**kwargs)
+ self.version = version
+ self.updated_time = updated_time
+ self.updated_by = updated_by
+ self.parent = parent
+ self.path = path
+ self.management_group_ancestors = management_group_ancestors
+ self.management_group_ancestors_chain = management_group_ancestors_chain
+
+
+class ManagementGroupInfo(msrest.serialization.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: Optional[str] = None,
+ display_name: Optional[str] = None,
+ **kwargs
+ ):
+ 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 ManagementGroupListResult(msrest.serialization.Model):
+ """Describes the result of the request to list management groups.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :param value: The list of management groups.
+ :type value: list[~management_groups_api.models.ManagementGroupInfo]
+ :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': '[ManagementGroupInfo]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[List["ManagementGroupInfo"]] = None,
+ **kwargs
+ ):
+ super(ManagementGroupListResult, self).__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class ManagementGroupPathElement(msrest.serialization.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: Optional[str] = None,
+ display_name: Optional[str] = None,
+ **kwargs
+ ):
+ super(ManagementGroupPathElement, self).__init__(**kwargs)
+ self.name = name
+ self.display_name = display_name
+
+
+class Operation(msrest.serialization.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: The object that represents the operation.
+ :type display: ~management_groups_api.models.OperationDisplayProperties
+ """
+
+ _validation = {
+ 'name': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'name': {'key': 'name', 'type': 'str'},
+ 'display': {'key': 'display', 'type': 'OperationDisplayProperties'},
+ }
+
+ def __init__(
+ self,
+ *,
+ display: Optional["OperationDisplayProperties"] = None,
+ **kwargs
+ ):
+ super(Operation, self).__init__(**kwargs)
+ self.name = None
+ self.display = display
+
+
+class OperationDisplayProperties(msrest.serialization.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 OperationListResult(msrest.serialization.Model):
+ """Describes the result of the request to list Microsoft.Management operations.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: List of operations supported by the Microsoft.Management resource provider.
+ :vartype value: list[~management_groups_api.models.Operation]
+ :ivar next_link: URL to get the next set of operation list results if there are any.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'value': {'readonly': True},
+ 'next_link': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'value': {'key': 'value', 'type': '[Operation]'},
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(OperationListResult, self).__init__(**kwargs)
+ self.value = None
+ self.next_link = None
+
+
+class OperationResults(msrest.serialization.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: Optional[str] = None,
+ display_name: Optional[str] = None,
+ **kwargs
+ ):
+ 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(msrest.serialization.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: Optional[str] = None,
+ name: Optional[str] = None,
+ display_name: Optional[str] = None,
+ **kwargs
+ ):
+ super(ParentGroupInfo, self).__init__(**kwargs)
+ self.id = id
+ self.name = name
+ self.display_name = display_name
+
+
+class PatchManagementGroupRequest(msrest.serialization.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: Optional[str] = None,
+ parent_group_id: Optional[str] = None,
+ **kwargs
+ ):
+ super(PatchManagementGroupRequest, self).__init__(**kwargs)
+ self.display_name = display_name
+ self.parent_group_id = parent_group_id
+
+
+class SubscriptionUnderManagementGroup(msrest.serialization.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: The ID of the parent management group.
+ :type parent: ~management_groups_api.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: Optional[str] = None,
+ display_name: Optional[str] = None,
+ parent: Optional["DescendantParentGroupInfo"] = None,
+ state: Optional[str] = None,
+ **kwargs
+ ):
+ 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(msrest.serialization.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 ~management_groups_api.models.Status
+ """
+
+ _validation = {
+ 'tenant_id': {'readonly': True},
+ 'status': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'tenant_id': {'key': 'tenantId', 'type': 'str'},
+ 'status': {'key': 'status', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(TenantBackfillStatusResult, self).__init__(**kwargs)
+ self.tenant_id = None
+ self.status = None
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/__init__.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/__init__.py
new file mode 100644
index 00000000000..d3c6bc42bbe
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/__init__.py
@@ -0,0 +1,23 @@
+# 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 ._management_groups_operations import ManagementGroupsOperations
+from ._management_group_subscriptions_operations import ManagementGroupSubscriptionsOperations
+from ._hierarchy_settings_operations import HierarchySettingsOperations
+from ._operations import Operations
+from ._management_groups_api_operations import ManagementGroupsAPIOperationsMixin
+from ._entities_operations import EntitiesOperations
+
+__all__ = [
+ 'ManagementGroupsOperations',
+ 'ManagementGroupSubscriptionsOperations',
+ 'HierarchySettingsOperations',
+ 'Operations',
+ 'ManagementGroupsAPIOperationsMixin',
+ 'EntitiesOperations',
+]
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_entities_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_entities_operations.py
new file mode 100644
index 00000000000..7b449738c85
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_entities_operations.py
@@ -0,0 +1,183 @@
+# 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 typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class EntitiesOperations(object):
+ """EntitiesOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ skiptoken=None, # type: Optional[str]
+ skip=None, # type: Optional[int]
+ top=None, # type: Optional[int]
+ select=None, # type: Optional[str]
+ search=None, # type: Optional[Union[str, "models.Enum2"]]
+ filter=None, # type: Optional[str]
+ view=None, # type: Optional[Union[str, "models.Enum3"]]
+ group_name=None, # type: Optional[str]
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.EntityListResult"]
+ """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.
+ :type skiptoken: str
+ :param skip: Number of entities to skip over when retrieving results. Passing this in will
+ override $skipToken.
+ :type skip: int
+ :param top: Number of elements to return when retrieving results. Passing this in will override
+ $skipToken.
+ :type top: int
+ :param select: This parameter specifies the fields to include in the response. Can include any
+ combination of Name,DisplayName,Type,ParentDisplayNameChain,ParentChain, e.g.
+ '$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain'. When specified the
+ $select parameter can override select in $skipToken.
+ :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.
+ 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.
+ :type search: str or ~management_groups_api.models.Enum2
+ :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.
+ :type filter: str
+ :param view: The view parameter allows clients to filter the type of data that is returned by
+ the getEntities call.
+ :type view: str or ~management_groups_api.models.Enum3
+ :param group_name: A filter which allows the get entities call to focus on a particular group
+ (i.e. "$filter=name eq 'groupName'").
+ :type group_name: str
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either EntityListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~management_groups_api.models.EntityListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.EntityListResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+ if skiptoken is not None:
+ query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
+ if skip is not None:
+ query_parameters['$skip'] = self._serialize.query("skip", skip, 'int')
+ if top is not None:
+ query_parameters['$top'] = self._serialize.query("top", top, 'int')
+ if select is not None:
+ query_parameters['$select'] = self._serialize.query("select", select, 'str')
+ if search is not None:
+ query_parameters['$search'] = self._serialize.query("search", search, 'str')
+ if filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
+ if view is not None:
+ query_parameters['$view'] = self._serialize.query("view", view, 'str')
+ if group_name is not None:
+ query_parameters['groupName'] = self._serialize.query("group_name", group_name, 'str')
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('EntityListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ list.metadata = {'url': '/providers/Microsoft.Management/getEntities'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_hierarchy_settings_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_hierarchy_settings_operations.py
new file mode 100644
index 00000000000..da692a128d5
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/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.
+# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Optional, TypeVar
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class HierarchySettingsOperations(object):
+ """HierarchySettingsOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ group_id, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.HierarchySettingsList"
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: HierarchySettingsList, or the result of cls(response)
+ :rtype: ~management_groups_api.models.HierarchySettingsList
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.HierarchySettingsList"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('HierarchySettingsList', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ list.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings'} # type: ignore
+
+ def get(
+ self,
+ group_id, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.HierarchySettings"
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: HierarchySettings, or the result of cls(response)
+ :rtype: ~management_groups_api.models.HierarchySettings
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.HierarchySettings"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('HierarchySettings', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} # type: ignore
+
+ def create_or_update(
+ self,
+ group_id, # type: str
+ create_tenant_settings_request, # type: "models.CreateOrUpdateSettingsRequest"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.HierarchySettings"
+ """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: ~management_groups_api.models.CreateOrUpdateSettingsRequest
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: HierarchySettings, or the result of cls(response)
+ :rtype: ~management_groups_api.models.HierarchySettings
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.HierarchySettings"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.create_or_update.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(create_tenant_settings_request, 'CreateOrUpdateSettingsRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('HierarchySettings', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create_or_update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} # type: ignore
+
+ def update(
+ self,
+ group_id, # type: str
+ create_tenant_settings_request, # type: "models.CreateOrUpdateSettingsRequest"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.HierarchySettings"
+ """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: ~management_groups_api.models.CreateOrUpdateSettingsRequest
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: HierarchySettings, or the result of cls(response)
+ :rtype: ~management_groups_api.models.HierarchySettings
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.HierarchySettings"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.update.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(create_tenant_settings_request, 'CreateOrUpdateSettingsRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('HierarchySettings', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} # type: ignore
+
+ def delete(
+ self,
+ group_id, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """Deletes the hierarchy settings defined at the Management Group level.
+
+ :param group_id: Management Group ID.
+ :type group_id: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.delete.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/settings/default'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_management_group_subscriptions_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_management_group_subscriptions_operations.py
new file mode 100644
index 00000000000..2fd0987df1c
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_management_group_subscriptions_operations.py
@@ -0,0 +1,317 @@
+# 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 typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class ManagementGroupSubscriptionsOperations(object):
+ """ManagementGroupSubscriptionsOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def create(
+ self,
+ group_id, # type: str
+ subscription_id, # type: str
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SubscriptionUnderManagementGroup"
+ """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 whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SubscriptionUnderManagementGroup, or the result of cls(response)
+ :rtype: ~management_groups_api.models.SubscriptionUnderManagementGroup
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionUnderManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.create.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.put(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('SubscriptionUnderManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ create.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} # type: ignore
+
+ def delete(
+ self,
+ group_id, # type: str
+ subscription_id, # type: str
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> None
+ """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 whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: None, or the result of cls(response)
+ :rtype: None
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.delete.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} # type: ignore
+
+ def get_subscription(
+ self,
+ group_id, # type: str
+ subscription_id, # type: str
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.SubscriptionUnderManagementGroup"
+ """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 whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: SubscriptionUnderManagementGroup, or the result of cls(response)
+ :rtype: ~management_groups_api.models.SubscriptionUnderManagementGroup
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionUnderManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get_subscription.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('SubscriptionUnderManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get_subscription.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'} # type: ignore
+
+ def get_subscriptions_under_management_group(
+ self,
+ group_id, # type: str
+ skiptoken=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.ListSubscriptionUnderManagementGroup"]
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ListSubscriptionUnderManagementGroup or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~management_groups_api.models.ListSubscriptionUnderManagementGroup]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ListSubscriptionUnderManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.get_subscriptions_under_management_group.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+ if skiptoken is not None:
+ query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('ListSubscriptionUnderManagementGroup', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_subscriptions_under_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_management_groups_api_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_management_groups_api_operations.py
new file mode 100644
index 00000000000..b3106a3d16a
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_management_groups_api_operations.py
@@ -0,0 +1,177 @@
+# 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 typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Optional, TypeVar
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class ManagementGroupsAPIOperationsMixin(object):
+
+ def check_name_availability(
+ self,
+ check_name_availability_request, # type: "models.CheckNameAvailabilityRequest"
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.CheckNameAvailabilityResult"
+ """Checks if the specified management group name is valid and unique.
+
+ :param check_name_availability_request: Management group name availability check parameters.
+ :type check_name_availability_request: ~management_groups_api.models.CheckNameAvailabilityRequest
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: CheckNameAvailabilityResult, or the result of cls(response)
+ :rtype: ~management_groups_api.models.CheckNameAvailabilityResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.check_name_availability.metadata['url'] # type: ignore
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(check_name_availability_request, 'CheckNameAvailabilityRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ check_name_availability.metadata = {'url': '/providers/Microsoft.Management/checkNameAvailability'} # type: ignore
+
+ def start_tenant_backfill(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.TenantBackfillStatusResult"
+ """Starts backfilling subscriptions for the Tenant.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TenantBackfillStatusResult, or the result of cls(response)
+ :rtype: ~management_groups_api.models.TenantBackfillStatusResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TenantBackfillStatusResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.start_tenant_backfill.metadata['url'] # type: ignore
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('TenantBackfillStatusResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ start_tenant_backfill.metadata = {'url': '/providers/Microsoft.Management/startTenantBackfill'} # type: ignore
+
+ def tenant_backfill_status(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.TenantBackfillStatusResult"
+ """Gets tenant backfill status.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: TenantBackfillStatusResult, or the result of cls(response)
+ :rtype: ~management_groups_api.models.TenantBackfillStatusResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.TenantBackfillStatusResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.tenant_backfill_status.metadata['url'] # type: ignore
+
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.post(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('TenantBackfillStatusResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ tenant_backfill_status.metadata = {'url': '/providers/Microsoft.Management/tenantBackfillStatus'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_management_groups_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_management_groups_operations.py
new file mode 100644
index 00000000000..899304aee0a
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_management_groups_operations.py
@@ -0,0 +1,622 @@
+# 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 typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class ManagementGroupsOperations(object):
+ """ManagementGroupsOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ cache_control="no-cache", # type: Optional[str]
+ skiptoken=None, # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.ManagementGroupListResult"]
+ """List management groups for the authenticated user.
+
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing 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.
+ :type skiptoken: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either ManagementGroupListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~management_groups_api.models.ManagementGroupListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupListResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+ if skiptoken is not None:
+ query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('ManagementGroupListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ list.metadata = {'url': '/providers/Microsoft.Management/managementGroups'} # type: ignore
+
+ def get(
+ self,
+ group_id, # type: str
+ expand=None, # type: Optional[Union[str, "models.Enum0"]]
+ recurse=None, # type: Optional[bool]
+ filter=None, # type: Optional[str]
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.ManagementGroup"
+ """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. $expand=path includes the path from the root group to the
+ current group. $expand=ancestors includes the ancestor Ids of the current group.
+ :type expand: str or ~management_groups_api.models.Enum0
+ :param recurse: The $recurse=true query string parameter allows clients to request inclusion of
+ entire hierarchy in the response payload. Note that $expand=children must be passed up if
+ $recurse is set to true.
+ :type recurse: bool
+ :param filter: A filter which allows the exclusion of subscriptions from results (i.e.
+ '$filter=children.childType ne Subscription').
+ :type filter: str
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: ManagementGroup, or the result of cls(response)
+ :rtype: ~management_groups_api.models.ManagementGroup
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self.get.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+ if expand is not None:
+ query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
+ if recurse is not None:
+ query_parameters['$recurse'] = self._serialize.query("recurse", recurse, 'bool')
+ if filter is not None:
+ query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('ManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ get.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ def _create_or_update_initial(
+ self,
+ group_id, # type: str
+ create_management_group_request, # type: "models.CreateManagementGroupRequest"
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Union["models.ManagementGroup", "models.AzureAsyncOperationResults"]
+ cls = kwargs.pop('cls', None) # type: ClsType[Union["models.ManagementGroup", "models.AzureAsyncOperationResults"]]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self._create_or_update_initial.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(create_management_group_request, 'CreateManagementGroupRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 200:
+ deserialized = self._deserialize('ManagementGroup', pipeline_response)
+
+ if response.status_code == 202:
+ response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
+ response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation'))
+ deserialized = self._deserialize('AzureAsyncOperationResults', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ _create_or_update_initial.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ def begin_create_or_update(
+ self,
+ group_id, # type: str
+ create_management_group_request, # type: "models.CreateManagementGroupRequest"
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> LROPoller[Union["models.ManagementGroup", "models.AzureAsyncOperationResults"]]
+ """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
+ :param create_management_group_request: Management group creation parameters.
+ :type create_management_group_request: ~management_groups_api.models.CreateManagementGroupRequest
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of LROPoller that returns either ManagementGroup or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~management_groups_api.models.ManagementGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType[Union["models.ManagementGroup", "models.AzureAsyncOperationResults"]]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = self._create_or_update_initial(
+ group_id=group_id,
+ create_management_group_request=create_management_group_request,
+ cache_control=cache_control,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize('ManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+ return deserialized
+
+ path_format_arguments = {
+ 'groupId': self._serialize.url("group_id", group_id, 'str'),
+ }
+
+ if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = NoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_create_or_update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ def update(
+ self,
+ group_id, # type: str
+ patch_group_request, # type: "models.PatchManagementGroupRequest"
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.ManagementGroup"
+ """Update a management group.
+
+ :param group_id: Management Group ID.
+ :type group_id: str
+ :param patch_group_request: Management group patch parameters.
+ :type patch_group_request: ~management_groups_api.models.PatchManagementGroupRequest
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: ManagementGroup, or the result of cls(response)
+ :rtype: ~management_groups_api.models.ManagementGroup
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroup"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
+
+ # Construct URL
+ url = self.update.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(patch_group_request, 'PatchManagementGroupRequest')
+ body_content_kwargs['content'] = body_content
+ request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize('ManagementGroup', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ def _delete_initial(
+ self,
+ group_id, # type: str
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Optional["models.AzureAsyncOperationResults"]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureAsyncOperationResults"]]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ # Construct URL
+ url = self._delete_initial.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ if cache_control is not None:
+ header_parameters['Cache-Control'] = self._serialize.header("cache_control", cache_control, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ request = self._client.delete(url, query_parameters, header_parameters)
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize(models.ErrorResponse, response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ deserialized = None
+ if response.status_code == 202:
+ response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
+ response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation'))
+ deserialized = self._deserialize('AzureAsyncOperationResults', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+
+ return deserialized
+ _delete_initial.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ def begin_delete(
+ self,
+ group_id, # type: str
+ cache_control="no-cache", # type: Optional[str]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> LROPoller["models.AzureAsyncOperationResults"]
+ """Delete management group.
+ If a management group contains child resources, the request will fail.
+
+ :param group_id: Management Group ID.
+ :type group_id: str
+ :param cache_control: Indicates whether the request should utilize any caches. Populate the
+ header with 'no-cache' value to bypass existing caches.
+ :type cache_control: str
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: True for ARMPolling, False for no polling, or a
+ polling object for personal polling strategy
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
+ :return: An instance of LROPoller that returns either AzureAsyncOperationResults or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[~management_groups_api.models.AzureAsyncOperationResults]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureAsyncOperationResults"]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = self._delete_initial(
+ group_id=group_id,
+ cache_control=cache_control,
+ cls=lambda x,y,z: x,
+ **kwargs
+ )
+
+ kwargs.pop('error_map', None)
+ kwargs.pop('content_type', None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
+ response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation'))
+ deserialized = self._deserialize('AzureAsyncOperationResults', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers)
+ return deserialized
+
+ path_format_arguments = {
+ 'groupId': self._serialize.url("group_id", group_id, 'str'),
+ }
+
+ if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs)
+ elif polling is False: polling_method = NoPolling()
+ else: polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ else:
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
+ begin_delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}'} # type: ignore
+
+ def get_descendants(
+ self,
+ group_id, # type: str
+ skiptoken=None, # type: Optional[str]
+ top=None, # type: Optional[int]
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.DescendantListResult"]
+ """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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either DescendantListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~management_groups_api.models.DescendantListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.DescendantListResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.get_descendants.metadata['url'] # type: ignore
+ 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 = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", 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')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('DescendantListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ get_descendants.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{groupId}/descendants'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_operations.py b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_operations.py
new file mode 100644
index 00000000000..ea6587f8d01
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/operations/_operations.py
@@ -0,0 +1,110 @@
+# 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 typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class Operations(object):
+ """Operations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~management_groups_api.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ **kwargs # type: Any
+ ):
+ # type: (...) -> Iterable["models.OperationListResult"]
+ """Lists all of the available Management REST API operations.
+
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :return: An iterator like instance of either OperationListResult or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~management_groups_api.models.OperationListResult]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2021-04-01"
+ accept = "application/json"
+
+ def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ if not next_link:
+ # Construct URL
+ url = self.list.metadata['url'] # type: ignore
+ # Construct parameters
+ query_parameters = {} # type: Dict[str, Any]
+ query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
+
+ request = self._client.get(url, query_parameters, header_parameters)
+ else:
+ url = next_link
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
+ return request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize('OperationListResult', pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem)
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ request = prepare_request(next_link)
+
+ pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ error = self._deserialize(models.ErrorResponse, response)
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+ list.metadata = {'url': '/providers/Microsoft.Management/operations'} # type: ignore
diff --git a/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/py.typed b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/py.typed
new file mode 100644
index 00000000000..e5aff4f83af
--- /dev/null
+++ b/src/managementgroup/azext_managementgroup/vendored_sdks/managementgroup/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/src/managementgroup/report.md b/src/managementgroup/report.md
new file mode 100644
index 00000000000..7e91a947c19
--- /dev/null
+++ b/src/managementgroup/report.md
@@ -0,0 +1,318 @@
+# Azure CLI Module Creation Report
+
+## EXTENSION
+|CLI Extension|Command Groups|
+|---------|------------|
+|az managementgroup|[groups](#CommandGroups)
+
+## GROUPS
+### Command groups in `az managementgroup` extension
+|CLI Command Group|Group Swagger name|Commands|
+|---------|------------|--------|
+|az managementgroup management-group|ManagementGroups|[commands](#CommandsInManagementGroups)|
+|az managementgroup management-group-subscription|ManagementGroupSubscriptions|[commands](#CommandsInManagementGroupSubscriptions)|
+|az managementgroup hierarchy-setting|HierarchySettings|[commands](#CommandsInHierarchySettings)|
+|az managementgroup||[commands](#CommandsIn)|
+|az managementgroup entity|Entities|[commands](#CommandsInEntities)|
+
+## COMMANDS
+### Commands in `az managementgroup` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az managementgroup start-tenant-backfill](#StartTenantBackfill)|StartTenantBackfill|[Parameters](#ParametersStartTenantBackfill)|[Example](#ExamplesStartTenantBackfill)|
+|[az managementgroup tenant-backfill-status](#TenantBackfillStatus)|TenantBackfillStatus|[Parameters](#ParametersTenantBackfillStatus)|[Example](#ExamplesTenantBackfillStatus)|
+
+### Commands in `az managementgroup entity` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az managementgroup entity list](#EntitiesList)|List|[Parameters](#ParametersEntitiesList)|[Example](#ExamplesEntitiesList)|
+
+### Commands in `az managementgroup hierarchy-setting` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az managementgroup hierarchy-setting list](#HierarchySettingsList)|List|[Parameters](#ParametersHierarchySettingsList)|[Example](#ExamplesHierarchySettingsList)|
+|[az managementgroup hierarchy-setting show](#HierarchySettingsGet)|Get|[Parameters](#ParametersHierarchySettingsGet)|[Example](#ExamplesHierarchySettingsGet)|
+|[az managementgroup hierarchy-setting create](#HierarchySettingsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersHierarchySettingsCreateOrUpdate#Create)|[Example](#ExamplesHierarchySettingsCreateOrUpdate#Create)|
+|[az managementgroup hierarchy-setting update](#HierarchySettingsUpdate)|Update|[Parameters](#ParametersHierarchySettingsUpdate)|[Example](#ExamplesHierarchySettingsUpdate)|
+|[az managementgroup hierarchy-setting delete](#HierarchySettingsDelete)|Delete|[Parameters](#ParametersHierarchySettingsDelete)|[Example](#ExamplesHierarchySettingsDelete)|
+
+### Commands in `az managementgroup management-group` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az managementgroup management-group list](#ManagementGroupsList)|List|[Parameters](#ParametersManagementGroupsList)|[Example](#ExamplesManagementGroupsList)|
+|[az managementgroup management-group show](#ManagementGroupsGet)|Get|[Parameters](#ParametersManagementGroupsGet)|[Example](#ExamplesManagementGroupsGet)|
+|[az managementgroup management-group create](#ManagementGroupsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersManagementGroupsCreateOrUpdate#Create)|[Example](#ExamplesManagementGroupsCreateOrUpdate#Create)|
+|[az managementgroup management-group update](#ManagementGroupsUpdate)|Update|[Parameters](#ParametersManagementGroupsUpdate)|[Example](#ExamplesManagementGroupsUpdate)|
+|[az managementgroup management-group delete](#ManagementGroupsDelete)|Delete|[Parameters](#ParametersManagementGroupsDelete)|[Example](#ExamplesManagementGroupsDelete)|
+|[az managementgroup management-group show-descendant](#ManagementGroupsGetDescendants)|GetDescendants|[Parameters](#ParametersManagementGroupsGetDescendants)|[Example](#ExamplesManagementGroupsGetDescendants)|
+
+### Commands in `az managementgroup management-group-subscription` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az managementgroup management-group-subscription create](#ManagementGroupSubscriptionsCreate)|Create|[Parameters](#ParametersManagementGroupSubscriptionsCreate)|[Example](#ExamplesManagementGroupSubscriptionsCreate)|
+|[az managementgroup management-group-subscription delete](#ManagementGroupSubscriptionsDelete)|Delete|[Parameters](#ParametersManagementGroupSubscriptionsDelete)|[Example](#ExamplesManagementGroupSubscriptionsDelete)|
+|[az managementgroup management-group-subscription show-subscription](#ManagementGroupSubscriptionsGetSubscription)|GetSubscription|[Parameters](#ParametersManagementGroupSubscriptionsGetSubscription)|[Example](#ExamplesManagementGroupSubscriptionsGetSubscription)|
+|[az managementgroup management-group-subscription show-subscription-under-management-group](#ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroup)|GetSubscriptionsUnderManagementGroup|[Parameters](#ParametersManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroup)|[Example](#ExamplesManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroup)|
+
+
+## COMMAND DETAILS
+
+### group `az managementgroup`
+#### Command `az managementgroup start-tenant-backfill`
+
+##### Example
+```
+az managementgroup start-tenant-backfill
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+#### Command `az managementgroup tenant-backfill-status`
+
+##### Example
+```
+az managementgroup tenant-backfill-status
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+### group `az managementgroup entity`
+#### Command `az managementgroup entity list`
+
+##### Example
+```
+az managementgroup entity list
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--skiptoken**|string|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. |skiptoken|$skiptoken|
+|**--skip**|integer|Number of entities to skip over when retrieving results. Passing this in will override $skipToken.|skip|$skip|
+|**--top**|integer|Number of elements to return when retrieving results. Passing this in will override $skipToken.|top|$top|
+|**--select**|string|This parameter specifies the fields to include in the response. Can include any combination of Name,DisplayName,Type,ParentDisplayNameChain,ParentChain, e.g. '$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain'. When specified the $select parameter can override select in $skipToken.|select|$select|
+|**--search**|choice|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. 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.|search|$search|
+|**--filter**|string|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.|filter|$filter|
+|**--view**|choice|The view parameter allows clients to filter the type of data that is returned by the getEntities call.|view|$view|
+|**--group-name**|string|A filter which allows the get entities call to focus on a particular group (i.e. "$filter=name eq 'groupName'")|group_name|groupName|
+|**--cache-control**|string|Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.|cache_control|Cache-Control|
+
+### group `az managementgroup hierarchy-setting`
+#### Command `az managementgroup hierarchy-setting list`
+
+##### Example
+```
+az managementgroup hierarchy-setting list --group-id "root"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+
+#### Command `az managementgroup hierarchy-setting show`
+
+##### Example
+```
+az managementgroup hierarchy-setting show --group-id "root"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+
+#### Command `az managementgroup hierarchy-setting create`
+
+##### Example
+```
+az managementgroup hierarchy-setting create --default-management-group "/providers/Microsoft.Management/managementGroup\
+s/DefaultGroup" --require-authorization-for-group-creation true --group-id "root"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--require-authorization-for-group-creation**|boolean|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.|require_authorization_for_group_creation|requireAuthorizationForGroupCreation|
+|**--default-management-group**|string|Settings that sets the default Management Group under which new subscriptions get added in this tenant. For example, /providers/Microsoft.Management/managementGroups/defaultGroup|default_management_group|defaultManagementGroup|
+
+#### Command `az managementgroup hierarchy-setting update`
+
+##### Example
+```
+az managementgroup hierarchy-setting update --default-management-group "/providers/Microsoft.Management/managementGroup\
+s/DefaultGroup" --require-authorization-for-group-creation true --group-id "root"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--require-authorization-for-group-creation**|boolean|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.|require_authorization_for_group_creation|requireAuthorizationForGroupCreation|
+|**--default-management-group**|string|Settings that sets the default Management Group under which new subscriptions get added in this tenant. For example, /providers/Microsoft.Management/managementGroups/defaultGroup|default_management_group|defaultManagementGroup|
+
+#### Command `az managementgroup hierarchy-setting delete`
+
+##### Example
+```
+az managementgroup hierarchy-setting delete --group-id "root"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+
+### group `az managementgroup management-group`
+#### Command `az managementgroup management-group list`
+
+##### Example
+```
+az managementgroup management-group list --cache-control "no-cache"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--cache-control**|string|Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.|cache_control|Cache-Control|
+|**--skiptoken**|string|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. |skiptoken|$skiptoken|
+
+#### Command `az managementgroup management-group show`
+
+##### Example
+```
+az managementgroup management-group show --cache-control "no-cache" --group-id "20000000-0001-0000-0000-000000000000"
+```
+##### Example
+```
+az managementgroup management-group show --expand "ancestors" --cache-control "no-cache" --group-id \
+"20000000-0001-0000-0000-00000000000"
+```
+##### Example
+```
+az managementgroup management-group show --expand "children" --cache-control "no-cache" --group-id \
+"20000000-0001-0000-0000-000000000000"
+```
+##### Example
+```
+az managementgroup management-group show --expand "path" --cache-control "no-cache" --group-id \
+"20000000-0001-0000-0000-000000000000"
+```
+##### Example
+```
+az managementgroup management-group show --expand "children" --recurse true --cache-control "no-cache" --group-id \
+"20000000-0001-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--expand**|choice|The $expand=children query string parameter allows clients to request inclusion of children in the response payload. $expand=path includes the path from the root group to the current group. $expand=ancestors includes the ancestor Ids of the current group.|expand|$expand|
+|**--recurse**|boolean|The $recurse=true query string parameter allows clients to request inclusion of entire hierarchy in the response payload. Note that $expand=children must be passed up if $recurse is set to true.|recurse|$recurse|
+|**--filter**|string|A filter which allows the exclusion of subscriptions from results (i.e. '$filter=children.childType ne Subscription')|filter|$filter|
+|**--cache-control**|string|Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.|cache_control|Cache-Control|
+
+#### Command `az managementgroup management-group create`
+
+##### Example
+```
+az managementgroup management-group create --cache-control "no-cache" --display-name "ChildGroup" --id \
+"/providers/Microsoft.Management/managementGroups/RootGroup" --group-id "ChildGroup"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--cache-control**|string|Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.|cache_control|Cache-Control|
+|**--name**|string|The name of the management group. For example, 00000000-0000-0000-0000-000000000000|name|name|
+|**--display-name**|string|The friendly name of the management group. If no value is passed then this field will be set to the groupId.|display_name|displayName|
+|**--id**|string|The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000|id|id|
+
+#### Command `az managementgroup management-group update`
+
+##### Example
+```
+az managementgroup management-group update --cache-control "no-cache" --group-id "ChildGroup" --display-name \
+"AlternateDisplayName" --parent-group-id "/providers/Microsoft.Management/managementGroups/AlternateRootGroup"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--cache-control**|string|Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.|cache_control|Cache-Control|
+|**--display-name**|string|The friendly name of the management group.|display_name|displayName|
+|**--parent-group-id**|string|(Optional) The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000|parent_group_id|parentGroupId|
+
+#### Command `az managementgroup management-group delete`
+
+##### Example
+```
+az managementgroup management-group delete --cache-control "no-cache" --group-id "GroupToDelete"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--cache-control**|string|Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.|cache_control|Cache-Control|
+
+#### Command `az managementgroup management-group show-descendant`
+
+##### Example
+```
+az managementgroup management-group show-descendant --group-id "20000000-0000-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--skiptoken**|string|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. |skiptoken|$skiptoken|
+|**--top**|integer|Number of elements to return when retrieving results. Passing this in will override $skipToken.|top|$top|
+
+### group `az managementgroup management-group-subscription`
+#### Command `az managementgroup management-group-subscription create`
+
+##### Example
+```
+az managementgroup management-group-subscription create --cache-control "no-cache" --group-id "Group" \
+--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--subscription-id**|string|Subscription ID.|subscription_id|subscriptionId|
+|**--cache-control**|string|Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.|cache_control|Cache-Control|
+
+#### Command `az managementgroup management-group-subscription delete`
+
+##### Example
+```
+az managementgroup management-group-subscription delete --cache-control "no-cache" --group-id "Group" \
+--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--subscription-id**|string|Subscription ID.|subscription_id|subscriptionId|
+|**--cache-control**|string|Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.|cache_control|Cache-Control|
+
+#### Command `az managementgroup management-group-subscription show-subscription`
+
+##### Example
+```
+az managementgroup management-group-subscription show-subscription --cache-control "no-cache" --group-id "Group" \
+--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--subscription-id**|string|Subscription ID.|subscription_id|subscriptionId|
+|**--cache-control**|string|Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.|cache_control|Cache-Control|
+
+#### Command `az managementgroup management-group-subscription show-subscription-under-management-group`
+
+##### Example
+```
+az managementgroup management-group-subscription show-subscription-under-management-group --group-id "Group"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--group-id**|string|Management Group ID.|group_id|groupId|
+|**--skiptoken**|string|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. |skiptoken|$skiptoken|
diff --git a/src/managementgroup/setup.cfg b/src/managementgroup/setup.cfg
new file mode 100644
index 00000000000..2fdd96e5d39
--- /dev/null
+++ b/src/managementgroup/setup.cfg
@@ -0,0 +1 @@
+#setup.cfg
\ No newline at end of file
diff --git a/src/managementgroup/setup.py b/src/managementgroup/setup.py
new file mode 100644
index 00000000000..7438ce5b415
--- /dev/null
+++ b/src/managementgroup/setup.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+
+from codecs import open
+from setuptools import setup, find_packages
+
+# HISTORY.rst entry.
+VERSION = '0.1.0'
+try:
+ from azext_managementgroup.manual.version import VERSION
+except ImportError:
+ pass
+
+# The full list of classifiers is available at
+# https://pypi.python.org/pypi?%3Aaction=list_classifiers
+CLASSIFIERS = [
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: System Administrators',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'License :: OSI Approved :: MIT License',
+]
+
+DEPENDENCIES = []
+
+try:
+ from azext_managementgroup.manual.dependency import DEPENDENCIES
+except ImportError:
+ pass
+
+with open('README.md', 'r', encoding='utf-8') as f:
+ README = f.read()
+with open('HISTORY.rst', 'r', encoding='utf-8') as f:
+ HISTORY = f.read()
+
+setup(
+ name='managementgroup',
+ version=VERSION,
+ description='Microsoft Azure Command-Line Tools ManagementGroupsAPI Extension',
+ author='Microsoft Corporation',
+ author_email='azpycli@microsoft.com',
+ url='https://github.com/Azure/azure-cli-extensions/tree/master/src/managementgroup',
+ long_description=README + '\n\n' + HISTORY,
+ license='MIT',
+ classifiers=CLASSIFIERS,
+ packages=find_packages(),
+ install_requires=DEPENDENCIES,
+ package_data={'azext_managementgroup': ['azext_metadata.json']},
+)