diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/EntitiesOperations.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/EntitiesOperations.cs
index a3fc386d0abf0..7373b7a14b618 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/EntitiesOperations.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/EntitiesOperations.cs
@@ -53,21 +53,8 @@ internal EntitiesOperations(ManagementGroupsAPIClient client)
///
/// List all entities (Management Groups, Subscriptions, etc.) for the
/// authenticated user.
+ ///
///
- ///
- /// 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.
- ///
- ///
- /// Number of entities to skip over when retrieving results. Passing this in
- /// will override $skipToken.
- ///
- ///
- /// Number of elements to return when retrieving results. Passing this in will
- /// override $skipToken.
- ///
///
/// This parameter specifies the fields to include in the response. Can include
/// any combination of
@@ -77,15 +64,23 @@ internal EntitiesOperations(ManagementGroupsAPIClient client)
///
///
/// The $search parameter is used in conjunction with the $filter parameter to
- /// return three different outputs depending on the parameter passed in. With
- /// $search=AllowedParents the API will return the entity info of all groups
- /// that the requested entity will be able to reparent to as determined by the
- /// user's permissions. With $search=AllowedChildren the API will return the
- /// entity info of all entities that can be added as children of the requested
- /// entity. With $search=ParentAndFirstLevelChildren the API will return the
- /// parent and first level of children that the user has either direct access
- /// to or indirect access via one of their descendants. Possible values
- /// include: 'AllowedParents', 'AllowedChildren', 'ParentAndFirstLevelChildren'
+ /// 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. Possible values include: 'AllowedParents',
+ /// 'AllowedChildren', 'ParentAndFirstLevelChildren', 'ParentOnly',
+ /// 'ChildrenOnly'
///
///
/// The filter parameter allows you to filter on the the name or display name
@@ -128,7 +123,7 @@ internal EntitiesOperations(ManagementGroupsAPIClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string skiptoken = default(string), int? skip = default(int?), int? top = default(int?), string select = default(string), string search = default(string), string filter = default(string), string view = default(string), string groupName = default(string), string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(string select = default(string), string search = default(string), string filter = default(string), string view = default(string), string groupName = default(string), string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -141,9 +136,6 @@ internal EntitiesOperations(ManagementGroupsAPIClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("skiptoken", skiptoken);
- tracingParameters.Add("skip", skip);
- tracingParameters.Add("top", top);
tracingParameters.Add("select", select);
tracingParameters.Add("search", search);
tracingParameters.Add("filter", filter);
@@ -161,17 +153,17 @@ internal EntitiesOperations(ManagementGroupsAPIClient client)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
- if (skiptoken != null)
+ if (Client.Skiptoken != null)
{
- _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken)));
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(Client.Skiptoken)));
}
- if (skip != null)
+ if (Client.Skip != null)
{
- _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.Skip, Client.SerializationSettings).Trim('"'))));
}
- if (top != null)
+ if (Client.Top != null)
{
- _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.Top, Client.SerializationSettings).Trim('"'))));
}
if (select != null)
{
@@ -179,7 +171,7 @@ internal EntitiesOperations(ManagementGroupsAPIClient client)
}
if (search != null)
{
- _queryParameters.Add(string.Format("$search={0}", System.Uri.EscapeDataString(search)));
+ _queryParameters.Add(string.Format("$search={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(search, Client.SerializationSettings).Trim('"'))));
}
if (filter != null)
{
@@ -187,7 +179,7 @@ internal EntitiesOperations(ManagementGroupsAPIClient client)
}
if (view != null)
{
- _queryParameters.Add(string.Format("$view={0}", System.Uri.EscapeDataString(view)));
+ _queryParameters.Add(string.Format("$view={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(view, Client.SerializationSettings).Trim('"'))));
}
if (groupName != null)
{
@@ -324,6 +316,7 @@ internal EntitiesOperations(ManagementGroupsAPIClient client)
///
/// List all entities (Management Groups, Subscriptions, etc.) for the
/// authenticated user.
+ ///
///
///
/// The NextLink from the previous successful call to List operation.
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/EntitiesOperationsExtensions.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/EntitiesOperationsExtensions.cs
index bfab0048ca718..4fd1e48d2931b 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/EntitiesOperationsExtensions.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/EntitiesOperationsExtensions.cs
@@ -24,24 +24,11 @@ public static partial class EntitiesOperationsExtensions
///
/// List all entities (Management Groups, Subscriptions, etc.) for the
/// authenticated user.
+ ///
///
///
/// The operations group for this extension method.
///
- ///
- /// 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.
- ///
- ///
- /// Number of entities to skip over when retrieving results. Passing this in
- /// will override $skipToken.
- ///
- ///
- /// Number of elements to return when retrieving results. Passing this in will
- /// override $skipToken.
- ///
///
/// This parameter specifies the fields to include in the response. Can include
/// any combination of
@@ -51,15 +38,23 @@ public static partial class EntitiesOperationsExtensions
///
///
/// The $search parameter is used in conjunction with the $filter parameter to
- /// return three different outputs depending on the parameter passed in. With
- /// $search=AllowedParents the API will return the entity info of all groups
- /// that the requested entity will be able to reparent to as determined by the
- /// user's permissions. With $search=AllowedChildren the API will return the
- /// entity info of all entities that can be added as children of the requested
- /// entity. With $search=ParentAndFirstLevelChildren the API will return the
- /// parent and first level of children that the user has either direct access
- /// to or indirect access via one of their descendants. Possible values
- /// include: 'AllowedParents', 'AllowedChildren', 'ParentAndFirstLevelChildren'
+ /// 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. Possible values include: 'AllowedParents',
+ /// 'AllowedChildren', 'ParentAndFirstLevelChildren', 'ParentOnly',
+ /// 'ChildrenOnly'
///
///
/// The filter parameter allows you to filter on the the name or display name
@@ -81,32 +76,19 @@ public static partial class EntitiesOperationsExtensions
///
/// Indicates that the request shouldn't utilize any caches.
///
- public static IPage List(this IEntitiesOperations operations, string skiptoken = default(string), int? skip = default(int?), int? top = default(int?), string select = default(string), string search = default(string), string filter = default(string), string view = default(string), string groupName = default(string), string cacheControl = "no-cache")
+ public static IPage List(this IEntitiesOperations operations, string select = default(string), string search = default(string), string filter = default(string), string view = default(string), string groupName = default(string), string cacheControl = "no-cache")
{
- return operations.ListAsync(skiptoken, skip, top, select, search, filter, view, groupName, cacheControl).GetAwaiter().GetResult();
+ return operations.ListAsync(select, search, filter, view, groupName, cacheControl).GetAwaiter().GetResult();
}
///
/// List all entities (Management Groups, Subscriptions, etc.) for the
/// authenticated user.
+ ///
///
///
/// The operations group for this extension method.
///
- ///
- /// 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.
- ///
- ///
- /// Number of entities to skip over when retrieving results. Passing this in
- /// will override $skipToken.
- ///
- ///
- /// Number of elements to return when retrieving results. Passing this in will
- /// override $skipToken.
- ///
///
/// This parameter specifies the fields to include in the response. Can include
/// any combination of
@@ -116,15 +98,23 @@ public static partial class EntitiesOperationsExtensions
///
///
/// The $search parameter is used in conjunction with the $filter parameter to
- /// return three different outputs depending on the parameter passed in. With
- /// $search=AllowedParents the API will return the entity info of all groups
- /// that the requested entity will be able to reparent to as determined by the
- /// user's permissions. With $search=AllowedChildren the API will return the
- /// entity info of all entities that can be added as children of the requested
- /// entity. With $search=ParentAndFirstLevelChildren the API will return the
- /// parent and first level of children that the user has either direct access
- /// to or indirect access via one of their descendants. Possible values
- /// include: 'AllowedParents', 'AllowedChildren', 'ParentAndFirstLevelChildren'
+ /// 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. Possible values include: 'AllowedParents',
+ /// 'AllowedChildren', 'ParentAndFirstLevelChildren', 'ParentOnly',
+ /// 'ChildrenOnly'
///
///
/// The filter parameter allows you to filter on the the name or display name
@@ -149,9 +139,9 @@ public static partial class EntitiesOperationsExtensions
///
/// The cancellation token.
///
- public static async Task> ListAsync(this IEntitiesOperations operations, string skiptoken = default(string), int? skip = default(int?), int? top = default(int?), string select = default(string), string search = default(string), string filter = default(string), string view = default(string), string groupName = default(string), string cacheControl = "no-cache", CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListAsync(this IEntitiesOperations operations, string select = default(string), string search = default(string), string filter = default(string), string view = default(string), string groupName = default(string), string cacheControl = "no-cache", CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListWithHttpMessagesAsync(skiptoken, skip, top, select, search, filter, view, groupName, cacheControl, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListWithHttpMessagesAsync(select, search, filter, view, groupName, cacheControl, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -160,6 +150,7 @@ public static partial class EntitiesOperationsExtensions
///
/// List all entities (Management Groups, Subscriptions, etc.) for the
/// authenticated user.
+ ///
///
///
/// The operations group for this extension method.
@@ -178,6 +169,7 @@ public static IPage ListNext(this IEntitiesOperations operations, st
///
/// List all entities (Management Groups, Subscriptions, etc.) for the
/// authenticated user.
+ ///
///
///
/// The operations group for this extension method.
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/HierarchySettingsOperations.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/HierarchySettingsOperations.cs
new file mode 100644
index 0000000000000..87e4392eb9cda
--- /dev/null
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/HierarchySettingsOperations.cs
@@ -0,0 +1,954 @@
+//
+// 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.
+//
+
+namespace Microsoft.Azure.Management.ManagementGroups
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// HierarchySettingsOperations operations.
+ ///
+ internal partial class HierarchySettingsOperations : IServiceOperations, IHierarchySettingsOperations
+ {
+ ///
+ /// Initializes a new instance of the HierarchySettingsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal HierarchySettingsOperations(ManagementGroupsAPIClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the ManagementGroupsAPIClient
+ ///
+ public ManagementGroupsAPIClient Client { get; private set; }
+
+ ///
+ /// Gets all the hierarchy settings defined at the Management Group level.
+ /// Settings can only be set on the root Management Group of the hierarchy.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> ListWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (groupId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("groupId", groupId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/settings").ToString();
+ _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets the hierarchy settings defined at the Management Group level. Settings
+ /// can only be set on the root Management Group of the hierarchy.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (groupId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("groupId", groupId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/settings/default").ToString();
+ _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Creates or updates the hierarchy settings defined at the Management Group
+ /// level.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Tenant level settings request parameter.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string groupId, CreateOrUpdateSettingsRequest createTenantSettingsRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (groupId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (createTenantSettingsRequest == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "createTenantSettingsRequest");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("groupId", groupId);
+ tracingParameters.Add("createTenantSettingsRequest", createTenantSettingsRequest);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/settings/default").ToString();
+ _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(createTenantSettingsRequest != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(createTenantSettingsRequest, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Updates the hierarchy settings defined at the Management Group level.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Tenant level settings request parameter.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string groupId, CreateOrUpdateSettingsRequest createTenantSettingsRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (groupId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (createTenantSettingsRequest == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "createTenantSettingsRequest");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("groupId", groupId);
+ tracingParameters.Add("createTenantSettingsRequest", createTenantSettingsRequest);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/settings/default").ToString();
+ _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(createTenantSettingsRequest != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(createTenantSettingsRequest, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Deletes the hierarchy settings defined at the Management Group level.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (groupId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("groupId", groupId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/settings/default").ToString();
+ _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/HierarchySettingsOperationsExtensions.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/HierarchySettingsOperationsExtensions.cs
new file mode 100644
index 0000000000000..42af29051f8d8
--- /dev/null
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/HierarchySettingsOperationsExtensions.cs
@@ -0,0 +1,220 @@
+//
+// 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.
+//
+
+namespace Microsoft.Azure.Management.ManagementGroups
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for HierarchySettingsOperations.
+ ///
+ public static partial class HierarchySettingsOperationsExtensions
+ {
+ ///
+ /// Gets all the hierarchy settings defined at the Management Group level.
+ /// Settings can only be set on the root Management Group of the hierarchy.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ public static HierarchySettingsList List(this IHierarchySettingsOperations operations, string groupId)
+ {
+ return operations.ListAsync(groupId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets all the hierarchy settings defined at the Management Group level.
+ /// Settings can only be set on the root Management Group of the hierarchy.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListAsync(this IHierarchySettingsOperations operations, string groupId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(groupId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets the hierarchy settings defined at the Management Group level. Settings
+ /// can only be set on the root Management Group of the hierarchy.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ public static HierarchySettings Get(this IHierarchySettingsOperations operations, string groupId)
+ {
+ return operations.GetAsync(groupId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets the hierarchy settings defined at the Management Group level. Settings
+ /// can only be set on the root Management Group of the hierarchy.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IHierarchySettingsOperations operations, string groupId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(groupId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Creates or updates the hierarchy settings defined at the Management Group
+ /// level.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Tenant level settings request parameter.
+ ///
+ public static HierarchySettings CreateOrUpdate(this IHierarchySettingsOperations operations, string groupId, CreateOrUpdateSettingsRequest createTenantSettingsRequest)
+ {
+ return operations.CreateOrUpdateAsync(groupId, createTenantSettingsRequest).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Creates or updates the hierarchy settings defined at the Management Group
+ /// level.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Tenant level settings request parameter.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IHierarchySettingsOperations operations, string groupId, CreateOrUpdateSettingsRequest createTenantSettingsRequest, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(groupId, createTenantSettingsRequest, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Updates the hierarchy settings defined at the Management Group level.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Tenant level settings request parameter.
+ ///
+ public static HierarchySettings Update(this IHierarchySettingsOperations operations, string groupId, CreateOrUpdateSettingsRequest createTenantSettingsRequest)
+ {
+ return operations.UpdateAsync(groupId, createTenantSettingsRequest).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Updates the hierarchy settings defined at the Management Group level.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Tenant level settings request parameter.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this IHierarchySettingsOperations operations, string groupId, CreateOrUpdateSettingsRequest createTenantSettingsRequest, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(groupId, createTenantSettingsRequest, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Deletes the hierarchy settings defined at the Management Group level.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ public static void Delete(this IHierarchySettingsOperations operations, string groupId)
+ {
+ operations.DeleteAsync(groupId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Deletes the hierarchy settings defined at the Management Group level.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IHierarchySettingsOperations operations, string groupId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(groupId, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ }
+}
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IEntitiesOperations.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IEntitiesOperations.cs
index a01108b946617..87117857e0e57 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IEntitiesOperations.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IEntitiesOperations.cs
@@ -26,22 +26,8 @@ public partial interface IEntitiesOperations
///
/// List all entities (Management Groups, Subscriptions, etc.) for the
/// authenticated user.
+ ///
///
- ///
- /// 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.
- ///
- ///
- /// Number of entities to skip over when retrieving results. Passing
- /// this in will override $skipToken.
- ///
- ///
- /// Number of elements to return when retrieving results. Passing this
- /// in will override $skipToken.
- ///
///
/// This parameter specifies the fields to include in the response. Can
/// include any combination of
@@ -53,16 +39,23 @@ public partial interface IEntitiesOperations
///
/// 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.
+ /// parameter passed in.
+ /// With $search=AllowedParents the API will return the entity info of
+ /// all groups that the requested entity will be able to reparent to as
+ /// determined by the user's permissions.
/// With $search=AllowedChildren the API will return the entity info of
/// all entities that can be added as children of the requested entity.
/// With $search=ParentAndFirstLevelChildren the API will return the
/// parent and first level of children that the user has either direct
- /// access to or indirect access via one of their descendants. Possible
- /// values include: 'AllowedParents', 'AllowedChildren',
- /// 'ParentAndFirstLevelChildren'
+ /// access to or indirect access via one of their descendants.
+ /// With $search=ParentOnly the API will return only the group if the
+ /// user has access to at least one of the descendants of the group.
+ /// With $search=ChildrenOnly the API will return only the first level
+ /// of children of the group entity info specified in $filter. The
+ /// user must have direct access to the children entities or one of
+ /// it's descendants for it to show up in the results. Possible values
+ /// include: 'AllowedParents', 'AllowedChildren',
+ /// 'ParentAndFirstLevelChildren', 'ParentOnly', 'ChildrenOnly'
///
///
/// The filter parameter allows you to filter on the the name or
@@ -100,10 +93,11 @@ public partial interface IEntitiesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListWithHttpMessagesAsync(string skiptoken = default(string), int? skip = default(int?), int? top = default(int?), string select = default(string), string search = default(string), string filter = default(string), string view = default(string), string groupName = default(string), string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListWithHttpMessagesAsync(string select = default(string), string search = default(string), string filter = default(string), string view = default(string), string groupName = default(string), string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// List all entities (Management Groups, Subscriptions, etc.) for the
/// authenticated user.
+ ///
///
///
/// The NextLink from the previous successful call to List operation.
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IHierarchySettingsOperations.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IHierarchySettingsOperations.cs
new file mode 100644
index 0000000000000..e0e0d8aec67dc
--- /dev/null
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IHierarchySettingsOperations.cs
@@ -0,0 +1,152 @@
+//
+// 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.
+//
+
+namespace Microsoft.Azure.Management.ManagementGroups
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// HierarchySettingsOperations operations.
+ ///
+ public partial interface IHierarchySettingsOperations
+ {
+ ///
+ /// Gets all the hierarchy settings defined at the Management Group
+ /// level. Settings can only be set on the root Management Group of the
+ /// hierarchy.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> ListWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the hierarchy settings defined at the Management Group level.
+ /// Settings can only be set on the root Management Group of the
+ /// hierarchy.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Creates or updates the hierarchy settings defined at the Management
+ /// Group level.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Tenant level settings request parameter.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CreateOrUpdateWithHttpMessagesAsync(string groupId, CreateOrUpdateSettingsRequest createTenantSettingsRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates the hierarchy settings defined at the Management Group
+ /// level.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Tenant level settings request parameter.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(string groupId, CreateOrUpdateSettingsRequest createTenantSettingsRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes the hierarchy settings defined at the Management Group
+ /// level.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupSubscriptionsOperations.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupSubscriptionsOperations.cs
index 2384b59ffef82..ffd0d7a67937c 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupSubscriptionsOperations.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupSubscriptionsOperations.cs
@@ -25,6 +25,7 @@ public partial interface IManagementGroupSubscriptionsOperations
{
///
/// Associates existing subscription with the management group.
+ ///
///
///
/// Management Group ID.
@@ -44,12 +45,16 @@ public partial interface IManagementGroupSubscriptionsOperations
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
- Task CreateWithHttpMessagesAsync(string groupId, string subscriptionId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateWithHttpMessagesAsync(string groupId, string subscriptionId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// De-associates subscription from the management group.
+ ///
///
///
/// Management Group ID.
@@ -73,5 +78,83 @@ public partial interface IManagementGroupSubscriptionsOperations
/// Thrown when a required parameter is null
///
Task DeleteWithHttpMessagesAsync(string groupId, string subscriptionId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Retrieves details about given subscription which is associated with
+ /// the management group.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Subscription ID.
+ ///
+ ///
+ /// Indicates that the request shouldn't utilize any caches.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetSubscriptionWithHttpMessagesAsync(string groupId, string subscriptionId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Retrieves details about all subscriptions which are associated with
+ /// the management group.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> GetSubscriptionsUnderManagementGroupWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Retrieves details about all subscriptions which are associated with
+ /// the management group.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> GetSubscriptionsUnderManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupsAPIClient.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupsAPIClient.cs
index 774bcab175bf4..fd3e863e7f717 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupsAPIClient.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupsAPIClient.cs
@@ -24,6 +24,7 @@ namespace Microsoft.Azure.Management.ManagementGroups
/// subscriptions/resources into an organizational hierarchy and centrally
/// manage access control, policies, alerting and reporting for those
/// resources.
+ ///
///
public partial interface IManagementGroupsAPIClient : System.IDisposable
{
@@ -54,19 +55,48 @@ public partial interface IManagementGroupsAPIClient : System.IDisposable
string ApiVersion { get; }
///
- /// Gets or sets the preferred language for the response.
+ /// The id of the operation result. Possible values include: 'create',
+ /// 'delete'
+ ///
+ string OperationResultId { get; set; }
+
+ ///
+ /// Number of entities to skip over when retrieving results. Passing
+ /// this in will override $skipToken.
+ ///
+ int? Skip { get; set; }
+
+ ///
+ /// Number of elements to return when retrieving results. Passing this
+ /// in will override $skipToken.
+ ///
+ int? Top { get; set; }
+
+ ///
+ /// 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.
+ ///
+ ///
+ string Skiptoken { get; set; }
+
+ ///
+ /// The preferred language for the response.
///
string AcceptLanguage { get; set; }
///
- /// Gets or sets the retry timeout in seconds for Long Running
- /// Operations. Default value is 30.
+ /// The retry timeout in seconds for Long Running Operations. Default
+ /// value is 30.
///
int? LongRunningOperationRetryTimeout { get; set; }
///
- /// When set to true a unique x-ms-client-request-id value is generated
- /// and included in each request. Default is true.
+ /// Whether a unique x-ms-client-request-id should be generated. When
+ /// set to true a unique x-ms-client-request-id value is generated and
+ /// included in each request. Default is true.
///
bool? GenerateClientRequestId { get; set; }
@@ -81,6 +111,11 @@ public partial interface IManagementGroupsAPIClient : System.IDisposable
///
IManagementGroupSubscriptionsOperations ManagementGroupSubscriptions { get; }
+ ///
+ /// Gets the IHierarchySettingsOperations.
+ ///
+ IHierarchySettingsOperations HierarchySettings { get; }
+
///
/// Gets the IOperations.
///
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupsOperations.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupsOperations.cs
index 597faf9130ade..f61d8d34f2fb0 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupsOperations.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/IManagementGroupsOperations.cs
@@ -25,17 +25,11 @@ public partial interface IManagementGroupsOperations
{
///
/// List management groups for the authenticated user.
+ ///
///
///
/// Indicates that the request shouldn't utilize any caches.
///
- ///
- /// 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.
- ///
///
/// The headers that will be added to request.
///
@@ -51,17 +45,19 @@ public partial interface IManagementGroupsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListWithHttpMessagesAsync(string cacheControl = "no-cache", string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListWithHttpMessagesAsync(string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get the details of the management group.
+ ///
///
///
/// Management Group ID.
///
///
/// The $expand=children query string parameter allows clients to
- /// request inclusion of children in the response payload. Possible
- /// values include: 'children'
+ /// request inclusion of children in the response payload.
+ /// $expand=path includes the path from the root group to the current
+ /// group. Possible values include: 'children', 'path'
///
///
/// The $recurse=true query string parameter allows clients to request
@@ -92,10 +88,11 @@ public partial interface IManagementGroupsOperations
///
Task> GetWithHttpMessagesAsync(string groupId, string expand = default(string), bool? recurse = default(bool?), string filter = default(string), string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Create or update a management group. If a management group is
- /// already created and a subsequent create request is issued with
- /// different properties, the management group properties will be
- /// updated.
+ /// Create or update a management group.
+ /// If a management group is already created and a subsequent create
+ /// request is issued with different properties, the management group
+ /// properties will be updated.
+ ///
///
///
/// Management Group ID.
@@ -121,9 +118,10 @@ public partial interface IManagementGroupsOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateOrUpdateWithHttpMessagesAsync(string groupId, CreateManagementGroupRequest createManagementGroupRequest, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateOrUpdateWithHttpMessagesAsync(string groupId, CreateManagementGroupRequest createManagementGroupRequest, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Update a management group.
+ ///
///
///
/// Management Group ID.
@@ -151,8 +149,10 @@ public partial interface IManagementGroupsOperations
///
Task> UpdateWithHttpMessagesAsync(string groupId, PatchManagementGroupRequest patchGroupRequest, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Delete management group. If a management group contains child
- /// resources, the request will fail.
+ /// Delete management group.
+ /// If a management group contains child resources, the request will
+ /// fail.
+ ///
///
///
/// Management Group ID.
@@ -175,12 +175,36 @@ public partial interface IManagementGroupsOperations
///
/// Thrown when a required parameter is null
///
- Task> DeleteWithHttpMessagesAsync(string groupId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> DeleteWithHttpMessagesAsync(string groupId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// List all entities that descend from a management group.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> GetDescendantsWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Create or update a management group. If a management group is
- /// already created and a subsequent create request is issued with
- /// different properties, the management group properties will be
- /// updated.
+ /// Create or update a management group.
+ /// If a management group is already created and a subsequent create
+ /// request is issued with different properties, the management group
+ /// properties will be updated.
+ ///
///
///
/// Management Group ID.
@@ -206,10 +230,12 @@ public partial interface IManagementGroupsOperations
///
/// Thrown when a required parameter is null
///
- Task> BeginCreateOrUpdateWithHttpMessagesAsync(string groupId, CreateManagementGroupRequest createManagementGroupRequest, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> BeginCreateOrUpdateWithHttpMessagesAsync(string groupId, CreateManagementGroupRequest createManagementGroupRequest, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Delete management group. If a management group contains child
- /// resources, the request will fail.
+ /// Delete management group.
+ /// If a management group contains child resources, the request will
+ /// fail.
+ ///
///
///
/// Management Group ID.
@@ -232,9 +258,10 @@ public partial interface IManagementGroupsOperations
///
/// Thrown when a required parameter is null
///
- Task> BeginDeleteWithHttpMessagesAsync(string groupId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> BeginDeleteWithHttpMessagesAsync(string groupId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// List management groups for the authenticated user.
+ ///
///
///
/// The NextLink from the previous successful call to List operation.
@@ -258,5 +285,28 @@ public partial interface IManagementGroupsOperations
/// Thrown when a required parameter is null
///
Task>> ListNextWithHttpMessagesAsync(string nextPageLink, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// List all entities that descend from a management group.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> GetDescendantsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupSubscriptionsOperations.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupSubscriptionsOperations.cs
index 9007f4c65c61c..9beb6638c5dc4 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupSubscriptionsOperations.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupSubscriptionsOperations.cs
@@ -52,6 +52,7 @@ internal ManagementGroupSubscriptionsOperations(ManagementGroupsAPIClient client
///
/// Associates existing subscription with the management group.
+ ///
///
///
/// Management Group ID.
@@ -71,6 +72,9 @@ internal ManagementGroupSubscriptionsOperations(ManagementGroupsAPIClient client
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -80,7 +84,7 @@ internal ManagementGroupSubscriptionsOperations(ManagementGroupsAPIClient client
///
/// A response object containing the response body and response headers.
///
- public async Task CreateWithHttpMessagesAsync(string groupId, string subscriptionId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateWithHttpMessagesAsync(string groupId, string subscriptionId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (groupId == null)
{
@@ -183,7 +187,7 @@ internal ManagementGroupSubscriptionsOperations(ManagementGroupsAPIClient client
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -213,13 +217,31 @@ internal ManagementGroupSubscriptionsOperations(ManagementGroupsAPIClient client
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -229,6 +251,7 @@ internal ManagementGroupSubscriptionsOperations(ManagementGroupsAPIClient client
///
/// De-associates subscription from the management group.
+ ///
///
///
/// Management Group ID.
@@ -360,7 +383,7 @@ internal ManagementGroupSubscriptionsOperations(ManagementGroupsAPIClient client
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 204)
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -404,5 +427,558 @@ internal ManagementGroupSubscriptionsOperations(ManagementGroupsAPIClient client
return _result;
}
+ ///
+ /// Retrieves details about given subscription which is associated with the
+ /// management group.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Subscription ID.
+ ///
+ ///
+ /// Indicates that the request shouldn't utilize any caches.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetSubscriptionWithHttpMessagesAsync(string groupId, string subscriptionId, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (groupId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
+ }
+ if (subscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("groupId", groupId);
+ tracingParameters.Add("subscriptionId", subscriptionId);
+ tracingParameters.Add("cacheControl", cacheControl);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetSubscription", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}").ToString();
+ _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (cacheControl != null)
+ {
+ if (_httpRequest.Headers.Contains("Cache-Control"))
+ {
+ _httpRequest.Headers.Remove("Cache-Control");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("Cache-Control", cacheControl);
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Retrieves details about all subscriptions which are associated with the
+ /// management group.
+ ///
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> GetSubscriptionsUnderManagementGroupWithHttpMessagesAsync(string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (groupId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("groupId", groupId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionsUnderManagementGroup", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{groupId}/subscriptions").ToString();
+ _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (Client.Skiptoken != null)
+ {
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(Client.Skiptoken)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Retrieves details about all subscriptions which are associated with the
+ /// management group.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> GetSubscriptionsUnderManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionsUnderManagementGroupNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
}
}
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupSubscriptionsOperationsExtensions.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupSubscriptionsOperationsExtensions.cs
index a3fc6e27a62bf..27858e6f03967 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupSubscriptionsOperationsExtensions.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupSubscriptionsOperationsExtensions.cs
@@ -23,6 +23,7 @@ public static partial class ManagementGroupSubscriptionsOperationsExtensions
{
///
/// Associates existing subscription with the management group.
+ ///
///
///
/// The operations group for this extension method.
@@ -36,13 +37,14 @@ public static partial class ManagementGroupSubscriptionsOperationsExtensions
///
/// Indicates that the request shouldn't utilize any caches.
///
- public static void Create(this IManagementGroupSubscriptionsOperations operations, string groupId, string subscriptionId, string cacheControl = "no-cache")
+ public static SubscriptionUnderManagementGroup Create(this IManagementGroupSubscriptionsOperations operations, string groupId, string subscriptionId, string cacheControl = "no-cache")
{
- operations.CreateAsync(groupId, subscriptionId, cacheControl).GetAwaiter().GetResult();
+ return operations.CreateAsync(groupId, subscriptionId, cacheControl).GetAwaiter().GetResult();
}
///
/// Associates existing subscription with the management group.
+ ///
///
///
/// The operations group for this extension method.
@@ -59,13 +61,17 @@ public static void Create(this IManagementGroupSubscriptionsOperations operation
///
/// The cancellation token.
///
- public static async Task CreateAsync(this IManagementGroupSubscriptionsOperations operations, string groupId, string subscriptionId, string cacheControl = "no-cache", CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateAsync(this IManagementGroupSubscriptionsOperations operations, string groupId, string subscriptionId, string cacheControl = "no-cache", CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.CreateWithHttpMessagesAsync(groupId, subscriptionId, cacheControl, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.CreateWithHttpMessagesAsync(groupId, subscriptionId, cacheControl, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
/// De-associates subscription from the management group.
+ ///
///
///
/// The operations group for this extension method.
@@ -86,6 +92,7 @@ public static void Delete(this IManagementGroupSubscriptionsOperations operation
///
/// De-associates subscription from the management group.
+ ///
///
///
/// The operations group for this extension method.
@@ -107,5 +114,131 @@ public static void Delete(this IManagementGroupSubscriptionsOperations operation
(await operations.DeleteWithHttpMessagesAsync(groupId, subscriptionId, cacheControl, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
+ ///
+ /// Retrieves details about given subscription which is associated with the
+ /// management group.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Subscription ID.
+ ///
+ ///
+ /// Indicates that the request shouldn't utilize any caches.
+ ///
+ public static SubscriptionUnderManagementGroup GetSubscription(this IManagementGroupSubscriptionsOperations operations, string groupId, string subscriptionId, string cacheControl = "no-cache")
+ {
+ return operations.GetSubscriptionAsync(groupId, subscriptionId, cacheControl).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Retrieves details about given subscription which is associated with the
+ /// management group.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// Subscription ID.
+ ///
+ ///
+ /// Indicates that the request shouldn't utilize any caches.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetSubscriptionAsync(this IManagementGroupSubscriptionsOperations operations, string groupId, string subscriptionId, string cacheControl = "no-cache", CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetSubscriptionWithHttpMessagesAsync(groupId, subscriptionId, cacheControl, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Retrieves details about all subscriptions which are associated with the
+ /// management group.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ public static IPage GetSubscriptionsUnderManagementGroup(this IManagementGroupSubscriptionsOperations operations, string groupId)
+ {
+ return operations.GetSubscriptionsUnderManagementGroupAsync(groupId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Retrieves details about all subscriptions which are associated with the
+ /// management group.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management Group ID.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> GetSubscriptionsUnderManagementGroupAsync(this IManagementGroupSubscriptionsOperations operations, string groupId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetSubscriptionsUnderManagementGroupWithHttpMessagesAsync(groupId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Retrieves details about all subscriptions which are associated with the
+ /// management group.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage GetSubscriptionsUnderManagementGroupNext(this IManagementGroupSubscriptionsOperations operations, string nextPageLink)
+ {
+ return operations.GetSubscriptionsUnderManagementGroupNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Retrieves details about all subscriptions which are associated with the
+ /// management group.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> GetSubscriptionsUnderManagementGroupNextAsync(this IManagementGroupSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetSubscriptionsUnderManagementGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
}
}
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupsAPIClient.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupsAPIClient.cs
index 92035b29c06df..d5997742ec4f2 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupsAPIClient.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupsAPIClient.cs
@@ -28,6 +28,7 @@ namespace Microsoft.Azure.Management.ManagementGroups
/// subscriptions/resources into an organizational hierarchy and centrally
/// manage access control, policies, alerting and reporting for those
/// resources.
+ ///
///
public partial class ManagementGroupsAPIClient : ServiceClient, IManagementGroupsAPIClient, IAzureClient
{
@@ -58,19 +59,47 @@ public partial class ManagementGroupsAPIClient : ServiceClient
- /// Gets or sets the preferred language for the response.
+ /// The id of the operation result. Possible values include: 'create', 'delete'
+ ///
+ public string OperationResultId { get; set; }
+
+ ///
+ /// Number of entities to skip over when retrieving results. Passing this in
+ /// will override $skipToken.
+ ///
+ public int? Skip { get; set; }
+
+ ///
+ /// Number of elements to return when retrieving results. Passing this in will
+ /// override $skipToken.
+ ///
+ public int? Top { get; set; }
+
+ ///
+ /// 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.
+ ///
+ ///
+ public string Skiptoken { get; set; }
+
+ ///
+ /// The preferred language for the response.
///
public string AcceptLanguage { get; set; }
///
- /// Gets or sets the retry timeout in seconds for Long Running Operations.
- /// Default value is 30.
+ /// The retry timeout in seconds for Long Running Operations. Default value is
+ /// 30.
///
public int? LongRunningOperationRetryTimeout { get; set; }
///
- /// When set to true a unique x-ms-client-request-id value is generated and
- /// included in each request. Default is true.
+ /// Whether a unique x-ms-client-request-id should be generated. When set to
+ /// true a unique x-ms-client-request-id value is generated and included in
+ /// each request. Default is true.
///
public bool? GenerateClientRequestId { get; set; }
@@ -84,6 +113,11 @@ public partial class ManagementGroupsAPIClient : ServiceClient
public virtual IManagementGroupSubscriptionsOperations ManagementGroupSubscriptions { get; private set; }
+ ///
+ /// Gets the IHierarchySettingsOperations.
+ ///
+ public virtual IHierarchySettingsOperations HierarchySettings { get; private set; }
+
///
/// Gets the IOperations.
///
@@ -94,6 +128,19 @@ public partial class ManagementGroupsAPIClient : ServiceClient
public virtual IEntitiesOperations Entities { get; private set; }
+ ///
+ /// Initializes a new instance of the ManagementGroupsAPIClient class.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling ManagementGroupsAPIClient.Dispose(). False: will not dispose provided httpClient
+ protected ManagementGroupsAPIClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
+ {
+ Initialize();
+ }
+
///
/// Initializes a new instance of the ManagementGroupsAPIClient class.
///
@@ -189,6 +236,33 @@ public ManagementGroupsAPIClient(ServiceClientCredentials credentials, params De
}
}
+ ///
+ /// Initializes a new instance of the ManagementGroupsAPIClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling ManagementGroupsAPIClient.Dispose(). False: will not dispose provided httpClient
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public ManagementGroupsAPIClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
///
/// Initializes a new instance of the ManagementGroupsAPIClient class.
///
@@ -297,10 +371,11 @@ private void Initialize()
{
ManagementGroups = new ManagementGroupsOperations(this);
ManagementGroupSubscriptions = new ManagementGroupSubscriptionsOperations(this);
+ HierarchySettings = new HierarchySettingsOperations(this);
Operations = new Operations(this);
Entities = new EntitiesOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2018-03-01-preview";
+ ApiVersion = "2020-05-01";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
diff --git a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupsOperations.cs b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupsOperations.cs
index 8929c0f83e528..26272a5bfc796 100644
--- a/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupsOperations.cs
+++ b/sdk/managementgroups/Microsoft.Azure.Management.ManagementGroups/src/Generated/ManagementGroupsOperations.cs
@@ -52,16 +52,11 @@ internal ManagementGroupsOperations(ManagementGroupsAPIClient client)
///
/// List management groups for the authenticated user.
+ ///
///
///
/// Indicates that the request shouldn't utilize any caches.
///
- ///
- /// 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.
- ///
///
/// Headers that will be added to request.
///
@@ -83,7 +78,7 @@ internal ManagementGroupsOperations(ManagementGroupsAPIClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string cacheControl = "no-cache", string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -97,7 +92,6 @@ internal ManagementGroupsOperations(ManagementGroupsAPIClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("cacheControl", cacheControl);
- tracingParameters.Add("skiptoken", skiptoken);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
@@ -109,9 +103,9 @@ internal ManagementGroupsOperations(ManagementGroupsAPIClient client)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
- if (skiptoken != null)
+ if (Client.Skiptoken != null)
{
- _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken)));
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(Client.Skiptoken)));
}
if (_queryParameters.Count > 0)
{
@@ -243,14 +237,16 @@ internal ManagementGroupsOperations(ManagementGroupsAPIClient client)
///
/// Get the details of the management group.
+ ///
///
///
/// Management Group ID.
///
///
/// The $expand=children query string parameter allows clients to request
- /// inclusion of children in the response payload. Possible values include:
- /// 'children'
+ /// inclusion of children in the response payload. $expand=path includes the
+ /// path from the root group to the current group. Possible values include:
+ /// 'children', 'path'
///
///
/// The $recurse=true query string parameter allows clients to request
@@ -321,7 +317,7 @@ internal ManagementGroupsOperations(ManagementGroupsAPIClient client)
}
if (expand != null)
{
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"'))));
}
if (recurse != null)
{
@@ -460,9 +456,11 @@ internal ManagementGroupsOperations(ManagementGroupsAPIClient client)
}
///
- /// Create or update a management group. If a management group is already
- /// created and a subsequent create request is issued with different
- /// properties, the management group properties will be updated.
+ /// Create or update a management group.
+ /// If a management group is already created and a subsequent create request is
+ /// issued with different properties, the management group properties will be
+ /// updated.
+ ///
///
///
/// Management Group ID.
@@ -479,15 +477,16 @@ internal ManagementGroupsOperations(ManagementGroupsAPIClient client)
///
/// The cancellation token.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string groupId, CreateManagementGroupRequest createManagementGroupRequest, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string groupId, CreateManagementGroupRequest createManagementGroupRequest, string cacheControl = "no-cache", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
// Send Request
- AzureOperationResponse