diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/AliasOperations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/AliasOperations.cs
index da4174675671..f36a7f56ca2f 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/AliasOperations.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/AliasOperations.cs
@@ -54,7 +54,9 @@ internal AliasOperations(SubscriptionClient client)
/// Create Alias Subscription.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
///
@@ -64,10 +66,10 @@ internal AliasOperations(SubscriptionClient client)
///
/// The cancellation token.
///
- public async Task> CreateWithHttpMessagesAsync(string aliasName, PutAliasRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateWithHttpMessagesAsync(string aliasName, PutAliasRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
// Send Request
- AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(aliasName, body, customHeaders, cancellationToken).ConfigureAwait(false);
+ AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(aliasName, body, customHeaders, cancellationToken).ConfigureAwait(false);
return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -75,7 +77,9 @@ internal AliasOperations(SubscriptionClient client)
/// Get Alias Subscription.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
/// Headers that will be added to request.
@@ -98,13 +102,13 @@ internal AliasOperations(SubscriptionClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string aliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string aliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (aliasName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "aliasName");
}
- string apiVersion = "2020-09-01";
+ string apiVersion = "2021-10-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -214,7 +218,7 @@ internal AliasOperations(SubscriptionClient 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"))
@@ -227,7 +231,7 @@ internal AliasOperations(SubscriptionClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -250,7 +254,9 @@ internal AliasOperations(SubscriptionClient client)
/// Delete Alias.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
/// Headers that will be added to request.
@@ -276,7 +282,7 @@ internal AliasOperations(SubscriptionClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "aliasName");
}
- string apiVersion = "2020-09-01";
+ string apiVersion = "2021-10-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -401,7 +407,7 @@ internal AliasOperations(SubscriptionClient client)
}
///
- /// Get Alias Subscription.
+ /// List Alias Subscription.
///
///
/// Headers that will be added to request.
@@ -418,9 +424,9 @@ internal AliasOperations(SubscriptionClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- string apiVersion = "2020-09-01";
+ string apiVersion = "2021-10-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -528,7 +534,7 @@ internal AliasOperations(SubscriptionClient 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"))
@@ -541,7 +547,7 @@ internal AliasOperations(SubscriptionClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -564,7 +570,9 @@ internal AliasOperations(SubscriptionClient client)
/// Create Alias Subscription.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
///
@@ -589,7 +597,7 @@ internal AliasOperations(SubscriptionClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginCreateWithHttpMessagesAsync(string aliasName, PutAliasRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginCreateWithHttpMessagesAsync(string aliasName, PutAliasRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (aliasName == null)
{
@@ -599,11 +607,7 @@ internal AliasOperations(SubscriptionClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "body");
}
- if (body != null)
- {
- body.Validate();
- }
- string apiVersion = "2020-09-01";
+ string apiVersion = "2021-10-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -720,7 +724,7 @@ internal AliasOperations(SubscriptionClient 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"))
@@ -733,7 +737,7 @@ internal AliasOperations(SubscriptionClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -751,7 +755,7 @@ internal AliasOperations(SubscriptionClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/AliasOperationsExtensions.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/AliasOperationsExtensions.cs
index fee4b4322264..20862a6bbae8 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/AliasOperationsExtensions.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/AliasOperationsExtensions.cs
@@ -28,11 +28,13 @@ public static partial class AliasOperationsExtensions
/// The operations group for this extension method.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
///
- public static PutAliasResponse Create(this IAliasOperations operations, string aliasName, PutAliasRequest body)
+ public static SubscriptionAliasResponse Create(this IAliasOperations operations, string aliasName, PutAliasRequest body)
{
return operations.CreateAsync(aliasName, body).GetAwaiter().GetResult();
}
@@ -44,14 +46,16 @@ public static PutAliasResponse Create(this IAliasOperations operations, string a
/// The operations group for this extension method.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
///
///
/// The cancellation token.
///
- public static async Task CreateAsync(this IAliasOperations operations, string aliasName, PutAliasRequest body, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateAsync(this IAliasOperations operations, string aliasName, PutAliasRequest body, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateWithHttpMessagesAsync(aliasName, body, null, cancellationToken).ConfigureAwait(false))
{
@@ -66,9 +70,11 @@ public static PutAliasResponse Create(this IAliasOperations operations, string a
/// The operations group for this extension method.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
- public static PutAliasResponse Get(this IAliasOperations operations, string aliasName)
+ public static SubscriptionAliasResponse Get(this IAliasOperations operations, string aliasName)
{
return operations.GetAsync(aliasName).GetAwaiter().GetResult();
}
@@ -80,12 +86,14 @@ public static PutAliasResponse Get(this IAliasOperations operations, string alia
/// The operations group for this extension method.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IAliasOperations operations, string aliasName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IAliasOperations operations, string aliasName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(aliasName, null, cancellationToken).ConfigureAwait(false))
{
@@ -100,7 +108,9 @@ public static PutAliasResponse Get(this IAliasOperations operations, string alia
/// The operations group for this extension method.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
public static void Delete(this IAliasOperations operations, string aliasName)
{
@@ -114,7 +124,9 @@ public static void Delete(this IAliasOperations operations, string aliasName)
/// The operations group for this extension method.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
/// The cancellation token.
@@ -125,18 +137,18 @@ public static void Delete(this IAliasOperations operations, string aliasName)
}
///
- /// Get Alias Subscription.
+ /// List Alias Subscription.
///
///
/// The operations group for this extension method.
///
- public static PutAliasListResult List(this IAliasOperations operations)
+ public static SubscriptionAliasListResult List(this IAliasOperations operations)
{
return operations.ListAsync().GetAwaiter().GetResult();
}
///
- /// Get Alias Subscription.
+ /// List Alias Subscription.
///
///
/// The operations group for this extension method.
@@ -144,7 +156,7 @@ public static PutAliasListResult List(this IAliasOperations operations)
///
/// The cancellation token.
///
- public static async Task ListAsync(this IAliasOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task ListAsync(this IAliasOperations operations, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
{
@@ -159,11 +171,13 @@ public static PutAliasListResult List(this IAliasOperations operations)
/// The operations group for this extension method.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
///
- public static PutAliasResponse BeginCreate(this IAliasOperations operations, string aliasName, PutAliasRequest body)
+ public static SubscriptionAliasResponse BeginCreate(this IAliasOperations operations, string aliasName, PutAliasRequest body)
{
return operations.BeginCreateAsync(aliasName, body).GetAwaiter().GetResult();
}
@@ -175,14 +189,16 @@ public static PutAliasResponse BeginCreate(this IAliasOperations operations, str
/// The operations group for this extension method.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note that this
+ /// is not the same as subscription name and this doesn’t have any other
+ /// lifecycle need beyond the request for subscription creation.
///
///
///
///
/// The cancellation token.
///
- public static async Task BeginCreateAsync(this IAliasOperations operations, string aliasName, PutAliasRequest body, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginCreateAsync(this IAliasOperations operations, string aliasName, PutAliasRequest body, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.BeginCreateWithHttpMessagesAsync(aliasName, body, null, cancellationToken).ConfigureAwait(false))
{
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/BillingAccountOperations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/BillingAccountOperations.cs
new file mode 100644
index 000000000000..b58fe21d591a
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/BillingAccountOperations.cs
@@ -0,0 +1,229 @@
+//
+// 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.Subscription
+{
+ 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;
+
+ ///
+ /// BillingAccountOperations operations.
+ ///
+ internal partial class BillingAccountOperations : IServiceOperations, IBillingAccountOperations
+ {
+ ///
+ /// Initializes a new instance of the BillingAccountOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal BillingAccountOperations(SubscriptionClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the SubscriptionClient
+ ///
+ public SubscriptionClient Client { get; private set; }
+
+ ///
+ /// Get Billing Account Policy.
+ ///
+ ///
+ /// Billing Account 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> GetPolicyWithHttpMessagesAsync(string billingAccountId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (billingAccountId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountId");
+ }
+ string apiVersion = "2021-10-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("billingAccountId", billingAccountId);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetPolicy", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default").ToString();
+ _url = _url.Replace("{billingAccountId}", System.Uri.EscapeDataString(billingAccountId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorResponseBodyException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponseBody _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/subscription/Microsoft.Azure.Management.Subscription/src/Generated/BillingAccountOperationsExtensions.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/BillingAccountOperationsExtensions.cs
new file mode 100644
index 000000000000..a80b42cfb9fa
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/BillingAccountOperationsExtensions.cs
@@ -0,0 +1,59 @@
+//
+// 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.Subscription
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for BillingAccountOperations.
+ ///
+ public static partial class BillingAccountOperationsExtensions
+ {
+ ///
+ /// Get Billing Account Policy.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Billing Account Id.
+ ///
+ public static BillingAccountPoliciesResponse GetPolicy(this IBillingAccountOperations operations, string billingAccountId)
+ {
+ return operations.GetPolicyAsync(billingAccountId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get Billing Account Policy.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Billing Account Id.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetPolicyAsync(this IBillingAccountOperations operations, string billingAccountId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetPolicyWithHttpMessagesAsync(billingAccountId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IAliasOperations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IAliasOperations.cs
index cfa5b2242375..dfcbb75fb49f 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IAliasOperations.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IAliasOperations.cs
@@ -27,7 +27,10 @@ public partial interface IAliasOperations
/// Create Alias Subscription.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note
+ /// that this is not the same as subscription name and this doesn’t
+ /// have any other lifecycle need beyond the request for subscription
+ /// creation.
///
///
///
@@ -46,12 +49,15 @@ public partial interface IAliasOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateWithHttpMessagesAsync(string aliasName, PutAliasRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateWithHttpMessagesAsync(string aliasName, PutAliasRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get Alias Subscription.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note
+ /// that this is not the same as subscription name and this doesn’t
+ /// have any other lifecycle need beyond the request for subscription
+ /// creation.
///
///
/// The headers that will be added to request.
@@ -68,12 +74,15 @@ public partial interface IAliasOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string aliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetWithHttpMessagesAsync(string aliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Delete Alias.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note
+ /// that this is not the same as subscription name and this doesn’t
+ /// have any other lifecycle need beyond the request for subscription
+ /// creation.
///
///
/// The headers that will be added to request.
@@ -89,7 +98,7 @@ public partial interface IAliasOperations
///
Task DeleteWithHttpMessagesAsync(string aliasName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Get Alias Subscription.
+ /// List Alias Subscription.
///
///
/// The headers that will be added to request.
@@ -106,12 +115,15 @@ public partial interface IAliasOperations
///
/// Thrown when a required parameter is null
///
- Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Create Alias Subscription.
///
///
- /// Alias Name
+ /// AliasName is the name for the subscription creation request. Note
+ /// that this is not the same as subscription name and this doesn’t
+ /// have any other lifecycle need beyond the request for subscription
+ /// creation.
///
///
///
@@ -130,6 +142,6 @@ public partial interface IAliasOperations
///
/// Thrown when a required parameter is null
///
- Task> BeginCreateWithHttpMessagesAsync(string aliasName, PutAliasRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> BeginCreateWithHttpMessagesAsync(string aliasName, PutAliasRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IBillingAccountOperations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IBillingAccountOperations.cs
new file mode 100644
index 000000000000..f415da8bd98c
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IBillingAccountOperations.cs
@@ -0,0 +1,49 @@
+//
+// 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.Subscription
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// BillingAccountOperations operations.
+ ///
+ public partial interface IBillingAccountOperations
+ {
+ ///
+ /// Get Billing Account Policy.
+ ///
+ ///
+ /// Billing Account 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> GetPolicyWithHttpMessagesAsync(string billingAccountId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IOperations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IOperations.cs
index 12c0b63db81d..3373bfc7e5ec 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IOperations.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/IOperations.cs
@@ -32,7 +32,7 @@ public partial interface IOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -41,6 +41,28 @@ public partial interface IOperations
///
/// Thrown when a required parameter is null
///
- Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all of the available Microsoft.Subscription API operations.
+ ///
+ ///
+ /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionClient.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionClient.cs
index 7bbd5b6ec520..f11e2c70abb3 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionClient.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionClient.cs
@@ -84,5 +84,15 @@ public partial interface ISubscriptionClient : System.IDisposable
///
IAliasOperations Alias { get; }
+ ///
+ /// Gets the ISubscriptionPolicyOperations.
+ ///
+ ISubscriptionPolicyOperations SubscriptionPolicy { get; }
+
+ ///
+ /// Gets the IBillingAccountOperations.
+ ///
+ IBillingAccountOperations BillingAccount { get; }
+
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionOperations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionOperations.cs
index 6c2d5c395ffb..a5350718e382 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionOperations.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionOperations.cs
@@ -35,7 +35,7 @@ public partial interface ISubscriptionOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -60,7 +60,7 @@ public partial interface ISubscriptionOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -82,7 +82,7 @@ public partial interface ISubscriptionOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -92,5 +92,69 @@ public partial interface ISubscriptionOperations
/// Thrown when a required parameter is null
///
Task> EnableWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Accept subscription ownership.
+ ///
+ ///
+ /// Subscription 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> AcceptOwnershipWithHttpMessagesAsync(string subscriptionId, AcceptOwnershipRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Accept subscription ownership status.
+ ///
+ ///
+ /// Subscription 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> AcceptOwnershipStatusWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Accept subscription ownership.
+ ///
+ ///
+ /// Subscription 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> BeginAcceptOwnershipWithHttpMessagesAsync(string subscriptionId, AcceptOwnershipRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionPolicyOperations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionPolicyOperations.cs
new file mode 100644
index 000000000000..8698a0b53de9
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/ISubscriptionPolicyOperations.cs
@@ -0,0 +1,108 @@
+//
+// 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.Subscription
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// SubscriptionPolicyOperations operations.
+ ///
+ public partial interface ISubscriptionPolicyOperations
+ {
+ ///
+ /// Create or Update Subscription tenant policy for user's tenant.
+ ///
+ ///
+ ///
+ ///
+ /// 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> AddUpdatePolicyForTenantWithHttpMessagesAsync(PutTenantPolicyRequestProperties body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// 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> GetPolicyForTenantWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// 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>> ListPolicyForTenantWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// 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>> ListPolicyForTenantNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnership.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnership.cs
new file mode 100644
index 000000000000..0eb3a4d45d99
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnership.cs
@@ -0,0 +1,23 @@
+//
+// 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.Subscription.Models
+{
+
+ ///
+ /// Defines values for AcceptOwnership.
+ ///
+ public static class AcceptOwnership
+ {
+ public const string Pending = "Pending";
+ public const string Completed = "Completed";
+ public const string Expired = "Expired";
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnershipRequest.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnershipRequest.cs
new file mode 100644
index 000000000000..9f74669ff4e2
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnershipRequest.cs
@@ -0,0 +1,65 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The parameters required to accept subscription ownership.
+ ///
+ public partial class AcceptOwnershipRequest
+ {
+ ///
+ /// Initializes a new instance of the AcceptOwnershipRequest class.
+ ///
+ public AcceptOwnershipRequest()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the AcceptOwnershipRequest class.
+ ///
+ /// Accept subscription ownership request
+ /// properties.
+ public AcceptOwnershipRequest(AcceptOwnershipRequestProperties properties = default(AcceptOwnershipRequestProperties))
+ {
+ Properties = properties;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets accept subscription ownership request properties.
+ ///
+ [JsonProperty(PropertyName = "properties")]
+ public AcceptOwnershipRequestProperties Properties { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Properties != null)
+ {
+ Properties.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnershipRequestProperties.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnershipRequestProperties.cs
new file mode 100644
index 000000000000..a21e0f807ae3
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnershipRequestProperties.cs
@@ -0,0 +1,87 @@
+//
+// 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.Subscription.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Accept subscription ownership request properties.
+ ///
+ public partial class AcceptOwnershipRequestProperties
+ {
+ ///
+ /// Initializes a new instance of the AcceptOwnershipRequestProperties
+ /// class.
+ ///
+ public AcceptOwnershipRequestProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the AcceptOwnershipRequestProperties
+ /// class.
+ ///
+ /// The friendly name of the
+ /// subscription.
+ /// Management group Id for the
+ /// subscription.
+ /// Tags for the subscription
+ public AcceptOwnershipRequestProperties(string displayName, string managementGroupId = default(string), IDictionary tags = default(IDictionary))
+ {
+ DisplayName = displayName;
+ ManagementGroupId = managementGroupId;
+ Tags = tags;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the friendly name of the subscription.
+ ///
+ [JsonProperty(PropertyName = "displayName")]
+ public string DisplayName { get; set; }
+
+ ///
+ /// Gets or sets management group Id for the subscription.
+ ///
+ [JsonProperty(PropertyName = "managementGroupId")]
+ public string ManagementGroupId { get; set; }
+
+ ///
+ /// Gets or sets tags for the subscription
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (DisplayName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName");
+ }
+ }
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnershipStatusResponse.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnershipStatusResponse.cs
new file mode 100644
index 000000000000..27185f5c89bb
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/AcceptOwnershipStatusResponse.cs
@@ -0,0 +1,99 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Subscription Accept Ownership Response
+ ///
+ public partial class AcceptOwnershipStatusResponse
+ {
+ ///
+ /// Initializes a new instance of the AcceptOwnershipStatusResponse
+ /// class.
+ ///
+ public AcceptOwnershipStatusResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the AcceptOwnershipStatusResponse
+ /// class.
+ ///
+ /// Newly created subscription Id.
+ /// Possible values include:
+ /// 'Pending', 'Completed', 'Expired'
+ /// UPN of the billing owner
+ /// Tenant Id of the
+ /// subscription
+ /// The display name of the
+ /// subscription.
+ /// Tags for the subscription
+ public AcceptOwnershipStatusResponse(string subscriptionId = default(string), string acceptOwnershipState = default(string), string billingOwner = default(string), string subscriptionTenantId = default(string), string displayName = default(string), IDictionary tags = default(IDictionary))
+ {
+ SubscriptionId = subscriptionId;
+ AcceptOwnershipState = acceptOwnershipState;
+ BillingOwner = billingOwner;
+ SubscriptionTenantId = subscriptionTenantId;
+ DisplayName = displayName;
+ Tags = tags;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets newly created subscription Id.
+ ///
+ [JsonProperty(PropertyName = "subscriptionId")]
+ public string SubscriptionId { get; private set; }
+
+ ///
+ /// Gets or sets possible values include: 'Pending', 'Completed',
+ /// 'Expired'
+ ///
+ [JsonProperty(PropertyName = "acceptOwnershipState")]
+ public string AcceptOwnershipState { get; set; }
+
+ ///
+ /// Gets UPN of the billing owner
+ ///
+ [JsonProperty(PropertyName = "billingOwner")]
+ public string BillingOwner { get; private set; }
+
+ ///
+ /// Gets or sets tenant Id of the subscription
+ ///
+ [JsonProperty(PropertyName = "subscriptionTenantId")]
+ public string SubscriptionTenantId { get; set; }
+
+ ///
+ /// Gets or sets the display name of the subscription.
+ ///
+ [JsonProperty(PropertyName = "displayName")]
+ public string DisplayName { get; set; }
+
+ ///
+ /// Gets or sets tags for the subscription
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/BillingAccountPoliciesResponse.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/BillingAccountPoliciesResponse.cs
new file mode 100644
index 000000000000..517cf9a4431f
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/BillingAccountPoliciesResponse.cs
@@ -0,0 +1,86 @@
+//
+// 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.Subscription.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Billing account policies information.
+ ///
+ public partial class BillingAccountPoliciesResponse : IResource
+ {
+ ///
+ /// Initializes a new instance of the BillingAccountPoliciesResponse
+ /// class.
+ ///
+ public BillingAccountPoliciesResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BillingAccountPoliciesResponse
+ /// class.
+ ///
+ /// Fully qualified ID for the policy.
+ /// Policy name.
+ /// Resource type.
+ /// Billing account policies response
+ /// properties.
+ public BillingAccountPoliciesResponse(string id = default(string), string name = default(string), string type = default(string), BillingAccountPoliciesResponseProperties properties = default(BillingAccountPoliciesResponseProperties), SystemData systemData = default(SystemData))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ Properties = properties;
+ SystemData = systemData;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets fully qualified ID for the policy.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets policy name.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets resource type.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets or sets billing account policies response properties.
+ ///
+ [JsonProperty(PropertyName = "properties")]
+ public BillingAccountPoliciesResponseProperties Properties { get; set; }
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "systemData")]
+ public SystemData SystemData { get; private set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/BillingAccountPoliciesResponseProperties.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/BillingAccountPoliciesResponseProperties.cs
new file mode 100644
index 000000000000..4bab9c544a26
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/BillingAccountPoliciesResponseProperties.cs
@@ -0,0 +1,66 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Put billing account policies response properties.
+ ///
+ public partial class BillingAccountPoliciesResponseProperties
+ {
+ ///
+ /// Initializes a new instance of the
+ /// BillingAccountPoliciesResponseProperties class.
+ ///
+ public BillingAccountPoliciesResponseProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// BillingAccountPoliciesResponseProperties class.
+ ///
+ /// Service tenant for the billing
+ /// account.
+ /// Determine if the transfers are allowed
+ /// for the billing account
+ public BillingAccountPoliciesResponseProperties(IList serviceTenants = default(IList), bool? allowTransfers = default(bool?))
+ {
+ ServiceTenants = serviceTenants;
+ AllowTransfers = allowTransfers;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets service tenant for the billing account.
+ ///
+ [JsonProperty(PropertyName = "serviceTenants")]
+ public IList ServiceTenants { get; set; }
+
+ ///
+ /// Gets or sets determine if the transfers are allowed for the billing
+ /// account
+ ///
+ [JsonProperty(PropertyName = "allowTransfers")]
+ public bool? AllowTransfers { get; set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/CanceledSubscriptionId.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/CanceledSubscriptionId.cs
index e3ca450ac659..ba4e7ce34252 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/CanceledSubscriptionId.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/CanceledSubscriptionId.cs
@@ -29,10 +29,11 @@ public CanceledSubscriptionId()
///
/// Initializes a new instance of the CanceledSubscriptionId class.
///
- /// The ID of the canceled subscription
- public CanceledSubscriptionId(string value = default(string))
+ /// The ID of the canceled
+ /// subscription
+ public CanceledSubscriptionId(string subscriptionId = default(string))
{
- Value = value;
+ SubscriptionId = subscriptionId;
CustomInit();
}
@@ -44,8 +45,8 @@ public CanceledSubscriptionId()
///
/// Gets the ID of the canceled subscription
///
- [JsonProperty(PropertyName = "value")]
- public string Value { get; private set; }
+ [JsonProperty(PropertyName = "subscriptionId")]
+ public string SubscriptionId { get; private set; }
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/CreatedByType.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/CreatedByType.cs
new file mode 100644
index 000000000000..2e8acb1c42fa
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/CreatedByType.cs
@@ -0,0 +1,24 @@
+//
+// 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.Subscription.Models
+{
+
+ ///
+ /// Defines values for CreatedByType.
+ ///
+ public static class CreatedByType
+ {
+ public const string User = "User";
+ public const string Application = "Application";
+ public const string ManagedIdentity = "ManagedIdentity";
+ public const string Key = "Key";
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/EnabledSubscriptionId.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/EnabledSubscriptionId.cs
index ae845b0d574c..2436f9b54b19 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/EnabledSubscriptionId.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/EnabledSubscriptionId.cs
@@ -29,11 +29,11 @@ public EnabledSubscriptionId()
///
/// Initializes a new instance of the EnabledSubscriptionId class.
///
- /// The ID of the subscriptions that is being
- /// enabled
- public EnabledSubscriptionId(string value = default(string))
+ /// The ID of the subscriptions that is
+ /// being enabled
+ public EnabledSubscriptionId(string subscriptionId = default(string))
{
- Value = value;
+ SubscriptionId = subscriptionId;
CustomInit();
}
@@ -45,8 +45,8 @@ public EnabledSubscriptionId()
///
/// Gets the ID of the subscriptions that is being enabled
///
- [JsonProperty(PropertyName = "value")]
- public string Value { get; private set; }
+ [JsonProperty(PropertyName = "subscriptionId")]
+ public string SubscriptionId { get; private set; }
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ErrorResponseBody.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ErrorResponseBody.cs
index 6675e261bc18..575909638a13 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ErrorResponseBody.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ErrorResponseBody.cs
@@ -31,9 +31,14 @@ public ErrorResponseBody()
/// Initializes a new instance of the ErrorResponseBody class.
///
/// The details of the error.
- public ErrorResponseBody(ErrorResponse error = default(ErrorResponse))
+ /// Error code
+ /// Error message indicating why the operation
+ /// failed.
+ public ErrorResponseBody(ErrorResponse error = default(ErrorResponse), string code = default(string), string message = default(string))
{
Error = error;
+ Code = code;
+ Message = message;
CustomInit();
}
@@ -48,5 +53,17 @@ public ErrorResponseBody()
[JsonProperty(PropertyName = "error")]
public ErrorResponse Error { get; set; }
+ ///
+ /// Gets or sets error code
+ ///
+ [JsonProperty(PropertyName = "code")]
+ public string Code { get; set; }
+
+ ///
+ /// Gets or sets error message indicating why the operation failed.
+ ///
+ [JsonProperty(PropertyName = "message")]
+ public string Message { get; set; }
+
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ErrorResponseException.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ErrorResponseException.cs
deleted file mode 100644
index b2fd7ef8417d..000000000000
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ErrorResponseException.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// 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.Subscription.Models
-{
- using Microsoft.Rest;
-
- ///
- /// Exception thrown for an invalid response with ErrorResponse
- /// information.
- ///
- public partial class ErrorResponseException : RestException
- {
- ///
- /// Gets information about the associated HTTP request.
- ///
- public HttpRequestMessageWrapper Request { get; set; }
-
- ///
- /// Gets information about the associated HTTP response.
- ///
- public HttpResponseMessageWrapper Response { get; set; }
-
- ///
- /// Gets or sets the body object.
- ///
- public ErrorResponse Body { get; set; }
-
- ///
- /// Initializes a new instance of the ErrorResponseException class.
- ///
- public ErrorResponseException()
- {
- }
-
- ///
- /// Initializes a new instance of the ErrorResponseException class.
- ///
- /// The exception message.
- public ErrorResponseException(string message)
- : this(message, null)
- {
- }
-
- ///
- /// Initializes a new instance of the ErrorResponseException class.
- ///
- /// The exception message.
- /// Inner exception.
- public ErrorResponseException(string message, System.Exception innerException)
- : base(message, innerException)
- {
- }
- }
-}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/GetTenantPolicyResponse.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/GetTenantPolicyResponse.cs
new file mode 100644
index 000000000000..7ca4b8bd48c8
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/GetTenantPolicyResponse.cs
@@ -0,0 +1,83 @@
+//
+// 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.Subscription.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Tenant policy Information.
+ ///
+ public partial class GetTenantPolicyResponse : IResource
+ {
+ ///
+ /// Initializes a new instance of the GetTenantPolicyResponse class.
+ ///
+ public GetTenantPolicyResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the GetTenantPolicyResponse class.
+ ///
+ /// Policy Id.
+ /// Policy name.
+ /// Resource type.
+ /// Tenant policy properties.
+ public GetTenantPolicyResponse(string id = default(string), string name = default(string), string type = default(string), TenantPolicy properties = default(TenantPolicy), SystemData systemData = default(SystemData))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ Properties = properties;
+ SystemData = systemData;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets policy Id.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets policy name.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets resource type.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets or sets tenant policy properties.
+ ///
+ [JsonProperty(PropertyName = "properties")]
+ public TenantPolicy Properties { get; set; }
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "systemData")]
+ public SystemData SystemData { get; private set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/Operation.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/Operation.cs
index 6ff91e6a10cc..a3b1d2c569e4 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/Operation.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/Operation.cs
@@ -31,11 +31,14 @@ public Operation()
///
/// Operation name:
/// {provider}/{resource}/{operation}
+ /// Indicates whether the operation is a
+ /// data action
/// The object that represents the
/// operation.
- public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay))
+ public Operation(string name = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay))
{
Name = name;
+ IsDataAction = isDataAction;
Display = display;
CustomInit();
}
@@ -51,6 +54,12 @@ public Operation()
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
+ ///
+ /// Gets or sets indicates whether the operation is a data action
+ ///
+ [JsonProperty(PropertyName = "isDataAction")]
+ public bool? IsDataAction { get; set; }
+
///
/// Gets or sets the object that represents the operation.
///
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/OperationDisplay.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/OperationDisplay.cs
index 2245272581ed..a71aab35296d 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/OperationDisplay.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/OperationDisplay.cs
@@ -35,11 +35,14 @@ public OperationDisplay()
/// performed: Profile, endpoint, etc.
/// Operation type: Read, write, delete,
/// etc.
- public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string))
+ /// Localized friendly description for the
+ /// operation
+ public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string))
{
Provider = provider;
Resource = resource;
Operation = operation;
+ Description = description;
CustomInit();
}
@@ -67,5 +70,11 @@ public OperationDisplay()
[JsonProperty(PropertyName = "operation")]
public string Operation { get; set; }
+ ///
+ /// Gets or sets localized friendly description for the operation
+ ///
+ [JsonProperty(PropertyName = "description")]
+ public string Description { get; set; }
+
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/OperationListResult.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/OperationListResult.cs
deleted file mode 100644
index 22c1beb90f95..000000000000
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/OperationListResult.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// 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.Subscription.Models
-{
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// Result of the request to list operations. It contains a list of
- /// operations and a URL link to get the next set of results.
- ///
- public partial class OperationListResult
- {
- ///
- /// Initializes a new instance of the OperationListResult class.
- ///
- public OperationListResult()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the OperationListResult class.
- ///
- /// List of operations.
- /// URL to get the next set of operation list
- /// results if there are any.
- public OperationListResult(IList value = default(IList), string nextLink = default(string))
- {
- Value = value;
- NextLink = nextLink;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets list of operations.
- ///
- [JsonProperty(PropertyName = "value")]
- public IList Value { get; set; }
-
- ///
- /// Gets or sets URL to get the next set of operation list results if
- /// there are any.
- ///
- [JsonProperty(PropertyName = "nextLink")]
- public string NextLink { get; set; }
-
- }
-}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequest.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequest.cs
index c5616ceaa743..9f9dc8f4d105 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequest.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequest.cs
@@ -10,7 +10,6 @@
namespace Microsoft.Azure.Management.Subscription.Models
{
- using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
@@ -31,7 +30,7 @@ public PutAliasRequest()
/// Initializes a new instance of the PutAliasRequest class.
///
/// Put alias request properties.
- public PutAliasRequest(PutAliasRequestProperties properties)
+ public PutAliasRequest(PutAliasRequestProperties properties = default(PutAliasRequestProperties))
{
Properties = properties;
CustomInit();
@@ -48,18 +47,5 @@ public PutAliasRequest(PutAliasRequestProperties properties)
[JsonProperty(PropertyName = "properties")]
public PutAliasRequestProperties Properties { get; set; }
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (Properties == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "Properties");
- }
- }
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequestAdditionalProperties.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequestAdditionalProperties.cs
new file mode 100644
index 000000000000..c5c3eed343e2
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequestAdditionalProperties.cs
@@ -0,0 +1,82 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Put subscription additional properties.
+ ///
+ public partial class PutAliasRequestAdditionalProperties
+ {
+ ///
+ /// Initializes a new instance of the
+ /// PutAliasRequestAdditionalProperties class.
+ ///
+ public PutAliasRequestAdditionalProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// PutAliasRequestAdditionalProperties class.
+ ///
+ /// Management group Id for the
+ /// subscription.
+ /// Tenant Id of the
+ /// subscription
+ /// Owner Id of the
+ /// subscription
+ /// Tags for the subscription
+ public PutAliasRequestAdditionalProperties(string managementGroupId = default(string), string subscriptionTenantId = default(string), string subscriptionOwnerId = default(string), IDictionary tags = default(IDictionary))
+ {
+ ManagementGroupId = managementGroupId;
+ SubscriptionTenantId = subscriptionTenantId;
+ SubscriptionOwnerId = subscriptionOwnerId;
+ Tags = tags;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets management group Id for the subscription.
+ ///
+ [JsonProperty(PropertyName = "managementGroupId")]
+ public string ManagementGroupId { get; set; }
+
+ ///
+ /// Gets or sets tenant Id of the subscription
+ ///
+ [JsonProperty(PropertyName = "subscriptionTenantId")]
+ public string SubscriptionTenantId { get; set; }
+
+ ///
+ /// Gets or sets owner Id of the subscription
+ ///
+ [JsonProperty(PropertyName = "subscriptionOwnerId")]
+ public string SubscriptionOwnerId { get; set; }
+
+ ///
+ /// Gets or sets tags for the subscription
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequestProperties.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequestProperties.cs
index dc803b7b3409..25437858bacb 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequestProperties.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasRequestProperties.cs
@@ -31,21 +31,21 @@ public PutAliasRequestProperties()
///
/// The friendly name of the
/// subscription.
- /// The workload type of the subscription. It
- /// can be either Production or DevTest. Possible values include:
- /// 'Production', 'DevTest'
- /// Determines whether subscription is
- /// fieldLed, partnerLed or LegacyEA
+ /// Possible values include: 'Production',
+ /// 'DevTest'
/// This parameter can be used to create
/// alias for existing subscription Id
- /// Reseller ID, basically MPN Id
- public PutAliasRequestProperties(string displayName = default(string), string workload = default(string), string billingScope = default(string), string subscriptionId = default(string), string resellerId = default(string))
+ /// Reseller Id
+ /// Put alias request additional
+ /// properties.
+ public PutAliasRequestProperties(string displayName = default(string), string workload = default(string), string billingScope = default(string), string subscriptionId = default(string), string resellerId = default(string), PutAliasRequestAdditionalProperties additionalProperties = default(PutAliasRequestAdditionalProperties))
{
DisplayName = displayName;
Workload = workload;
BillingScope = billingScope;
SubscriptionId = subscriptionId;
ResellerId = resellerId;
+ AdditionalProperties = additionalProperties;
CustomInit();
}
@@ -61,16 +61,12 @@ public PutAliasRequestProperties()
public string DisplayName { get; set; }
///
- /// Gets or sets the workload type of the subscription. It can be
- /// either Production or DevTest. Possible values include:
- /// 'Production', 'DevTest'
+ /// Gets or sets possible values include: 'Production', 'DevTest'
///
[JsonProperty(PropertyName = "workload")]
public string Workload { get; set; }
///
- /// Gets or sets determines whether subscription is fieldLed,
- /// partnerLed or LegacyEA
///
[JsonProperty(PropertyName = "billingScope")]
public string BillingScope { get; set; }
@@ -83,10 +79,16 @@ public PutAliasRequestProperties()
public string SubscriptionId { get; set; }
///
- /// Gets or sets reseller ID, basically MPN Id
+ /// Gets or sets reseller Id
///
[JsonProperty(PropertyName = "resellerId")]
public string ResellerId { get; set; }
+ ///
+ /// Gets or sets put alias request additional properties.
+ ///
+ [JsonProperty(PropertyName = "additionalProperties")]
+ public PutAliasRequestAdditionalProperties AdditionalProperties { get; set; }
+
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasResponseProperties.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasResponseProperties.cs
deleted file mode 100644
index 180d517ee36e..000000000000
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasResponseProperties.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// 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.Subscription.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// Put subscription creation result properties.
- ///
- public partial class PutAliasResponseProperties
- {
- ///
- /// Initializes a new instance of the PutAliasResponseProperties class.
- ///
- public PutAliasResponseProperties()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the PutAliasResponseProperties class.
- ///
- /// Newly created subscription Id.
- /// The provisioning state of the
- /// resource. Possible values include: 'Accepted', 'Succeeded',
- /// 'Failed'
- public PutAliasResponseProperties(string subscriptionId = default(string), string provisioningState = default(string))
- {
- SubscriptionId = subscriptionId;
- ProvisioningState = provisioningState;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets newly created subscription Id.
- ///
- [JsonProperty(PropertyName = "subscriptionId")]
- public string SubscriptionId { get; private set; }
-
- ///
- /// Gets or sets the provisioning state of the resource. Possible
- /// values include: 'Accepted', 'Succeeded', 'Failed'
- ///
- [JsonProperty(PropertyName = "provisioningState")]
- public string ProvisioningState { get; set; }
-
- }
-}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutTenantPolicyRequestProperties.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutTenantPolicyRequestProperties.cs
new file mode 100644
index 000000000000..2e6b029360a1
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutTenantPolicyRequestProperties.cs
@@ -0,0 +1,78 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Put tenant policy request properties.
+ ///
+ public partial class PutTenantPolicyRequestProperties
+ {
+ ///
+ /// Initializes a new instance of the PutTenantPolicyRequestProperties
+ /// class.
+ ///
+ public PutTenantPolicyRequestProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PutTenantPolicyRequestProperties
+ /// class.
+ ///
+ /// Blocks the leaving of
+ /// subscriptions from user's tenant.
+ /// Blocks the entering of
+ /// subscriptions into user's tenant.
+ /// List of user objectIds that are
+ /// exempted from the set subscription tenant policies for the user's
+ /// tenant.
+ public PutTenantPolicyRequestProperties(bool? blockSubscriptionsLeavingTenant = default(bool?), bool? blockSubscriptionsIntoTenant = default(bool?), IList exemptedPrincipals = default(IList))
+ {
+ BlockSubscriptionsLeavingTenant = blockSubscriptionsLeavingTenant;
+ BlockSubscriptionsIntoTenant = blockSubscriptionsIntoTenant;
+ ExemptedPrincipals = exemptedPrincipals;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets blocks the leaving of subscriptions from user's
+ /// tenant.
+ ///
+ [JsonProperty(PropertyName = "blockSubscriptionsLeavingTenant")]
+ public bool? BlockSubscriptionsLeavingTenant { get; set; }
+
+ ///
+ /// Gets or sets blocks the entering of subscriptions into user's
+ /// tenant.
+ ///
+ [JsonProperty(PropertyName = "blockSubscriptionsIntoTenant")]
+ public bool? BlockSubscriptionsIntoTenant { get; set; }
+
+ ///
+ /// Gets or sets list of user objectIds that are exempted from the set
+ /// subscription tenant policies for the user's tenant.
+ ///
+ [JsonProperty(PropertyName = "exemptedPrincipals")]
+ public IList ExemptedPrincipals { get; set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/RenamedSubscriptionId.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/RenamedSubscriptionId.cs
index 559ead111a38..907cc5dd0c61 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/RenamedSubscriptionId.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/RenamedSubscriptionId.cs
@@ -29,11 +29,11 @@ public RenamedSubscriptionId()
///
/// Initializes a new instance of the RenamedSubscriptionId class.
///
- /// The ID of the subscriptions that is being
- /// renamed
- public RenamedSubscriptionId(string value = default(string))
+ /// The ID of the subscriptions that is
+ /// being renamed
+ public RenamedSubscriptionId(string subscriptionId = default(string))
{
- Value = value;
+ SubscriptionId = subscriptionId;
CustomInit();
}
@@ -45,8 +45,8 @@ public RenamedSubscriptionId()
///
/// Gets the ID of the subscriptions that is being renamed
///
- [JsonProperty(PropertyName = "value")]
- public string Value { get; private set; }
+ [JsonProperty(PropertyName = "subscriptionId")]
+ public string SubscriptionId { get; private set; }
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ServiceTenantResponse.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ServiceTenantResponse.cs
new file mode 100644
index 000000000000..5d5452801875
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/ServiceTenantResponse.cs
@@ -0,0 +1,59 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Billing account service tenant.
+ ///
+ public partial class ServiceTenantResponse
+ {
+ ///
+ /// Initializes a new instance of the ServiceTenantResponse class.
+ ///
+ public ServiceTenantResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ServiceTenantResponse class.
+ ///
+ /// Service tenant id.
+ /// Service tenant name.
+ public ServiceTenantResponse(string tenantId = default(string), string tenantName = default(string))
+ {
+ TenantId = tenantId;
+ TenantName = tenantName;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets service tenant id.
+ ///
+ [JsonProperty(PropertyName = "tenantId")]
+ public string TenantId { get; set; }
+
+ ///
+ /// Gets or sets service tenant name.
+ ///
+ [JsonProperty(PropertyName = "tenantName")]
+ public string TenantName { get; set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAcceptOwnershipHeaders.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAcceptOwnershipHeaders.cs
new file mode 100644
index 000000000000..475c347bdc97
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAcceptOwnershipHeaders.cs
@@ -0,0 +1,66 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Defines headers for AcceptOwnership operation.
+ ///
+ public partial class SubscriptionAcceptOwnershipHeaders
+ {
+ ///
+ /// Initializes a new instance of the
+ /// SubscriptionAcceptOwnershipHeaders class.
+ ///
+ public SubscriptionAcceptOwnershipHeaders()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// SubscriptionAcceptOwnershipHeaders class.
+ ///
+ /// GET this URL to retrieve the status of the
+ /// asynchronous operation.
+ /// The amount of delay to use while the
+ /// status of the operation is checked. The value is expressed in
+ /// seconds.
+ public SubscriptionAcceptOwnershipHeaders(string location = default(string), int? retryAfter = default(int?))
+ {
+ Location = location;
+ RetryAfter = retryAfter;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets GET this URL to retrieve the status of the
+ /// asynchronous operation.
+ ///
+ [JsonProperty(PropertyName = "Location")]
+ public string Location { get; set; }
+
+ ///
+ /// Gets or sets the amount of delay to use while the status of the
+ /// operation is checked. The value is expressed in seconds.
+ ///
+ [JsonProperty(PropertyName = "Retry-After")]
+ public int? RetryAfter { get; set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasListResult.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAliasListResult.cs
similarity index 74%
rename from sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasListResult.cs
rename to sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAliasListResult.cs
index 043dfbff2ba3..a840ef7c0f14 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasListResult.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAliasListResult.cs
@@ -18,23 +18,25 @@ namespace Microsoft.Azure.Management.Subscription.Models
///
/// The list of aliases.
///
- public partial class PutAliasListResult
+ public partial class SubscriptionAliasListResult
{
///
- /// Initializes a new instance of the PutAliasListResult class.
+ /// Initializes a new instance of the SubscriptionAliasListResult
+ /// class.
///
- public PutAliasListResult()
+ public SubscriptionAliasListResult()
{
CustomInit();
}
///
- /// Initializes a new instance of the PutAliasListResult class.
+ /// Initializes a new instance of the SubscriptionAliasListResult
+ /// class.
///
/// The list of alias.
/// The link (url) to the next page of
/// results.
- public PutAliasListResult(IList value = default(IList), string nextLink = default(string))
+ public SubscriptionAliasListResult(IList value = default(IList), string nextLink = default(string))
{
Value = value;
NextLink = nextLink;
@@ -50,7 +52,7 @@ public PutAliasListResult()
/// Gets the list of alias.
///
[JsonProperty(PropertyName = "value")]
- public IList Value { get; private set; }
+ public IList Value { get; private set; }
///
/// Gets the link (url) to the next page of results.
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasResponse.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAliasResponse.cs
similarity index 67%
rename from sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasResponse.cs
rename to sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAliasResponse.cs
index 4c0baaeb7dd2..6dd6555313db 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/PutAliasResponse.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAliasResponse.cs
@@ -18,30 +18,32 @@ namespace Microsoft.Azure.Management.Subscription.Models
///
/// Subscription Information with the alias.
///
- public partial class PutAliasResponse : IResource
+ public partial class SubscriptionAliasResponse : IResource
{
///
- /// Initializes a new instance of the PutAliasResponse class.
+ /// Initializes a new instance of the SubscriptionAliasResponse class.
///
- public PutAliasResponse()
+ public SubscriptionAliasResponse()
{
CustomInit();
}
///
- /// Initializes a new instance of the PutAliasResponse class.
+ /// Initializes a new instance of the SubscriptionAliasResponse class.
///
/// Fully qualified ID for the alias resource.
/// Alias ID.
/// Resource type,
/// Microsoft.Subscription/aliases.
- /// Put Alias response properties.
- public PutAliasResponse(string id = default(string), string name = default(string), string type = default(string), PutAliasResponseProperties properties = default(PutAliasResponseProperties))
+ /// Subscription Alias response
+ /// properties.
+ public SubscriptionAliasResponse(string id = default(string), string name = default(string), string type = default(string), SubscriptionAliasResponseProperties properties = default(SubscriptionAliasResponseProperties), SystemData systemData = default(SystemData))
{
Id = id;
Name = name;
Type = type;
Properties = properties;
+ SystemData = systemData;
CustomInit();
}
@@ -69,10 +71,15 @@ public PutAliasResponse()
public string Type { get; private set; }
///
- /// Gets or sets put Alias response properties.
+ /// Gets or sets subscription Alias response properties.
///
[JsonProperty(PropertyName = "properties")]
- public PutAliasResponseProperties Properties { get; set; }
+ public SubscriptionAliasResponseProperties Properties { get; set; }
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "systemData")]
+ public SystemData SystemData { get; private set; }
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAliasResponseProperties.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAliasResponseProperties.cs
new file mode 100644
index 000000000000..fdb0d5f34348
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SubscriptionAliasResponseProperties.cs
@@ -0,0 +1,150 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Put subscription creation result properties.
+ ///
+ public partial class SubscriptionAliasResponseProperties
+ {
+ ///
+ /// Initializes a new instance of the
+ /// SubscriptionAliasResponseProperties class.
+ ///
+ public SubscriptionAliasResponseProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// SubscriptionAliasResponseProperties class.
+ ///
+ /// Newly created subscription Id.
+ /// The display name of the
+ /// subscription.
+ /// The provisioning state of the
+ /// resource. Possible values include: 'Accepted', 'Succeeded',
+ /// 'Failed'
+ /// Url to accept ownership of the
+ /// subscription.
+ /// Possible values include:
+ /// 'Pending', 'Completed', 'Expired'
+ /// Possible values include: 'Production',
+ /// 'DevTest'
+ /// Reseller Id
+ /// Owner Id of the
+ /// subscription
+ /// The Management Group Id.
+ /// Created Time
+ /// Tags for the subscription
+ public SubscriptionAliasResponseProperties(string subscriptionId = default(string), string displayName = default(string), string provisioningState = default(string), string acceptOwnershipUrl = default(string), string acceptOwnershipState = default(string), string billingScope = default(string), string workload = default(string), string resellerId = default(string), string subscriptionOwnerId = default(string), string managementGroupId = default(string), string createdTime = default(string), IDictionary tags = default(IDictionary))
+ {
+ SubscriptionId = subscriptionId;
+ DisplayName = displayName;
+ ProvisioningState = provisioningState;
+ AcceptOwnershipUrl = acceptOwnershipUrl;
+ AcceptOwnershipState = acceptOwnershipState;
+ BillingScope = billingScope;
+ Workload = workload;
+ ResellerId = resellerId;
+ SubscriptionOwnerId = subscriptionOwnerId;
+ ManagementGroupId = managementGroupId;
+ CreatedTime = createdTime;
+ Tags = tags;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets newly created subscription Id.
+ ///
+ [JsonProperty(PropertyName = "subscriptionId")]
+ public string SubscriptionId { get; private set; }
+
+ ///
+ /// Gets or sets the display name of the subscription.
+ ///
+ [JsonProperty(PropertyName = "displayName")]
+ public string DisplayName { get; set; }
+
+ ///
+ /// Gets or sets the provisioning state of the resource. Possible
+ /// values include: 'Accepted', 'Succeeded', 'Failed'
+ ///
+ [JsonProperty(PropertyName = "provisioningState")]
+ public string ProvisioningState { get; set; }
+
+ ///
+ /// Gets url to accept ownership of the subscription.
+ ///
+ [JsonProperty(PropertyName = "acceptOwnershipUrl")]
+ public string AcceptOwnershipUrl { get; private set; }
+
+ ///
+ /// Gets or sets possible values include: 'Pending', 'Completed',
+ /// 'Expired'
+ ///
+ [JsonProperty(PropertyName = "acceptOwnershipState")]
+ public string AcceptOwnershipState { get; set; }
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "billingScope")]
+ public string BillingScope { get; set; }
+
+ ///
+ /// Gets or sets possible values include: 'Production', 'DevTest'
+ ///
+ [JsonProperty(PropertyName = "workload")]
+ public string Workload { get; set; }
+
+ ///
+ /// Gets or sets reseller Id
+ ///
+ [JsonProperty(PropertyName = "resellerId")]
+ public string ResellerId { get; set; }
+
+ ///
+ /// Gets or sets owner Id of the subscription
+ ///
+ [JsonProperty(PropertyName = "subscriptionOwnerId")]
+ public string SubscriptionOwnerId { get; set; }
+
+ ///
+ /// Gets or sets the Management Group Id.
+ ///
+ [JsonProperty(PropertyName = "managementGroupId")]
+ public string ManagementGroupId { get; set; }
+
+ ///
+ /// Gets or sets created Time
+ ///
+ [JsonProperty(PropertyName = "createdTime")]
+ public string CreatedTime { get; set; }
+
+ ///
+ /// Gets or sets tags for the subscription
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SystemData.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SystemData.cs
new file mode 100644
index 000000000000..e97b7befd960
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/SystemData.cs
@@ -0,0 +1,103 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Metadata pertaining to creation and last modification of the resource.
+ ///
+ public partial class SystemData
+ {
+ ///
+ /// Initializes a new instance of the SystemData class.
+ ///
+ public SystemData()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the SystemData class.
+ ///
+ /// The identity that created the
+ /// resource.
+ /// The type of identity that created the
+ /// resource. Possible values include: 'User', 'Application',
+ /// 'ManagedIdentity', 'Key'
+ /// The timestamp of resource creation
+ /// (UTC).
+ /// The identity that last modified the
+ /// resource.
+ /// The type of identity that last
+ /// modified the resource. Possible values include: 'User',
+ /// 'Application', 'ManagedIdentity', 'Key'
+ /// The timestamp of resource last
+ /// modification (UTC)
+ public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?))
+ {
+ CreatedBy = createdBy;
+ CreatedByType = createdByType;
+ CreatedAt = createdAt;
+ LastModifiedBy = lastModifiedBy;
+ LastModifiedByType = lastModifiedByType;
+ LastModifiedAt = lastModifiedAt;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the identity that created the resource.
+ ///
+ [JsonProperty(PropertyName = "createdBy")]
+ public string CreatedBy { get; set; }
+
+ ///
+ /// Gets or sets the type of identity that created the resource.
+ /// Possible values include: 'User', 'Application', 'ManagedIdentity',
+ /// 'Key'
+ ///
+ [JsonProperty(PropertyName = "createdByType")]
+ public string CreatedByType { get; set; }
+
+ ///
+ /// Gets or sets the timestamp of resource creation (UTC).
+ ///
+ [JsonProperty(PropertyName = "createdAt")]
+ public System.DateTime? CreatedAt { get; set; }
+
+ ///
+ /// Gets or sets the identity that last modified the resource.
+ ///
+ [JsonProperty(PropertyName = "lastModifiedBy")]
+ public string LastModifiedBy { get; set; }
+
+ ///
+ /// Gets or sets the type of identity that last modified the resource.
+ /// Possible values include: 'User', 'Application', 'ManagedIdentity',
+ /// 'Key'
+ ///
+ [JsonProperty(PropertyName = "lastModifiedByType")]
+ public string LastModifiedByType { get; set; }
+
+ ///
+ /// Gets or sets the timestamp of resource last modification (UTC)
+ ///
+ [JsonProperty(PropertyName = "lastModifiedAt")]
+ public System.DateTime? LastModifiedAt { get; set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/TenantPolicy.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/TenantPolicy.cs
new file mode 100644
index 000000000000..3f555da833f8
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Models/TenantPolicy.cs
@@ -0,0 +1,84 @@
+//
+// 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.Subscription.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Tenant policy.
+ ///
+ public partial class TenantPolicy
+ {
+ ///
+ /// Initializes a new instance of the TenantPolicy class.
+ ///
+ public TenantPolicy()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the TenantPolicy class.
+ ///
+ /// Policy Id.
+ /// Blocks the leaving of
+ /// subscriptions from user's tenant.
+ /// Blocks the entering of
+ /// subscriptions into user's tenant.
+ /// List of user objectIds that are
+ /// exempted from the set subscription tenant policies for the user's
+ /// tenant.
+ public TenantPolicy(string policyId = default(string), bool? blockSubscriptionsLeavingTenant = default(bool?), bool? blockSubscriptionsIntoTenant = default(bool?), IList exemptedPrincipals = default(IList))
+ {
+ PolicyId = policyId;
+ BlockSubscriptionsLeavingTenant = blockSubscriptionsLeavingTenant;
+ BlockSubscriptionsIntoTenant = blockSubscriptionsIntoTenant;
+ ExemptedPrincipals = exemptedPrincipals;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets policy Id.
+ ///
+ [JsonProperty(PropertyName = "policyId")]
+ public string PolicyId { get; private set; }
+
+ ///
+ /// Gets or sets blocks the leaving of subscriptions from user's
+ /// tenant.
+ ///
+ [JsonProperty(PropertyName = "blockSubscriptionsLeavingTenant")]
+ public bool? BlockSubscriptionsLeavingTenant { get; set; }
+
+ ///
+ /// Gets or sets blocks the entering of subscriptions into user's
+ /// tenant.
+ ///
+ [JsonProperty(PropertyName = "blockSubscriptionsIntoTenant")]
+ public bool? BlockSubscriptionsIntoTenant { get; set; }
+
+ ///
+ /// Gets or sets list of user objectIds that are exempted from the set
+ /// subscription tenant policies for the user's tenant.
+ ///
+ [JsonProperty(PropertyName = "exemptedPrincipals")]
+ public IList ExemptedPrincipals { get; set; }
+
+ }
+}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Operations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Operations.cs
index 4bfea45641e4..57d42c3391a6 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Operations.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/Operations.cs
@@ -59,7 +59,7 @@ internal Operations(SubscriptionClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -68,9 +68,9 @@ internal Operations(SubscriptionClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- string apiVersion = "2020-09-01";
+ string apiVersion = "2021-10-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -150,11 +150,11 @@ internal Operations(SubscriptionClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseBodyException(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);
+ ErrorResponseBody _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
@@ -178,7 +178,7 @@ internal Operations(SubscriptionClient 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"))
@@ -191,7 +191,175 @@ internal Operations(SubscriptionClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _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;
+ }
+
+ ///
+ /// Lists all of the available Microsoft.Subscription API operations.
+ ///
+ ///
+ /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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 ErrorResponseBodyException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponseBody _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)
{
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/OperationsExtensions.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/OperationsExtensions.cs
index 32eafb86f429..5b1f6d71ec72 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/OperationsExtensions.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/OperationsExtensions.cs
@@ -27,7 +27,7 @@ public static partial class OperationsExtensions
///
/// The operations group for this extension method.
///
- public static OperationListResult List(this IOperations operations)
+ public static IPage List(this IOperations operations)
{
return operations.ListAsync().GetAwaiter().GetResult();
}
@@ -41,7 +41,7 @@ public static OperationListResult List(this IOperations operations)
///
/// The cancellation token.
///
- public static async Task ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
{
@@ -49,5 +49,39 @@ public static OperationListResult List(this IOperations operations)
}
}
+ ///
+ /// Lists all of the available Microsoft.Subscription API operations.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all of the available Microsoft.Subscription API operations.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SdkInfo_SubscriptionClient.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SdkInfo_SubscriptionClient.cs
index c5fa9c1d9f5a..5738238bfdc6 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SdkInfo_SubscriptionClient.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SdkInfo_SubscriptionClient.cs
@@ -19,24 +19,15 @@ public static IEnumerable> ApiInfo_SubscriptionCli
{
return new Tuple[]
{
- new Tuple("Subscription", "Alias", "2020-09-01"),
- new Tuple("Subscription", "Operations", "2020-09-01"),
- new Tuple("Subscription", "Subscription", "2020-09-01"),
+ new Tuple("Billing", "BillingAccount", "2021-10-01"),
+ new Tuple("Subscription", "Alias", "2021-10-01"),
+ new Tuple("Subscription", "Operations", "2021-10-01"),
+ new Tuple("Subscription", "Subscription", "2021-10-01"),
+ new Tuple("Subscription", "SubscriptionPolicy", "2021-10-01"),
new Tuple("SubscriptionClient", "Subscriptions", "2016-06-01"),
new Tuple("SubscriptionClient", "Tenants", "2016-06-01"),
}.AsEnumerable();
}
}
- // BEGIN: Code Generation Metadata Section
- public static readonly String AutoRestVersion = "v2";
- public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413";
- public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/subscription/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\github2\\sdk";
- public static readonly String GithubForkName = "Azure";
- public static readonly String GithubBranchName = "master";
- public static readonly String GithubCommidId = "a2f45d8b74aa5def295b86ffceecdeb27b8e1602";
- public static readonly String CodeGenerationErrors = "";
- public static readonly String GithubRepoName = "azure-rest-api-specs";
- // END: Code Generation Metadata Section
}
}
-
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionClient.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionClient.cs
index 9507c4496060..a636118c3ee2 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionClient.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionClient.cs
@@ -89,6 +89,16 @@ public partial class SubscriptionClient : ServiceClient, ISu
///
public virtual IAliasOperations Alias { get; private set; }
+ ///
+ /// Gets the ISubscriptionPolicyOperations.
+ ///
+ public virtual ISubscriptionPolicyOperations SubscriptionPolicy { get; private set; }
+
+ ///
+ /// Gets the IBillingAccountOperations.
+ ///
+ public virtual IBillingAccountOperations BillingAccount { get; private set; }
+
///
/// Initializes a new instance of the SubscriptionClient class.
///
@@ -335,6 +345,8 @@ private void Initialize()
Subscription = new SubscriptionOperations(this);
Operations = new Operations(this);
Alias = new AliasOperations(this);
+ SubscriptionPolicy = new SubscriptionPolicyOperations(this);
+ BillingAccount = new BillingAccountOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionOperations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionOperations.cs
index b597649f41b4..f92ea7165e95 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionOperations.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionOperations.cs
@@ -62,7 +62,7 @@ internal SubscriptionOperations(SubscriptionClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -83,7 +83,7 @@ internal SubscriptionOperations(SubscriptionClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId");
}
- string apiVersion = "2020-09-01";
+ string apiVersion = "2021-10-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -165,11 +165,11 @@ internal SubscriptionOperations(SubscriptionClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseBodyException(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);
+ ErrorResponseBody _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
@@ -240,7 +240,7 @@ internal SubscriptionOperations(SubscriptionClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -265,7 +265,7 @@ internal SubscriptionOperations(SubscriptionClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "body");
}
- string apiVersion = "2020-09-01";
+ string apiVersion = "2021-10-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -354,11 +354,11 @@ internal SubscriptionOperations(SubscriptionClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseBodyException(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);
+ ErrorResponseBody _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
@@ -426,7 +426,7 @@ internal SubscriptionOperations(SubscriptionClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -447,7 +447,7 @@ internal SubscriptionOperations(SubscriptionClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId");
}
- string apiVersion = "2020-09-01";
+ string apiVersion = "2021-10-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -529,11 +529,11 @@ internal SubscriptionOperations(SubscriptionClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseBodyException(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);
+ ErrorResponseBody _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
@@ -589,5 +589,385 @@ internal SubscriptionOperations(SubscriptionClient client)
return _result;
}
+ ///
+ /// Accept subscription ownership.
+ ///
+ ///
+ /// Subscription Id.
+ ///
+ ///
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> AcceptOwnershipWithHttpMessagesAsync(string subscriptionId, AcceptOwnershipRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationHeaderResponse _response = await BeginAcceptOwnershipWithHttpMessagesAsync(subscriptionId, body, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Accept subscription ownership status.
+ ///
+ ///
+ /// Subscription 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> AcceptOwnershipStatusWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (subscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId");
+ }
+ string apiVersion = "2021-10-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("subscriptionId", subscriptionId);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "AcceptOwnershipStatus", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnershipStatus").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorResponseBodyException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponseBody _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;
+ }
+
+ ///
+ /// Accept subscription ownership.
+ ///
+ ///
+ /// Subscription 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> BeginAcceptOwnershipWithHttpMessagesAsync(string subscriptionId, AcceptOwnershipRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (subscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId");
+ }
+ if (body == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "body");
+ }
+ if (body != null)
+ {
+ body.Validate();
+ }
+ string apiVersion = "2021-10-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("subscriptionId", subscriptionId);
+ tracingParameters.Add("body", body);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginAcceptOwnership", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnership").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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("POST");
+ _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(body != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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 != 202)
+ {
+ var ex = new ErrorResponseBodyException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponseBody _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 AzureOperationHeaderResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionOperationsExtensions.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionOperationsExtensions.cs
index 523995713542..28f43ea96558 100644
--- a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionOperationsExtensions.cs
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionOperationsExtensions.cs
@@ -129,5 +129,115 @@ public static EnabledSubscriptionId Enable(this ISubscriptionOperations operatio
}
}
+ ///
+ /// Accept subscription ownership.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription Id.
+ ///
+ ///
+ ///
+ public static SubscriptionAcceptOwnershipHeaders AcceptOwnership(this ISubscriptionOperations operations, string subscriptionId, AcceptOwnershipRequest body)
+ {
+ return operations.AcceptOwnershipAsync(subscriptionId, body).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Accept subscription ownership.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription Id.
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task AcceptOwnershipAsync(this ISubscriptionOperations operations, string subscriptionId, AcceptOwnershipRequest body, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.AcceptOwnershipWithHttpMessagesAsync(subscriptionId, body, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Headers;
+ }
+ }
+
+ ///
+ /// Accept subscription ownership status.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription Id.
+ ///
+ public static AcceptOwnershipStatusResponse AcceptOwnershipStatus(this ISubscriptionOperations operations, string subscriptionId)
+ {
+ return operations.AcceptOwnershipStatusAsync(subscriptionId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Accept subscription ownership status.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription Id.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task AcceptOwnershipStatusAsync(this ISubscriptionOperations operations, string subscriptionId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.AcceptOwnershipStatusWithHttpMessagesAsync(subscriptionId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Accept subscription ownership.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription Id.
+ ///
+ ///
+ ///
+ public static SubscriptionAcceptOwnershipHeaders BeginAcceptOwnership(this ISubscriptionOperations operations, string subscriptionId, AcceptOwnershipRequest body)
+ {
+ return operations.BeginAcceptOwnershipAsync(subscriptionId, body).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Accept subscription ownership.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription Id.
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginAcceptOwnershipAsync(this ISubscriptionOperations operations, string subscriptionId, AcceptOwnershipRequest body, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginAcceptOwnershipWithHttpMessagesAsync(subscriptionId, body, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Headers;
+ }
+ }
+
}
}
diff --git a/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionPolicyOperations.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionPolicyOperations.cs
new file mode 100644
index 000000000000..cfa5ebcb3da3
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionPolicyOperations.cs
@@ -0,0 +1,721 @@
+//
+// 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.Subscription
+{
+ 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;
+
+ ///
+ /// SubscriptionPolicyOperations operations.
+ ///
+ internal partial class SubscriptionPolicyOperations : IServiceOperations, ISubscriptionPolicyOperations
+ {
+ ///
+ /// Initializes a new instance of the SubscriptionPolicyOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal SubscriptionPolicyOperations(SubscriptionClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the SubscriptionClient
+ ///
+ public SubscriptionClient Client { get; private set; }
+
+ ///
+ /// Create or Update Subscription tenant policy for user's tenant.
+ ///
+ ///
+ ///
+ ///
+ /// 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> AddUpdatePolicyForTenantWithHttpMessagesAsync(PutTenantPolicyRequestProperties body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (body == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "body");
+ }
+ string apiVersion = "2021-10-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("body", body);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "AddUpdatePolicyForTenant", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Subscription/policies/default").ToString();
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(body != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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 ErrorResponseBodyException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponseBody _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;
+ }
+
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetPolicyForTenantWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ string apiVersion = "2021-10-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetPolicyForTenant", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Subscription/policies/default").ToString();
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorResponseBodyException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponseBody _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;
+ }
+
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListPolicyForTenantWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ string apiVersion = "2021-10-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListPolicyForTenant", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Subscription/policies").ToString();
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorResponseBodyException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponseBody _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;
+ }
+
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// 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>> ListPolicyForTenantNextWithHttpMessagesAsync(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, "ListPolicyForTenantNext", 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 ErrorResponseBodyException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponseBody _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/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionPolicyOperationsExtensions.cs b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionPolicyOperationsExtensions.cs
new file mode 100644
index 000000000000..9be431a3377e
--- /dev/null
+++ b/sdk/subscription/Microsoft.Azure.Management.Subscription/src/Generated/SubscriptionPolicyOperationsExtensions.cs
@@ -0,0 +1,147 @@
+//
+// 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.Subscription
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for SubscriptionPolicyOperations.
+ ///
+ public static partial class SubscriptionPolicyOperationsExtensions
+ {
+ ///
+ /// Create or Update Subscription tenant policy for user's tenant.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ public static GetTenantPolicyResponse AddUpdatePolicyForTenant(this ISubscriptionPolicyOperations operations, PutTenantPolicyRequestProperties body)
+ {
+ return operations.AddUpdatePolicyForTenantAsync(body).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or Update Subscription tenant policy for user's tenant.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task AddUpdatePolicyForTenantAsync(this ISubscriptionPolicyOperations operations, PutTenantPolicyRequestProperties body, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.AddUpdatePolicyForTenantWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static GetTenantPolicyResponse GetPolicyForTenant(this ISubscriptionPolicyOperations operations)
+ {
+ return operations.GetPolicyForTenantAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetPolicyForTenantAsync(this ISubscriptionPolicyOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetPolicyForTenantWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static IPage ListPolicyForTenant(this ISubscriptionPolicyOperations operations)
+ {
+ return operations.ListPolicyForTenantAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListPolicyForTenantAsync(this ISubscriptionPolicyOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListPolicyForTenantWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListPolicyForTenantNext(this ISubscriptionPolicyOperations operations, string nextPageLink)
+ {
+ return operations.ListPolicyForTenantNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get the subscription tenant policy for the user's tenant.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListPolicyForTenantNextAsync(this ISubscriptionPolicyOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListPolicyForTenantNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}