From a5c651245a8153840dd6148dfa1c5590fbe3ac57 Mon Sep 17 00:00:00 2001
From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com>
Date: Thu, 24 Oct 2019 03:08:10 +0000
Subject: [PATCH 1/7] Generated from d640fe31b954f734f0f238549ce076d3b667ddf7
(#391)
add test for peering
---
.../SdkInfo_PeeringManagementClient.cs | 36 +++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/SdkInfo_PeeringManagementClient.cs
diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/SdkInfo_PeeringManagementClient.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/SdkInfo_PeeringManagementClient.cs
new file mode 100644
index 0000000000000..ed84e77cd4fd0
--- /dev/null
+++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/SdkInfo_PeeringManagementClient.cs
@@ -0,0 +1,36 @@
+
+//
+// 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.Peering
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ internal static partial class SdkInfo
+ {
+ public static IEnumerable> ApiInfo_PeeringManagementClient
+ {
+ get
+ {
+ return new Tuple[]
+ {
+ new Tuple("Peering", "CheckServiceProviderAvailability", "2019-09-01-preview"),
+ new Tuple("Peering", "LegacyPeerings", "2019-09-01-preview"),
+ new Tuple("Peering", "Operations", "2019-09-01-preview"),
+ new Tuple("Peering", "PeerAsns", "2019-09-01-preview"),
+ new Tuple("Peering", "PeeringLocations", "2019-09-01-preview"),
+ new Tuple("Peering", "PeeringServiceLocations", "2019-09-01-preview"),
+ new Tuple("Peering", "PeeringServiceProviders", "2019-09-01-preview"),
+ new Tuple("Peering", "PeeringServices", "2019-09-01-preview"),
+ new Tuple("Peering", "Peerings", "2019-09-01-preview"),
+ new Tuple("Peering", "Prefixes", "2019-09-01-preview"),
+ }.AsEnumerable();
+ }
+ }
+ }
+}
From 4284b1c4705156121047c417764e35f349c17a1b Mon Sep 17 00:00:00 2001
From: Phoenix He
Date: Fri, 25 Oct 2019 08:48:49 +0800
Subject: [PATCH 2/7] Update swagger_to_sdk_config.json
---
swagger_to_sdk_config.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json
index 99979bf5d0950..b73c428c76dcc 100644
--- a/swagger_to_sdk_config.json
+++ b/swagger_to_sdk_config.json
@@ -6,7 +6,8 @@
"reflect-api-versions": "",
"license-header": "MICROSOFT_MIT_NO_VERSION",
"sdkrel:csharp-sdks-folder": "./sdk",
- "use": "@microsoft.azure/autorest.csharp"
+ "use": "@microsoft.azure/autorest.csharp",
+ "csharp.clear-output-folder": ""
},
"advanced_options": {
"create_sdk_pull_requests": true,
From 8b7d4d20284b17026b3d0c493d75c6f2ac41f6ad Mon Sep 17 00:00:00 2001
From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2019 00:48:30 +0000
Subject: [PATCH 3/7] [AutoPR Microsoft.Azure.Management.ContainerService] Aro
2019-09-30 preview API Version (#200)
* Update swagger_to_sdk_config.json
* Generated from aa9913e0d2ece26504f653d3b30d22a4a35a0b38
fixing typo and indentation
---
.../src/Generated/AgentPoolsOperations.cs | 456 +++++++++++++++++-
.../AgentPoolsOperationsExtensions.cs | 100 ++++
.../Generated/ContainerServicesOperations.cs | 2 +-
.../src/Generated/IAgentPoolsOperations.cs | 60 +++
.../Generated/ManagedClustersOperations.cs | 24 +-
.../src/Generated/Models/AgentPool.cs | 45 +-
.../Models/AgentPoolAvailableVersions.cs | 83 ++++
...VersionsPropertiesAgentPoolVersionsItem.cs | 70 +++
.../Models/AgentPoolUpgradeProfile.cs | 120 +++++
...oolUpgradeProfilePropertiesUpgradesItem.cs | 60 +++
.../Models/ContainerServiceNetworkProfile.cs | 15 +-
.../src/Generated/Models/ManagedCluster.cs | 15 +-
.../ManagedClusterAPIServerAccessProfile.cs | 66 +++
.../Models/ManagedClusterAgentPoolProfile.cs | 14 +-
...anagedClusterAgentPoolProfileProperties.cs | 45 +-
.../ManagedClusterLoadBalancerProfile.cs | 100 ++++
...erLoadBalancerProfileManagedOutboundIPs.cs | 75 +++
...erLoadBalancerProfileOutboundIPPrefixes.cs | 56 +++
...edClusterLoadBalancerProfileOutboundIPs.cs | 55 +++
.../src/Generated/Models/ResourceReference.cs | 51 ++
.../Models/ScaleSetEvictionPolicy.cs | 22 +
.../src/Generated/Models/ScaleSetPriority.cs | 22 +
.../src/Generated/Operations.cs | 2 +-
.../SdkInfo_ContainerServiceClient.cs | 8 +-
24 files changed, 1531 insertions(+), 35 deletions(-)
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs
create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.cs
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs
index 50bf7e4b6b92c..63687ae3488df 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs
@@ -120,7 +120,7 @@ internal AgentPoolsOperations(ContainerServiceClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$");
}
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -346,7 +346,7 @@ internal AgentPoolsOperations(ContainerServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName");
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -557,6 +557,454 @@ internal AgentPoolsOperations(ContainerServiceClient client)
return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
+ ///
+ /// Gets upgrade profile for an agent pool.
+ ///
+ ///
+ /// Gets the details of the upgrade profile for an agent pool with a specified
+ /// resource group and managed cluster name.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the managed cluster resource.
+ ///
+ ///
+ /// The name of the agent pool.
+ ///
+ ///
+ /// 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> GetUpgradeProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$");
+ }
+ }
+ if (agentPoolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName");
+ }
+ string apiVersion = "2019-08-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("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("resourceName", resourceName);
+ tracingParameters.Add("agentPoolName", agentPoolName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetUpgradeProfile", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName));
+ 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets a list of supported versions for the specified agent pool.
+ ///
+ ///
+ /// Gets a list of supported versions for the specified agent pool.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the managed cluster resource.
+ ///
+ ///
+ /// 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> GetAvailableAgentPoolVersionsWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$");
+ }
+ }
+ string apiVersion = "2019-08-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("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("resourceName", resourceName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetAvailableAgentPoolVersions", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
///
/// Creates or updates an agent pool.
///
@@ -644,7 +1092,7 @@ internal AgentPoolsOperations(ContainerServiceClient client)
{
parameters.Validate();
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -894,7 +1342,7 @@ internal AgentPoolsOperations(ContainerServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName");
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs
index 333bc9802a1ab..fac6394a3939e 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs
@@ -228,6 +228,106 @@ public static void Delete(this IAgentPoolsOperations operations, string resource
(await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
+ ///
+ /// Gets upgrade profile for an agent pool.
+ ///
+ ///
+ /// Gets the details of the upgrade profile for an agent pool with a specified
+ /// resource group and managed cluster name.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the managed cluster resource.
+ ///
+ ///
+ /// The name of the agent pool.
+ ///
+ public static AgentPoolUpgradeProfile GetUpgradeProfile(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName)
+ {
+ return operations.GetUpgradeProfileAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets upgrade profile for an agent pool.
+ ///
+ ///
+ /// Gets the details of the upgrade profile for an agent pool with a specified
+ /// resource group and managed cluster name.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the managed cluster resource.
+ ///
+ ///
+ /// The name of the agent pool.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetUpgradeProfileAsync(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetUpgradeProfileWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets a list of supported versions for the specified agent pool.
+ ///
+ ///
+ /// Gets a list of supported versions for the specified agent pool.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the managed cluster resource.
+ ///
+ public static AgentPoolAvailableVersions GetAvailableAgentPoolVersions(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName)
+ {
+ return operations.GetAvailableAgentPoolVersionsAsync(resourceGroupName, resourceName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets a list of supported versions for the specified agent pool.
+ ///
+ ///
+ /// Gets a list of supported versions for the specified agent pool.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the managed cluster resource.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAvailableAgentPoolVersionsAsync(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetAvailableAgentPoolVersionsWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Creates or updates an agent pool.
///
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs
index b8ec9621329db..564aab6846208 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs
@@ -735,7 +735,7 @@ internal ContainerServicesOperations(ContainerServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "location");
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs
index fe31c66be91b1..40bf792cb96bc 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs
@@ -148,6 +148,66 @@ public partial interface IAgentPoolsOperations
///
Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Gets upgrade profile for an agent pool.
+ ///
+ ///
+ /// Gets the details of the upgrade profile for an agent pool with a
+ /// specified resource group and managed cluster name.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the managed cluster resource.
+ ///
+ ///
+ /// The name of the agent pool.
+ ///
+ ///
+ /// 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> GetUpgradeProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a list of supported versions for the specified agent pool.
+ ///
+ ///
+ /// Gets a list of supported versions for the specified agent pool.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the managed cluster resource.
+ ///
+ ///
+ /// 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> GetAvailableAgentPoolVersionsWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Creates or updates an agent pool.
///
///
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs
index b42496c1c2412..f4c6fb41f8333 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs
@@ -84,7 +84,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -278,7 +278,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -496,7 +496,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$");
}
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -723,7 +723,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "roleName");
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -945,7 +945,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$");
}
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1165,7 +1165,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$");
}
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1385,7 +1385,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$");
}
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1756,7 +1756,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
{
parameters.Validate();
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2003,7 +2003,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$");
}
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
TagsObject parameters = new TagsObject();
if (tags != null)
{
@@ -2231,7 +2231,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$");
}
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2441,7 +2441,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
{
parameters.Validate();
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2658,7 +2658,7 @@ internal ManagedClustersOperations(ContainerServiceClient client)
{
parameters.Validate();
}
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs
index 62d800ddd453b..17ca5dc610718 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs
@@ -123,7 +123,17 @@ public AgentPool()
/// provisioning state, which only appears in the response.
/// (PREVIEW) Availability zones for
/// nodes. Must use VirtualMachineScaleSets AgentPoolType.
- public AgentPool(int count, string vmSize, string id = default(string), string name = default(string), string type = default(string), int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string agentPoolType = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList))
+ /// Enable public IP for nodes
+ /// ScaleSetPriority to be used to
+ /// specify virtual machine scale set priority. Default to regular.
+ /// Possible values include: 'Low', 'Regular'
+ /// ScaleSetEvictionPolicy to be
+ /// used to specify eviction policy for low priority virtual machine
+ /// scale set. Default to Delete. Possible values include: 'Delete',
+ /// 'Deallocate'
+ /// Taints added to new nodes during node pool
+ /// create and scale. For example, key=value:NoSchedule.
+ public AgentPool(int count, string vmSize, string id = default(string), string name = default(string), string type = default(string), int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string agentPoolType = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), IList nodeTaints = default(IList))
: base(id, name, type)
{
Count = count;
@@ -139,6 +149,10 @@ public AgentPool()
OrchestratorVersion = orchestratorVersion;
ProvisioningState = provisioningState;
AvailabilityZones = availabilityZones;
+ EnableNodePublicIP = enableNodePublicIP;
+ ScaleSetPriority = scaleSetPriority;
+ ScaleSetEvictionPolicy = scaleSetEvictionPolicy;
+ NodeTaints = nodeTaints;
CustomInit();
}
@@ -291,6 +305,35 @@ public AgentPool()
[JsonProperty(PropertyName = "properties.availabilityZones")]
public IList AvailabilityZones { get; set; }
+ ///
+ /// Gets or sets enable public IP for nodes
+ ///
+ [JsonProperty(PropertyName = "properties.enableNodePublicIP")]
+ public bool? EnableNodePublicIP { get; set; }
+
+ ///
+ /// Gets or sets scaleSetPriority to be used to specify virtual machine
+ /// scale set priority. Default to regular. Possible values include:
+ /// 'Low', 'Regular'
+ ///
+ [JsonProperty(PropertyName = "properties.scaleSetPriority")]
+ public string ScaleSetPriority { get; set; }
+
+ ///
+ /// Gets or sets scaleSetEvictionPolicy to be used to specify eviction
+ /// policy for low priority virtual machine scale set. Default to
+ /// Delete. Possible values include: 'Delete', 'Deallocate'
+ ///
+ [JsonProperty(PropertyName = "properties.scaleSetEvictionPolicy")]
+ public string ScaleSetEvictionPolicy { get; set; }
+
+ ///
+ /// Gets or sets taints added to new nodes during node pool create and
+ /// scale. For example, key=value:NoSchedule.
+ ///
+ [JsonProperty(PropertyName = "properties.nodeTaints")]
+ public IList NodeTaints { get; set; }
+
///
/// Validate the object.
///
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs
new file mode 100644
index 0000000000000..aef0635745932
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.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.ContainerService.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The list of available versions for an agent pool.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class AgentPoolAvailableVersions
+ {
+ ///
+ /// Initializes a new instance of the AgentPoolAvailableVersions class.
+ ///
+ public AgentPoolAvailableVersions()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the AgentPoolAvailableVersions class.
+ ///
+ /// Id of the agent pool available versions.
+ /// Name of the agent pool available
+ /// versions.
+ /// Type of the agent pool available
+ /// versions.
+ /// List of versions available for
+ /// agent pool.
+ public AgentPoolAvailableVersions(string id = default(string), string name = default(string), string type = default(string), IList agentPoolVersions = default(IList))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ AgentPoolVersions = agentPoolVersions;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets id of the agent pool available versions.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets name of the agent pool available versions.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets type of the agent pool available versions.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets or sets list of versions available for agent pool.
+ ///
+ [JsonProperty(PropertyName = "properties.agentPoolVersions")]
+ public IList AgentPoolVersions { get; set; }
+
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs
new file mode 100644
index 0000000000000..8642c1dbda4cc
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs
@@ -0,0 +1,70 @@
+//
+// 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.ContainerService.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ public partial class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem
+ {
+ ///
+ /// Initializes a new instance of the
+ /// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem class.
+ ///
+ public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem class.
+ ///
+ /// Whether this version is the default
+ /// agent pool version.
+ /// Kubernetes version (major, minor,
+ /// patch).
+ /// Whether Kubernetes version is currently in
+ /// preview.
+ public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(bool? defaultProperty = default(bool?), string kubernetesVersion = default(string), bool? isPreview = default(bool?))
+ {
+ DefaultProperty = defaultProperty;
+ KubernetesVersion = kubernetesVersion;
+ IsPreview = isPreview;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets whether this version is the default agent pool
+ /// version.
+ ///
+ [JsonProperty(PropertyName = "default")]
+ public bool? DefaultProperty { get; set; }
+
+ ///
+ /// Gets or sets kubernetes version (major, minor, patch).
+ ///
+ [JsonProperty(PropertyName = "kubernetesVersion")]
+ public string KubernetesVersion { get; set; }
+
+ ///
+ /// Gets or sets whether Kubernetes version is currently in preview.
+ ///
+ [JsonProperty(PropertyName = "isPreview")]
+ public bool? IsPreview { get; set; }
+
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs
new file mode 100644
index 0000000000000..7e876988de79c
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs
@@ -0,0 +1,120 @@
+//
+// 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.ContainerService.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The list of available upgrades for an agent pool.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class AgentPoolUpgradeProfile
+ {
+ ///
+ /// Initializes a new instance of the AgentPoolUpgradeProfile class.
+ ///
+ public AgentPoolUpgradeProfile()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the AgentPoolUpgradeProfile class.
+ ///
+ /// Kubernetes version (major, minor,
+ /// patch).
+ /// OsType to be used to specify os type. Choose
+ /// from Linux and Windows. Default to Linux. Possible values include:
+ /// 'Linux', 'Windows'
+ /// Id of the agent pool upgrade profile.
+ /// Name of the agent pool upgrade profile.
+ /// Type of the agent pool upgrade profile.
+ /// List of orchestrator types and versions
+ /// available for upgrade.
+ public AgentPoolUpgradeProfile(string kubernetesVersion, string osType, string id = default(string), string name = default(string), string type = default(string), IList upgrades = default(IList))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ KubernetesVersion = kubernetesVersion;
+ OsType = osType;
+ Upgrades = upgrades;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets id of the agent pool upgrade profile.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets name of the agent pool upgrade profile.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets type of the agent pool upgrade profile.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets or sets kubernetes version (major, minor, patch).
+ ///
+ [JsonProperty(PropertyName = "properties.kubernetesVersion")]
+ public string KubernetesVersion { get; set; }
+
+ ///
+ /// Gets or sets osType to be used to specify os type. Choose from
+ /// Linux and Windows. Default to Linux. Possible values include:
+ /// 'Linux', 'Windows'
+ ///
+ [JsonProperty(PropertyName = "properties.osType")]
+ public string OsType { get; set; }
+
+ ///
+ /// Gets or sets list of orchestrator types and versions available for
+ /// upgrade.
+ ///
+ [JsonProperty(PropertyName = "properties.upgrades")]
+ public IList Upgrades { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (KubernetesVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "KubernetesVersion");
+ }
+ if (OsType == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "OsType");
+ }
+ }
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs
new file mode 100644
index 0000000000000..e449e974e445a
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs
@@ -0,0 +1,60 @@
+//
+// 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.ContainerService.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem
+ {
+ ///
+ /// Initializes a new instance of the
+ /// AgentPoolUpgradeProfilePropertiesUpgradesItem class.
+ ///
+ public AgentPoolUpgradeProfilePropertiesUpgradesItem()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// AgentPoolUpgradeProfilePropertiesUpgradesItem class.
+ ///
+ /// Kubernetes version (major, minor,
+ /// patch).
+ /// Whether Kubernetes version is currently in
+ /// preview.
+ public AgentPoolUpgradeProfilePropertiesUpgradesItem(string kubernetesVersion = default(string), bool? isPreview = default(bool?))
+ {
+ KubernetesVersion = kubernetesVersion;
+ IsPreview = isPreview;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets kubernetes version (major, minor, patch).
+ ///
+ [JsonProperty(PropertyName = "kubernetesVersion")]
+ public string KubernetesVersion { get; set; }
+
+ ///
+ /// Gets or sets whether Kubernetes version is currently in preview.
+ ///
+ [JsonProperty(PropertyName = "isPreview")]
+ public bool? IsPreview { get; set; }
+
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs
index 311110d17c1a9..0d1e3604982bd 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs
@@ -51,7 +51,9 @@ public ContainerServiceNetworkProfile()
/// ranges or the Kubernetes service address range.
/// The load balancer sku for the managed
/// cluster. Possible values include: 'standard', 'basic'
- public ContainerServiceNetworkProfile(string networkPlugin = default(string), string networkPolicy = default(string), string podCidr = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string), string loadBalancerSku = default(string))
+ /// Profile of the cluster load
+ /// balancer.
+ public ContainerServiceNetworkProfile(string networkPlugin = default(string), string networkPolicy = default(string), string podCidr = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string), string loadBalancerSku = default(string), ManagedClusterLoadBalancerProfile loadBalancerProfile = default(ManagedClusterLoadBalancerProfile))
{
NetworkPlugin = networkPlugin;
NetworkPolicy = networkPolicy;
@@ -60,6 +62,7 @@ public ContainerServiceNetworkProfile()
DnsServiceIP = dnsServiceIP;
DockerBridgeCidr = dockerBridgeCidr;
LoadBalancerSku = loadBalancerSku;
+ LoadBalancerProfile = loadBalancerProfile;
CustomInit();
}
@@ -119,6 +122,12 @@ public ContainerServiceNetworkProfile()
[JsonProperty(PropertyName = "loadBalancerSku")]
public string LoadBalancerSku { get; set; }
+ ///
+ /// Gets or sets profile of the cluster load balancer.
+ ///
+ [JsonProperty(PropertyName = "loadBalancerProfile")]
+ public ManagedClusterLoadBalancerProfile LoadBalancerProfile { get; set; }
+
///
/// Validate the object.
///
@@ -155,6 +164,10 @@ public virtual void Validate()
throw new ValidationException(ValidationRules.Pattern, "DockerBridgeCidr", "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$");
}
}
+ if (LoadBalancerProfile != null)
+ {
+ LoadBalancerProfile.Validate();
+ }
}
}
}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs
index 7a4181186b426..7fa8fc43785a0 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs
@@ -69,11 +69,11 @@ public ManagedCluster()
/// configuration.
/// Profile of Azure Active Directory
/// configuration.
- /// (PREVIEW) Authorized IP
- /// Ranges to kubernetes API server.
+ /// Access profile for managed
+ /// cluster API server.
/// The identity of the managed cluster, if
/// configured.
- public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string dnsPrefix = default(string), string fqdn = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), IList apiServerAuthorizedIPRanges = default(IList), ManagedClusterIdentity identity = default(ManagedClusterIdentity))
+ public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string dnsPrefix = default(string), string fqdn = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), ManagedClusterAPIServerAccessProfile apiServerAccessProfile = default(ManagedClusterAPIServerAccessProfile), ManagedClusterIdentity identity = default(ManagedClusterIdentity))
: base(location, id, name, type, tags)
{
ProvisioningState = provisioningState;
@@ -91,7 +91,7 @@ public ManagedCluster()
EnablePodSecurityPolicy = enablePodSecurityPolicy;
NetworkProfile = networkProfile;
AadProfile = aadProfile;
- ApiServerAuthorizedIPRanges = apiServerAuthorizedIPRanges;
+ ApiServerAccessProfile = apiServerAccessProfile;
Identity = identity;
CustomInit();
}
@@ -201,11 +201,10 @@ public ManagedCluster()
public ManagedClusterAADProfile AadProfile { get; set; }
///
- /// Gets or sets (PREVIEW) Authorized IP Ranges to kubernetes API
- /// server.
+ /// Gets or sets access profile for managed cluster API server.
///
- [JsonProperty(PropertyName = "properties.apiServerAuthorizedIPRanges")]
- public IList ApiServerAuthorizedIPRanges { get; set; }
+ [JsonProperty(PropertyName = "properties.apiServerAccessProfile")]
+ public ManagedClusterAPIServerAccessProfile ApiServerAccessProfile { get; set; }
///
/// Gets or sets the identity of the managed cluster, if configured.
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs
new file mode 100644
index 0000000000000..a950f33365d19
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.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.ContainerService.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Access profile for managed cluster API server.
+ ///
+ public partial class ManagedClusterAPIServerAccessProfile
+ {
+ ///
+ /// Initializes a new instance of the
+ /// ManagedClusterAPIServerAccessProfile class.
+ ///
+ public ManagedClusterAPIServerAccessProfile()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// ManagedClusterAPIServerAccessProfile class.
+ ///
+ /// Authorized IP Ranges to kubernetes
+ /// API server.
+ /// Whether to create the cluster as
+ /// a private cluster or not.
+ public ManagedClusterAPIServerAccessProfile(IList authorizedIPRanges = default(IList), bool? enablePrivateCluster = default(bool?))
+ {
+ AuthorizedIPRanges = authorizedIPRanges;
+ EnablePrivateCluster = enablePrivateCluster;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets authorized IP Ranges to kubernetes API server.
+ ///
+ [JsonProperty(PropertyName = "authorizedIPRanges")]
+ public IList AuthorizedIPRanges { get; set; }
+
+ ///
+ /// Gets or sets whether to create the cluster as a private cluster or
+ /// not.
+ ///
+ [JsonProperty(PropertyName = "enablePrivateCluster")]
+ public bool? EnablePrivateCluster { get; set; }
+
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs
index 357545428fe3b..107edfb3be3dd 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs
@@ -120,8 +120,18 @@ public ManagedClusterAgentPoolProfile()
/// provisioning state, which only appears in the response.
/// (PREVIEW) Availability zones for
/// nodes. Must use VirtualMachineScaleSets AgentPoolType.
- public ManagedClusterAgentPoolProfile(int count, string vmSize, string name, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList))
- : base(count, vmSize, osDiskSizeGB, vnetSubnetID, maxPods, osType, maxCount, minCount, enableAutoScaling, type, orchestratorVersion, provisioningState, availabilityZones)
+ /// Enable public IP for nodes
+ /// ScaleSetPriority to be used to
+ /// specify virtual machine scale set priority. Default to regular.
+ /// Possible values include: 'Low', 'Regular'
+ /// ScaleSetEvictionPolicy to be
+ /// used to specify eviction policy for low priority virtual machine
+ /// scale set. Default to Delete. Possible values include: 'Delete',
+ /// 'Deallocate'
+ /// Taints added to new nodes during node pool
+ /// create and scale. For example, key=value:NoSchedule.
+ public ManagedClusterAgentPoolProfile(int count, string vmSize, string name, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), IList nodeTaints = default(IList))
+ : base(count, vmSize, osDiskSizeGB, vnetSubnetID, maxPods, osType, maxCount, minCount, enableAutoScaling, type, orchestratorVersion, provisioningState, availabilityZones, enableNodePublicIP, scaleSetPriority, scaleSetEvictionPolicy, nodeTaints)
{
Name = name;
CustomInit();
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs
index 6e86f0cc9df6c..a99b90999b088 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs
@@ -118,7 +118,17 @@ public ManagedClusterAgentPoolProfileProperties()
/// provisioning state, which only appears in the response.
/// (PREVIEW) Availability zones for
/// nodes. Must use VirtualMachineScaleSets AgentPoolType.
- public ManagedClusterAgentPoolProfileProperties(int count, string vmSize, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList))
+ /// Enable public IP for nodes
+ /// ScaleSetPriority to be used to
+ /// specify virtual machine scale set priority. Default to regular.
+ /// Possible values include: 'Low', 'Regular'
+ /// ScaleSetEvictionPolicy to be
+ /// used to specify eviction policy for low priority virtual machine
+ /// scale set. Default to Delete. Possible values include: 'Delete',
+ /// 'Deallocate'
+ /// Taints added to new nodes during node pool
+ /// create and scale. For example, key=value:NoSchedule.
+ public ManagedClusterAgentPoolProfileProperties(int count, string vmSize, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), IList nodeTaints = default(IList))
{
Count = count;
VmSize = vmSize;
@@ -133,6 +143,10 @@ public ManagedClusterAgentPoolProfileProperties()
OrchestratorVersion = orchestratorVersion;
ProvisioningState = provisioningState;
AvailabilityZones = availabilityZones;
+ EnableNodePublicIP = enableNodePublicIP;
+ ScaleSetPriority = scaleSetPriority;
+ ScaleSetEvictionPolicy = scaleSetEvictionPolicy;
+ NodeTaints = nodeTaints;
CustomInit();
}
@@ -285,6 +299,35 @@ public ManagedClusterAgentPoolProfileProperties()
[JsonProperty(PropertyName = "availabilityZones")]
public IList AvailabilityZones { get; set; }
+ ///
+ /// Gets or sets enable public IP for nodes
+ ///
+ [JsonProperty(PropertyName = "enableNodePublicIP")]
+ public bool? EnableNodePublicIP { get; set; }
+
+ ///
+ /// Gets or sets scaleSetPriority to be used to specify virtual machine
+ /// scale set priority. Default to regular. Possible values include:
+ /// 'Low', 'Regular'
+ ///
+ [JsonProperty(PropertyName = "scaleSetPriority")]
+ public string ScaleSetPriority { get; set; }
+
+ ///
+ /// Gets or sets scaleSetEvictionPolicy to be used to specify eviction
+ /// policy for low priority virtual machine scale set. Default to
+ /// Delete. Possible values include: 'Delete', 'Deallocate'
+ ///
+ [JsonProperty(PropertyName = "scaleSetEvictionPolicy")]
+ public string ScaleSetEvictionPolicy { get; set; }
+
+ ///
+ /// Gets or sets taints added to new nodes during node pool create and
+ /// scale. For example, key=value:NoSchedule.
+ ///
+ [JsonProperty(PropertyName = "nodeTaints")]
+ public IList NodeTaints { get; set; }
+
///
/// Validate the object.
///
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs
new file mode 100644
index 0000000000000..2c9728a8cd0d9
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs
@@ -0,0 +1,100 @@
+//
+// 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.ContainerService.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Profile of the managed cluster load balancer
+ ///
+ public partial class ManagedClusterLoadBalancerProfile
+ {
+ ///
+ /// Initializes a new instance of the ManagedClusterLoadBalancerProfile
+ /// class.
+ ///
+ public ManagedClusterLoadBalancerProfile()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ManagedClusterLoadBalancerProfile
+ /// class.
+ ///
+ /// Desired managed outbound IPs for
+ /// the cluster load balancer.
+ /// Desired outbound IP Prefix
+ /// resources for the cluster load balancer.
+ /// Desired outbound IP resources for the
+ /// cluster load balancer.
+ /// The effective outbound IP
+ /// resources of the cluster load balancer.
+ public ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs = default(ManagedClusterLoadBalancerProfileManagedOutboundIPs), ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes = default(ManagedClusterLoadBalancerProfileOutboundIPPrefixes), ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs = default(ManagedClusterLoadBalancerProfileOutboundIPs), IList effectiveOutboundIPs = default(IList))
+ {
+ ManagedOutboundIPs = managedOutboundIPs;
+ OutboundIPPrefixes = outboundIPPrefixes;
+ OutboundIPs = outboundIPs;
+ EffectiveOutboundIPs = effectiveOutboundIPs;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets desired managed outbound IPs for the cluster load
+ /// balancer.
+ ///
+ [JsonProperty(PropertyName = "managedOutboundIPs")]
+ public ManagedClusterLoadBalancerProfileManagedOutboundIPs ManagedOutboundIPs { get; set; }
+
+ ///
+ /// Gets or sets desired outbound IP Prefix resources for the cluster
+ /// load balancer.
+ ///
+ [JsonProperty(PropertyName = "outboundIPPrefixes")]
+ public ManagedClusterLoadBalancerProfileOutboundIPPrefixes OutboundIPPrefixes { get; set; }
+
+ ///
+ /// Gets or sets desired outbound IP resources for the cluster load
+ /// balancer.
+ ///
+ [JsonProperty(PropertyName = "outboundIPs")]
+ public ManagedClusterLoadBalancerProfileOutboundIPs OutboundIPs { get; set; }
+
+ ///
+ /// Gets or sets the effective outbound IP resources of the cluster
+ /// load balancer.
+ ///
+ [JsonProperty(PropertyName = "effectiveOutboundIPs")]
+ public IList EffectiveOutboundIPs { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (ManagedOutboundIPs != null)
+ {
+ ManagedOutboundIPs.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs
new file mode 100644
index 0000000000000..d72f7f793e37c
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs
@@ -0,0 +1,75 @@
+//
+// 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.ContainerService.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Desired managed outbound IPs for the cluster load balancer.
+ ///
+ public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs
+ {
+ ///
+ /// Initializes a new instance of the
+ /// ManagedClusterLoadBalancerProfileManagedOutboundIPs class.
+ ///
+ public ManagedClusterLoadBalancerProfileManagedOutboundIPs()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// ManagedClusterLoadBalancerProfileManagedOutboundIPs class.
+ ///
+ /// Desired number of outbound IP created/managed
+ /// by Azure for the cluster load balancer. Allowed values must be in
+ /// the range of 1 to 100 (inclusive). The default value is 1.
+ public ManagedClusterLoadBalancerProfileManagedOutboundIPs(int? count = default(int?))
+ {
+ Count = count;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets desired number of outbound IP created/managed by Azure
+ /// for the cluster load balancer. Allowed values must be in the range
+ /// of 1 to 100 (inclusive). The default value is 1.
+ ///
+ [JsonProperty(PropertyName = "count")]
+ public int? Count { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Count > 100)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMaximum, "Count", 100);
+ }
+ if (Count < 1)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "Count", 1);
+ }
+ }
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs
new file mode 100644
index 0000000000000..e4220de6974b6
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs
@@ -0,0 +1,56 @@
+//
+// 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.ContainerService.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Desired outbound IP Prefix resources for the cluster load balancer.
+ ///
+ public partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes
+ {
+ ///
+ /// Initializes a new instance of the
+ /// ManagedClusterLoadBalancerProfileOutboundIPPrefixes class.
+ ///
+ public ManagedClusterLoadBalancerProfileOutboundIPPrefixes()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// ManagedClusterLoadBalancerProfileOutboundIPPrefixes class.
+ ///
+ /// A list of public IP prefix
+ /// resources.
+ public ManagedClusterLoadBalancerProfileOutboundIPPrefixes(IList publicIPPrefixes = default(IList))
+ {
+ PublicIPPrefixes = publicIPPrefixes;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets a list of public IP prefix resources.
+ ///
+ [JsonProperty(PropertyName = "publicIPPrefixes")]
+ public IList PublicIPPrefixes { get; set; }
+
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs
new file mode 100644
index 0000000000000..8c6863afa7cbf
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs
@@ -0,0 +1,55 @@
+//
+// 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.ContainerService.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Desired outbound IP resources for the cluster load balancer.
+ ///
+ public partial class ManagedClusterLoadBalancerProfileOutboundIPs
+ {
+ ///
+ /// Initializes a new instance of the
+ /// ManagedClusterLoadBalancerProfileOutboundIPs class.
+ ///
+ public ManagedClusterLoadBalancerProfileOutboundIPs()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// ManagedClusterLoadBalancerProfileOutboundIPs class.
+ ///
+ /// A list of public IP resources.
+ public ManagedClusterLoadBalancerProfileOutboundIPs(IList publicIPs = default(IList))
+ {
+ PublicIPs = publicIPs;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets a list of public IP resources.
+ ///
+ [JsonProperty(PropertyName = "publicIPs")]
+ public IList PublicIPs { get; set; }
+
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.cs
new file mode 100644
index 0000000000000..d272c94add12b
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.cs
@@ -0,0 +1,51 @@
+//
+// 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.ContainerService.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// A reference to an Azure resource.
+ ///
+ public partial class ResourceReference
+ {
+ ///
+ /// Initializes a new instance of the ResourceReference class.
+ ///
+ public ResourceReference()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ResourceReference class.
+ ///
+ /// The fully qualified Azure resource id.
+ public ResourceReference(string id = default(string))
+ {
+ Id = id;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the fully qualified Azure resource id.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs
new file mode 100644
index 0000000000000..25bd3db49c442
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs
@@ -0,0 +1,22 @@
+//
+// 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.ContainerService.Models
+{
+
+ ///
+ /// Defines values for ScaleSetEvictionPolicy.
+ ///
+ public static class ScaleSetEvictionPolicy
+ {
+ public const string Delete = "Delete";
+ public const string Deallocate = "Deallocate";
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.cs
new file mode 100644
index 0000000000000..5edcae14e830e
--- /dev/null
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.cs
@@ -0,0 +1,22 @@
+//
+// 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.ContainerService.Models
+{
+
+ ///
+ /// Defines values for ScaleSetPriority.
+ ///
+ public static class ScaleSetPriority
+ {
+ public const string Low = "Low";
+ public const string Regular = "Regular";
+ }
+}
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs
index ec90823197fa8..33c25ec737fe6 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs
@@ -70,7 +70,7 @@ internal Operations(ContainerServiceClient client)
///
public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- string apiVersion = "2019-04-01";
+ string apiVersion = "2019-08-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs
index e35757d720208..2330060e78a72 100644
--- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs
+++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs
@@ -19,12 +19,12 @@ public static IEnumerable> ApiInfo_ContainerServic
{
return new Tuple[]
{
- new Tuple("ContainerService", "AgentPools", "2019-04-01"),
+ new Tuple("ContainerService", "AgentPools", "2019-08-01"),
new Tuple("ContainerService", "ContainerServices", "2017-07-01"),
- new Tuple("ContainerService", "ContainerServices", "2019-04-01"),
- new Tuple("ContainerService", "ManagedClusters", "2019-04-01"),
+ new Tuple("ContainerService", "ContainerServices", "2019-08-01"),
+ new Tuple("ContainerService", "ManagedClusters", "2019-08-01"),
new Tuple("ContainerService", "OpenShiftManagedClusters", "2019-04-30"),
- new Tuple("ContainerService", "Operations", "2019-04-01"),
+ new Tuple("ContainerService", "Operations", "2019-08-01"),
}.AsEnumerable();
}
}
From e6099e72a66e0a0ddb7170bf7038889e2fdbceb2 Mon Sep 17 00:00:00 2001
From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com>
Date: Tue, 8 Oct 2019 03:10:48 +0000
Subject: [PATCH 4/7] [AutoPR Microsoft.Azure.Management.CostManagement]
Supporting Management Group scope for Exports (#94)
* Update swagger_to_sdk_config.json
* Update swagger_to_sdk_config.json
* Update swagger_to_sdk_config.json
* Update swagger_to_sdk_config.json
* Generated from 967f9659d62a831649ef83f6a52cf2e35dbb87bd
Fixed model validation
---
.../src/Generated/BudgetOperations.cs | 673 ++++++
.../Generated/BudgetOperationsExtensions.cs | 248 +++
.../src/Generated/BudgetsOperations.cs | 416 ++++
.../Generated/BudgetsOperationsExtensions.cs | 127 ++
.../src/Generated/CostManagementClient.cs | 376 ++++
.../src/Generated/IBudgetOperations.cs | 153 ++
.../src/Generated/IBudgetsOperations.cs | 88 +
.../src/Generated/ICostManagementClient.cs | 93 +
.../src/Generated/IOperations.cs | 68 +
.../src/Generated/IViewsOperations.cs | 345 +++
.../src/Generated/Models/AccumulatedType.cs | 22 +
.../src/Generated/Models/BudgetModel.cs | 172 ++
.../src/Generated/Models/BudgetTimePeriod.cs | 71 +
.../src/Generated/Models/CategoryType.cs | 22 +
.../src/Generated/Models/ChartType.cs | 25 +
.../src/Generated/Models/CurrentSpend.cs | 61 +
.../src/Generated/Models/ErrorBase.cs | 69 +
.../src/Generated/Models/ErrorDetails.cs | 79 +
.../src/Generated/Models/ErrorResponse.cs | 52 +
.../Models/ErrorResponseException.cs | 62 +
.../src/Generated/Models/GranularityType.cs | 22 +
.../src/Generated/Models/KpiProperties.cs | 69 +
.../src/Generated/Models/KpiTypeType.cs | 22 +
.../src/Generated/Models/MetricType.cs | 23 +
.../src/Generated/Models/Notification.cs | 147 ++
.../Models/NotificationOperatorType.cs | 23 +
.../src/Generated/Models/Operation.cs | 61 +
.../src/Generated/Models/OperationDisplay.cs | 71 +
.../src/Generated/Models/OperatorType.cs | 22 +
.../src/Generated/Models/Page.cs | 53 +
.../src/Generated/Models/PivotProperties.cs | 61 +
.../src/Generated/Models/PivotTypeType.cs | 22 +
.../src/Generated/Models/ProxyResource.cs | 81 +
.../Models/ReportConfigAggregation.cs | 78 +
.../Models/ReportConfigColumnType.cs | 22 +
.../ReportConfigComparisonExpression.cs | 103 +
.../Generated/Models/ReportConfigDataset.cs | 156 ++
.../ReportConfigDatasetConfiguration.cs | 59 +
.../Generated/Models/ReportConfigFilter.cs | 140 ++
.../Generated/Models/ReportConfigGrouping.cs | 81 +
.../Generated/Models/ReportConfigSorting.cs | 75 +
.../Models/ReportConfigTimePeriod.cs | 70 +
.../src/Generated/Models/Resource.cs | 79 +
.../src/Generated/Models/Scope.cs | 73 +
.../src/Generated/Models/TimeGrainType.cs | 23 +
.../src/Generated/Models/TimeframeType.cs | 24 +
.../src/Generated/Models/View.cs | 245 +++
.../src/Generated/Operations.cs | 390 ++++
.../src/Generated/OperationsExtensions.cs | 87 +
.../Generated/SdkInfo_CostManagementClient.cs | 30 +
.../src/Generated/ViewsOperations.cs | 1944 +++++++++++++++++
.../Generated/ViewsOperationsExtensions.cs | 563 +++++
52 files changed, 8141 insertions(+)
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetOperations.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetOperationsExtensions.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetsOperations.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetsOperationsExtensions.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/CostManagementClient.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IBudgetOperations.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IBudgetsOperations.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/ICostManagementClient.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IOperations.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IViewsOperations.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/AccumulatedType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/BudgetModel.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/BudgetTimePeriod.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/CategoryType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ChartType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/CurrentSpend.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorBase.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorDetails.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorResponse.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorResponseException.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/GranularityType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/KpiProperties.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/KpiTypeType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/MetricType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Notification.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/NotificationOperatorType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Operation.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/OperationDisplay.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/OperatorType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Page.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/PivotProperties.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/PivotTypeType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ProxyResource.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigAggregation.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigColumnType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigComparisonExpression.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigDataset.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigDatasetConfiguration.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigFilter.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigGrouping.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigSorting.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigTimePeriod.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Resource.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Scope.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/TimeGrainType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/TimeframeType.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/View.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Operations.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/OperationsExtensions.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/SdkInfo_CostManagementClient.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/ViewsOperations.cs
create mode 100644 sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/ViewsOperationsExtensions.cs
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetOperations.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetOperations.cs
new file mode 100644
index 0000000000000..1488b669385c6
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetOperations.cs
@@ -0,0 +1,673 @@
+//
+// 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.CostManagement
+{
+ 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;
+
+ ///
+ /// BudgetOperations operations.
+ ///
+ internal partial class BudgetOperations : IServiceOperations, IBudgetOperations
+ {
+ ///
+ /// Initializes a new instance of the BudgetOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal BudgetOperations(CostManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CostManagementClient
+ ///
+ public CostManagementClient Client { get; private set; }
+
+ ///
+ /// Gets the budget for the scope by budget name.
+ ///
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string scope, string budgetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (scope == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "scope");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (budgetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "budgetName");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("scope", scope);
+ tracingParameters.Add("budgetName", budgetName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}").ToString();
+ _url = _url.Replace("{scope}", scope);
+ _url = _url.Replace("{budgetName}", System.Uri.EscapeDataString(budgetName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// The operation to create or update a budget. Update operation requires
+ /// latest eTag to be set in the request mandatorily. You may obtain the latest
+ /// eTag by performing a get operation. Create operation does not require eTag.
+ ///
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// Parameters supplied to the Create Budget 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> CreateOrUpdateWithHttpMessagesAsync(string scope, string budgetName, BudgetModel parameters = default(BudgetModel), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (scope == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "scope");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (budgetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "budgetName");
+ }
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("scope", scope);
+ tracingParameters.Add("budgetName", budgetName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}").ToString();
+ _url = _url.Replace("{scope}", scope);
+ _url = _url.Replace("{budgetName}", System.Uri.EscapeDataString(budgetName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 && (int)_statusCode != 201)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _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;
+ }
+
+ ///
+ /// The operation to delete a budget.
+ ///
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string scope, string budgetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (scope == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "scope");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (budgetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "budgetName");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("scope", scope);
+ tracingParameters.Add("budgetName", budgetName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}").ToString();
+ _url = _url.Replace("{scope}", scope);
+ _url = _url.Replace("{budgetName}", System.Uri.EscapeDataString(budgetName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetOperationsExtensions.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetOperationsExtensions.cs
new file mode 100644
index 0000000000000..5919a270dc00f
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetOperationsExtensions.cs
@@ -0,0 +1,248 @@
+//
+// 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.CostManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for BudgetOperations.
+ ///
+ public static partial class BudgetOperationsExtensions
+ {
+ ///
+ /// Gets the budget for the scope by budget name.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ public static BudgetModel Get(this IBudgetOperations operations, string scope, string budgetName)
+ {
+ return operations.GetAsync(scope, budgetName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets the budget for the scope by budget name.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IBudgetOperations operations, string scope, string budgetName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(scope, budgetName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// The operation to create or update a budget. Update operation requires
+ /// latest eTag to be set in the request mandatorily. You may obtain the latest
+ /// eTag by performing a get operation. Create operation does not require eTag.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// Parameters supplied to the Create Budget operation.
+ ///
+ public static BudgetModel CreateOrUpdate(this IBudgetOperations operations, string scope, string budgetName, BudgetModel parameters = default(BudgetModel))
+ {
+ return operations.CreateOrUpdateAsync(scope, budgetName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// The operation to create or update a budget. Update operation requires
+ /// latest eTag to be set in the request mandatorily. You may obtain the latest
+ /// eTag by performing a get operation. Create operation does not require eTag.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// Parameters supplied to the Create Budget operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IBudgetOperations operations, string scope, string budgetName, BudgetModel parameters = default(BudgetModel), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, budgetName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// The operation to delete a budget.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ public static void Delete(this IBudgetOperations operations, string scope, string budgetName)
+ {
+ operations.DeleteAsync(scope, budgetName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// The operation to delete a budget.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IBudgetOperations operations, string scope, string budgetName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(scope, budgetName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetsOperations.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetsOperations.cs
new file mode 100644
index 0000000000000..740ee449c11c6
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetsOperations.cs
@@ -0,0 +1,416 @@
+//
+// 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.CostManagement
+{
+ 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;
+
+ ///
+ /// BudgetsOperations operations.
+ ///
+ internal partial class BudgetsOperations : IServiceOperations, IBudgetsOperations
+ {
+ ///
+ /// Initializes a new instance of the BudgetsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal BudgetsOperations(CostManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CostManagementClient
+ ///
+ public CostManagementClient Client { get; private set; }
+
+ ///
+ /// Lists all budgets for the defined scope.
+ ///
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (scope == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "scope");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("scope", scope);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.CostManagement/budgets").ToString();
+ _url = _url.Replace("{scope}", scope);
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists all budgets for the defined scope.
+ ///
+ ///
+ ///
+ /// 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetsOperationsExtensions.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetsOperationsExtensions.cs
new file mode 100644
index 0000000000000..49ef9a5957878
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/BudgetsOperationsExtensions.cs
@@ -0,0 +1,127 @@
+//
+// 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.CostManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for BudgetsOperations.
+ ///
+ public static partial class BudgetsOperationsExtensions
+ {
+ ///
+ /// Lists all budgets for the defined scope.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ public static IPage List(this IBudgetsOperations operations, string scope)
+ {
+ return operations.ListAsync(scope).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all budgets for the defined scope.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
+ /// resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
+ /// Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
+ /// Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IBudgetsOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists all budgets for the defined scope.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IBudgetsOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all budgets for the defined scope.
+ ///
+ ///
+ ///
+ /// 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 IBudgetsOperations 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/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/CostManagementClient.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/CostManagementClient.cs
new file mode 100644
index 0000000000000..8ff8db2530de4
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/CostManagementClient.cs
@@ -0,0 +1,376 @@
+//
+// 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.CostManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Microsoft.Rest.Serialization;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+
+ public partial class CostManagementClient : ServiceClient, ICostManagementClient, IAzureClient
+ {
+ ///
+ /// The base URI of the service.
+ ///
+ public System.Uri BaseUri { get; set; }
+
+ ///
+ /// Gets or sets json serialization settings.
+ ///
+ public JsonSerializerSettings SerializationSettings { get; private set; }
+
+ ///
+ /// Gets or sets json deserialization settings.
+ ///
+ public JsonSerializerSettings DeserializationSettings { get; private set; }
+
+ ///
+ /// Credentials needed for the client to connect to Azure.
+ ///
+ public ServiceClientCredentials Credentials { get; private set; }
+
+ ///
+ /// Version of the API to be used with the client request. The current version
+ /// is 2019-04-01-preview
+ ///
+ public string ApiVersion { get; private set; }
+
+ ///
+ /// Azure Subscription ID.
+ ///
+ public string SubscriptionId { get; set; }
+
+ ///
+ /// The preferred language for the response.
+ ///
+ public string AcceptLanguage { get; set; }
+
+ ///
+ /// The retry timeout in seconds for Long Running Operations. Default value is
+ /// 30.
+ ///
+ public int? LongRunningOperationRetryTimeout { get; set; }
+
+ ///
+ /// Whether a unique x-ms-client-request-id should be generated. When set to
+ /// true a unique x-ms-client-request-id value is generated and included in
+ /// each request. Default is true.
+ ///
+ public bool? GenerateClientRequestId { get; set; }
+
+ ///
+ /// Gets the IViewsOperations.
+ ///
+ public virtual IViewsOperations Views { get; private set; }
+
+ ///
+ /// Gets the IBudgetsOperations.
+ ///
+ public virtual IBudgetsOperations Budgets { get; private set; }
+
+ ///
+ /// Gets the IBudgetOperations.
+ ///
+ public virtual IBudgetOperations Budget { get; private set; }
+
+ ///
+ /// Gets the IOperations.
+ ///
+ public virtual IOperations Operations { get; private set; }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling CostManagementClient.Dispose(). False: will not dispose provided httpClient
+ protected CostManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ protected CostManagementClient(params DelegatingHandler[] handlers) : base(handlers)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ protected CostManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ protected CostManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ BaseUri = baseUri;
+ }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ protected CostManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ BaseUri = baseUri;
+ }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public CostManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling CostManagementClient.Dispose(). False: will not dispose provided httpClient
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public CostManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public CostManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public CostManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ BaseUri = baseUri;
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the CostManagementClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public CostManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ BaseUri = baseUri;
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
+ ///
+ /// Initializes client properties.
+ ///
+ private void Initialize()
+ {
+ Views = new ViewsOperations(this);
+ Budgets = new BudgetsOperations(this);
+ Budget = new BudgetOperations(this);
+ Operations = new Operations(this);
+ BaseUri = new System.Uri("https://management.azure.com");
+ ApiVersion = "2019-04-01-preview";
+ AcceptLanguage = "en-US";
+ LongRunningOperationRetryTimeout = 30;
+ GenerateClientRequestId = true;
+ SerializationSettings = new JsonSerializerSettings
+ {
+ Formatting = Newtonsoft.Json.Formatting.Indented,
+ DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
+ DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
+ NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
+ ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
+ ContractResolver = new ReadOnlyJsonContractResolver(),
+ Converters = new List
+ {
+ new Iso8601TimeSpanConverter()
+ }
+ };
+ SerializationSettings.Converters.Add(new TransformationJsonConverter());
+ DeserializationSettings = new JsonSerializerSettings
+ {
+ DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
+ DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
+ NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
+ ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
+ ContractResolver = new ReadOnlyJsonContractResolver(),
+ Converters = new List
+ {
+ new Iso8601TimeSpanConverter()
+ }
+ };
+ CustomInitialize();
+ DeserializationSettings.Converters.Add(new TransformationJsonConverter());
+ DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IBudgetOperations.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IBudgetOperations.cs
new file mode 100644
index 0000000000000..743b05022b2e1
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IBudgetOperations.cs
@@ -0,0 +1,153 @@
+//
+// 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.CostManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// BudgetOperations operations.
+ ///
+ public partial interface IBudgetOperations
+ {
+ ///
+ /// Gets the budget for the scope by budget name.
+ ///
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string scope, string budgetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// The operation to create or update a budget. Update operation
+ /// requires latest eTag to be set in the request mandatorily. You may
+ /// obtain the latest eTag by performing a get operation. Create
+ /// operation does not require eTag.
+ ///
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// Parameters supplied to the Create Budget 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> CreateOrUpdateWithHttpMessagesAsync(string scope, string budgetName, BudgetModel parameters = default(BudgetModel), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// The operation to delete a budget.
+ ///
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// Budget Name.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string scope, string budgetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IBudgetsOperations.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IBudgetsOperations.cs
new file mode 100644
index 0000000000000..099bc55478496
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IBudgetsOperations.cs
@@ -0,0 +1,88 @@
+//
+// 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.CostManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// BudgetsOperations operations.
+ ///
+ public partial interface IBudgetsOperations
+ {
+ ///
+ /// Lists all budgets for the defined scope.
+ ///
+ ///
+ ///
+ /// The scope associated with budget operations. This includes
+ /// '/subscriptions/{subscriptionId}/' for subscription scope,
+ /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for billingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for invoiceSection scope.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all budgets for the defined scope.
+ ///
+ ///
+ ///
+ /// 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/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/ICostManagementClient.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/ICostManagementClient.cs
new file mode 100644
index 0000000000000..40487d0d70602
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/ICostManagementClient.cs
@@ -0,0 +1,93 @@
+//
+// 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.CostManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+
+ ///
+ ///
+ public partial interface ICostManagementClient : System.IDisposable
+ {
+ ///
+ /// The base URI of the service.
+ ///
+ System.Uri BaseUri { get; set; }
+
+ ///
+ /// Gets or sets json serialization settings.
+ ///
+ JsonSerializerSettings SerializationSettings { get; }
+
+ ///
+ /// Gets or sets json deserialization settings.
+ ///
+ JsonSerializerSettings DeserializationSettings { get; }
+
+ ///
+ /// Credentials needed for the client to connect to Azure.
+ ///
+ ServiceClientCredentials Credentials { get; }
+
+ ///
+ /// Version of the API to be used with the client request. The current
+ /// version is 2019-04-01-preview
+ ///
+ string ApiVersion { get; }
+
+ ///
+ /// Azure Subscription ID.
+ ///
+ string SubscriptionId { get; set; }
+
+ ///
+ /// The preferred language for the response.
+ ///
+ string AcceptLanguage { get; set; }
+
+ ///
+ /// The retry timeout in seconds for Long Running Operations. Default
+ /// value is 30.
+ ///
+ int? LongRunningOperationRetryTimeout { get; set; }
+
+ ///
+ /// Whether a unique x-ms-client-request-id should be generated. When
+ /// set to true a unique x-ms-client-request-id value is generated and
+ /// included in each request. Default is true.
+ ///
+ bool? GenerateClientRequestId { get; set; }
+
+
+ ///
+ /// Gets the IViewsOperations.
+ ///
+ IViewsOperations Views { get; }
+
+ ///
+ /// Gets the IBudgetsOperations.
+ ///
+ IBudgetsOperations Budgets { get; }
+
+ ///
+ /// Gets the IBudgetOperations.
+ ///
+ IBudgetOperations Budget { get; }
+
+ ///
+ /// Gets the IOperations.
+ ///
+ IOperations Operations { get; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IOperations.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IOperations.cs
new file mode 100644
index 0000000000000..9efcc4fb3e1bf
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IOperations.cs
@@ -0,0 +1,68 @@
+//
+// 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.CostManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Operations operations.
+ ///
+ public partial interface IOperations
+ {
+ ///
+ /// Lists all of the available consumption REST API operations.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all of the available consumption REST 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/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IViewsOperations.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IViewsOperations.cs
new file mode 100644
index 0000000000000..113b114257aa9
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/IViewsOperations.cs
@@ -0,0 +1,345 @@
+//
+// 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.CostManagement
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ViewsOperations operations.
+ ///
+ public partial interface IViewsOperations
+ {
+ ///
+ /// Lists all views by tenant and object.
+ ///
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all views at the given scope.
+ ///
+ ///
+ ///
+ /// The scope associated with view operations. This includes
+ /// 'subscriptions/{subscriptionId}' for subscription scope,
+ /// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for BillingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for InvoiceSection scope,
+ /// 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'
+ /// for External Billing Account scope and
+ /// 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'
+ /// for External Subscription scope.
+ ///
+ ///
+ /// 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>> ListByScopeWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the view by view name.
+ ///
+ ///
+ ///
+ /// View name
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string viewName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// The operation to create or update a view. Update operation requires
+ /// latest eTag to be set in the request. You may obtain the latest
+ /// eTag by performing a get operation. Create operation does not
+ /// require eTag.
+ ///
+ ///
+ ///
+ /// View name
+ ///
+ ///
+ /// Parameters supplied to the CreateOrUpdate View 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> CreateOrUpdateWithHttpMessagesAsync(string viewName, View parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// The operation to delete a view.
+ ///
+ ///
+ ///
+ /// View name
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string viewName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the view for the defined scope by view name.
+ ///
+ ///
+ ///
+ /// The scope associated with view operations. This includes
+ /// 'subscriptions/{subscriptionId}' for subscription scope,
+ /// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for BillingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for InvoiceSection scope,
+ /// 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'
+ /// for External Billing Account scope and
+ /// 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'
+ /// for External Subscription scope.
+ ///
+ ///
+ /// View name
+ ///
+ ///
+ /// 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> GetByScopeWithHttpMessagesAsync(string scope, string viewName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// The operation to create or update a view. Update operation requires
+ /// latest eTag to be set in the request. You may obtain the latest
+ /// eTag by performing a get operation. Create operation does not
+ /// require eTag.
+ ///
+ ///
+ ///
+ /// The scope associated with view operations. This includes
+ /// 'subscriptions/{subscriptionId}' for subscription scope,
+ /// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for BillingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for InvoiceSection scope,
+ /// 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'
+ /// for External Billing Account scope and
+ /// 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'
+ /// for External Subscription scope.
+ ///
+ ///
+ /// View name
+ ///
+ ///
+ /// Parameters supplied to the CreateOrUpdate View 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> CreateOrUpdateByScopeWithHttpMessagesAsync(string scope, string viewName, View parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// The operation to delete a view.
+ ///
+ ///
+ ///
+ /// The scope associated with view operations. This includes
+ /// 'subscriptions/{subscriptionId}' for subscription scope,
+ /// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for BillingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for InvoiceSection scope,
+ /// 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'
+ /// for External Billing Account scope and
+ /// 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'
+ /// for External Subscription scope.
+ ///
+ ///
+ /// View name
+ ///
+ ///
+ /// 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 DeleteByScopeWithHttpMessagesAsync(string scope, string viewName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all views by tenant and object.
+ ///
+ ///
+ ///
+ /// 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));
+ ///
+ /// Lists all views at the given scope.
+ ///
+ ///
+ ///
+ /// 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>> ListByScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/AccumulatedType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/AccumulatedType.cs
new file mode 100644
index 0000000000000..a2e19985def02
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/AccumulatedType.cs
@@ -0,0 +1,22 @@
+//
+// 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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for AccumulatedType.
+ ///
+ public static class AccumulatedType
+ {
+ public const string True = "true";
+ public const string False = "false";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/BudgetModel.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/BudgetModel.cs
new file mode 100644
index 0000000000000..1ac6c00a01c03
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/BudgetModel.cs
@@ -0,0 +1,172 @@
+//
+// 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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// A budget resource.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class BudgetModel : ProxyResource
+ {
+ ///
+ /// Initializes a new instance of the BudgetModel class.
+ ///
+ public BudgetModel()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BudgetModel class.
+ ///
+ /// The category of the budget, whether the
+ /// budget tracks cost or usage. Possible values include: 'Cost',
+ /// 'Usage'
+ /// The total amount of cost to track with the
+ /// budget
+ /// The time covered by a budget. Tracking of
+ /// the amount will be reset based on the time grain. Possible values
+ /// include: 'Monthly', 'Quarterly', 'Annually'
+ /// Has start and end date of the budget. The
+ /// start date must be first of the month and should be less than the
+ /// end date. Budget start date must be on or after June 1, 2017.
+ /// Future start date should not be more than three months. Past start
+ /// date should be selected within the timegrain period. There are no
+ /// restrictions on the end date.
+ /// Resource Id.
+ /// Resource name.
+ /// Resource type.
+ /// eTag of the resource. To handle concurrent
+ /// update scenario, this field will be used to determine whether the
+ /// user is updating the latest version or not.
+ /// May be used to filter budgets.
+ /// The current amount of cost which is
+ /// being tracked for a budget.
+ /// Dictionary of notifications associated
+ /// with the budget. Budget can have up to five notifications.
+ public BudgetModel(string category, decimal amount, string timeGrain, BudgetTimePeriod timePeriod, string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), ReportConfigFilter filter = default(ReportConfigFilter), CurrentSpend currentSpend = default(CurrentSpend), IDictionary notifications = default(IDictionary))
+ : base(id, name, type, eTag)
+ {
+ Category = category;
+ Amount = amount;
+ TimeGrain = timeGrain;
+ TimePeriod = timePeriod;
+ Filter = filter;
+ CurrentSpend = currentSpend;
+ Notifications = notifications;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the category of the budget, whether the budget tracks
+ /// cost or usage. Possible values include: 'Cost', 'Usage'
+ ///
+ [JsonProperty(PropertyName = "properties.category")]
+ public string Category { get; set; }
+
+ ///
+ /// Gets or sets the total amount of cost to track with the budget
+ ///
+ [JsonProperty(PropertyName = "properties.amount")]
+ public decimal Amount { get; set; }
+
+ ///
+ /// Gets or sets the time covered by a budget. Tracking of the amount
+ /// will be reset based on the time grain. Possible values include:
+ /// 'Monthly', 'Quarterly', 'Annually'
+ ///
+ [JsonProperty(PropertyName = "properties.timeGrain")]
+ public string TimeGrain { get; set; }
+
+ ///
+ /// Gets or sets has start and end date of the budget. The start date
+ /// must be first of the month and should be less than the end date.
+ /// Budget start date must be on or after June 1, 2017. Future start
+ /// date should not be more than three months. Past start date should
+ /// be selected within the timegrain period. There are no restrictions
+ /// on the end date.
+ ///
+ [JsonProperty(PropertyName = "properties.timePeriod")]
+ public BudgetTimePeriod TimePeriod { get; set; }
+
+ ///
+ /// Gets or sets may be used to filter budgets.
+ ///
+ [JsonProperty(PropertyName = "properties.filter")]
+ public ReportConfigFilter Filter { get; set; }
+
+ ///
+ /// Gets the current amount of cost which is being tracked for a
+ /// budget.
+ ///
+ [JsonProperty(PropertyName = "properties.currentSpend")]
+ public CurrentSpend CurrentSpend { get; private set; }
+
+ ///
+ /// Gets or sets dictionary of notifications associated with the
+ /// budget. Budget can have up to five notifications.
+ ///
+ [JsonProperty(PropertyName = "properties.notifications")]
+ public IDictionary Notifications { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Category == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Category");
+ }
+ if (TimeGrain == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "TimeGrain");
+ }
+ if (TimePeriod == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "TimePeriod");
+ }
+ if (TimePeriod != null)
+ {
+ TimePeriod.Validate();
+ }
+ if (Filter != null)
+ {
+ Filter.Validate();
+ }
+ if (Notifications != null)
+ {
+ foreach (var valueElement in Notifications.Values)
+ {
+ if (valueElement != null)
+ {
+ valueElement.Validate();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/BudgetTimePeriod.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/BudgetTimePeriod.cs
new file mode 100644
index 0000000000000..eabff2337f19d
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/BudgetTimePeriod.cs
@@ -0,0 +1,71 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The start and end date for a budget.
+ ///
+ public partial class BudgetTimePeriod
+ {
+ ///
+ /// Initializes a new instance of the BudgetTimePeriod class.
+ ///
+ public BudgetTimePeriod()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BudgetTimePeriod class.
+ ///
+ /// The start date for the budget.
+ /// The end date for the budget. If not provided,
+ /// we default this to 10 years from the start date.
+ public BudgetTimePeriod(System.DateTime startDate, System.DateTime? endDate = default(System.DateTime?))
+ {
+ StartDate = startDate;
+ EndDate = endDate;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the start date for the budget.
+ ///
+ [JsonProperty(PropertyName = "startDate")]
+ public System.DateTime StartDate { get; set; }
+
+ ///
+ /// Gets or sets the end date for the budget. If not provided, we
+ /// default this to 10 years from the start date.
+ ///
+ [JsonProperty(PropertyName = "endDate")]
+ public System.DateTime? EndDate { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ //Nothing to validate
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/CategoryType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/CategoryType.cs
new file mode 100644
index 0000000000000..4851e4efbf902
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/CategoryType.cs
@@ -0,0 +1,22 @@
+//
+// 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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for CategoryType.
+ ///
+ public static class CategoryType
+ {
+ public const string Cost = "Cost";
+ public const string Usage = "Usage";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ChartType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ChartType.cs
new file mode 100644
index 0000000000000..0e72be35a68fc
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ChartType.cs
@@ -0,0 +1,25 @@
+//
+// 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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for ChartType.
+ ///
+ public static class ChartType
+ {
+ public const string Area = "Area";
+ public const string Line = "Line";
+ public const string StackedColumn = "StackedColumn";
+ public const string GroupedColumn = "GroupedColumn";
+ public const string Table = "Table";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/CurrentSpend.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/CurrentSpend.cs
new file mode 100644
index 0000000000000..800a080399114
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/CurrentSpend.cs
@@ -0,0 +1,61 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The current amount of cost which is being tracked for a budget.
+ ///
+ public partial class CurrentSpend
+ {
+ ///
+ /// Initializes a new instance of the CurrentSpend class.
+ ///
+ public CurrentSpend()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the CurrentSpend class.
+ ///
+ /// The total amount of cost which is being
+ /// tracked by the budget.
+ /// The unit of measure for the budget
+ /// amount.
+ public CurrentSpend(decimal? amount = default(decimal?), string unit = default(string))
+ {
+ Amount = amount;
+ Unit = unit;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the total amount of cost which is being tracked by the budget.
+ ///
+ [JsonProperty(PropertyName = "amount")]
+ public decimal? Amount { get; private set; }
+
+ ///
+ /// Gets the unit of measure for the budget amount.
+ ///
+ [JsonProperty(PropertyName = "unit")]
+ public string Unit { get; private set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorBase.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorBase.cs
new file mode 100644
index 0000000000000..e01c15ea507be
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorBase.cs
@@ -0,0 +1,69 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The details of the error.
+ ///
+ public partial class ErrorBase
+ {
+ ///
+ /// Initializes a new instance of the ErrorBase class.
+ ///
+ public ErrorBase()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorBase class.
+ ///
+ /// A machine readable error code.
+ /// A human readable error message.
+ /// Indicates which property in the request is
+ /// responsible for the error.
+ public ErrorBase(string code = default(string), string message = default(string), string target = default(string))
+ {
+ Code = code;
+ Message = message;
+ Target = target;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets a machine readable error code.
+ ///
+ [JsonProperty(PropertyName = "code")]
+ public string Code { get; private set; }
+
+ ///
+ /// Gets a human readable error message.
+ ///
+ [JsonProperty(PropertyName = "message")]
+ public string Message { get; private set; }
+
+ ///
+ /// Gets indicates which property in the request is responsible for the
+ /// error.
+ ///
+ [JsonProperty(PropertyName = "target")]
+ public string Target { get; private set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorDetails.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorDetails.cs
new file mode 100644
index 0000000000000..1386766cdbb31
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorDetails.cs
@@ -0,0 +1,79 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The details of the error.
+ ///
+ public partial class ErrorDetails
+ {
+ ///
+ /// Initializes a new instance of the ErrorDetails class.
+ ///
+ public ErrorDetails()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorDetails class.
+ ///
+ /// A machine readable error code.
+ /// A human readable error message.
+ /// Indicates which property in the request is
+ /// responsible for the error.
+ /// error details.
+ public ErrorDetails(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList))
+ {
+ Code = code;
+ Message = message;
+ Target = target;
+ Details = details;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets a machine readable error code.
+ ///
+ [JsonProperty(PropertyName = "code")]
+ public string Code { get; private set; }
+
+ ///
+ /// Gets a human readable error message.
+ ///
+ [JsonProperty(PropertyName = "message")]
+ public string Message { get; private set; }
+
+ ///
+ /// Gets or sets indicates which property in the request is responsible
+ /// for the error.
+ ///
+ [JsonProperty(PropertyName = "target")]
+ public string Target { get; set; }
+
+ ///
+ /// Gets or sets error details.
+ ///
+ [JsonProperty(PropertyName = "details")]
+ public IList Details { get; set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorResponse.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorResponse.cs
new file mode 100644
index 0000000000000..de6105c004dab
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorResponse.cs
@@ -0,0 +1,52 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Error response indicates that the service is not able to process the
+ /// incoming request. The reason is provided in the error message.
+ ///
+ public partial class ErrorResponse
+ {
+ ///
+ /// Initializes a new instance of the ErrorResponse class.
+ ///
+ public ErrorResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorResponse class.
+ ///
+ /// The details of the error.
+ public ErrorResponse(ErrorDetails error = default(ErrorDetails))
+ {
+ Error = error;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the details of the error.
+ ///
+ [JsonProperty(PropertyName = "error")]
+ public ErrorDetails Error { get; set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorResponseException.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorResponseException.cs
new file mode 100644
index 0000000000000..a464dabb029b3
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ErrorResponseException.cs
@@ -0,0 +1,62 @@
+//
+// 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.CostManagement.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/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/GranularityType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/GranularityType.cs
new file mode 100644
index 0000000000000..b259cfb98f3d4
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/GranularityType.cs
@@ -0,0 +1,22 @@
+//
+// 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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for GranularityType.
+ ///
+ public static class GranularityType
+ {
+ public const string Daily = "Daily";
+ public const string Monthly = "Monthly";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/KpiProperties.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/KpiProperties.cs
new file mode 100644
index 0000000000000..2b73b6d962e26
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/KpiProperties.cs
@@ -0,0 +1,69 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Each KPI must contain a 'type' and 'enabled' key.
+ ///
+ public partial class KpiProperties
+ {
+ ///
+ /// Initializes a new instance of the KpiProperties class.
+ ///
+ public KpiProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the KpiProperties class.
+ ///
+ /// KPI type (Forecast, Budget). Possible values
+ /// include: 'Forecast', 'Budget'
+ /// ID of resource related to metric (budget).
+ /// show the KPI in the UI?
+ public KpiProperties(string type = default(string), string id = default(string), bool? enabled = default(bool?))
+ {
+ Type = type;
+ Id = id;
+ Enabled = enabled;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets KPI type (Forecast, Budget). Possible values include:
+ /// 'Forecast', 'Budget'
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ /// Gets or sets ID of resource related to metric (budget).
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ ///
+ /// Gets or sets show the KPI in the UI?
+ ///
+ [JsonProperty(PropertyName = "enabled")]
+ public bool? Enabled { get; set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/KpiTypeType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/KpiTypeType.cs
new file mode 100644
index 0000000000000..735baa7d36b30
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/KpiTypeType.cs
@@ -0,0 +1,22 @@
+//
+// 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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for KpiTypeType.
+ ///
+ public static class KpiTypeType
+ {
+ public const string Forecast = "Forecast";
+ public const string Budget = "Budget";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/MetricType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/MetricType.cs
new file mode 100644
index 0000000000000..746d4df6e4d8b
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/MetricType.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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for MetricType.
+ ///
+ public static class MetricType
+ {
+ public const string ActualCost = "ActualCost";
+ public const string AmortizedCost = "AmortizedCost";
+ public const string AHUB = "AHUB";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Notification.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Notification.cs
new file mode 100644
index 0000000000000..a208ee8129c41
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Notification.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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The notification associated with a budget.
+ ///
+ public partial class Notification
+ {
+ ///
+ /// Initializes a new instance of the Notification class.
+ ///
+ public Notification()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Notification class.
+ ///
+ /// The notification is enabled or not.
+ /// The comparison operator. Possible
+ /// values include: 'EqualTo', 'GreaterThan',
+ /// 'GreaterThanOrEqualTo'
+ /// Threshold value associated with a
+ /// notification. Notification is sent when the cost exceeded the
+ /// threshold. It is always percent and has to be between 0 and
+ /// 1000.
+ /// Email addresses to send the budget
+ /// notification to when the threshold is exceeded.
+ /// Contact roles to send the budget
+ /// notification to when the threshold is exceeded.
+ /// Action groups to send the budget
+ /// notification to when the threshold is exceeded.
+ public Notification(bool enabled, string operatorProperty, decimal threshold, IList contactEmails, IList contactRoles = default(IList), IList contactGroups = default(IList))
+ {
+ Enabled = enabled;
+ OperatorProperty = operatorProperty;
+ Threshold = threshold;
+ ContactEmails = contactEmails;
+ ContactRoles = contactRoles;
+ ContactGroups = contactGroups;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the notification is enabled or not.
+ ///
+ [JsonProperty(PropertyName = "enabled")]
+ public bool Enabled { get; set; }
+
+ ///
+ /// Gets or sets the comparison operator. Possible values include:
+ /// 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo'
+ ///
+ [JsonProperty(PropertyName = "operator")]
+ public string OperatorProperty { get; set; }
+
+ ///
+ /// Gets or sets threshold value associated with a notification.
+ /// Notification is sent when the cost exceeded the threshold. It is
+ /// always percent and has to be between 0 and 1000.
+ ///
+ [JsonProperty(PropertyName = "threshold")]
+ public decimal Threshold { get; set; }
+
+ ///
+ /// Gets or sets email addresses to send the budget notification to
+ /// when the threshold is exceeded.
+ ///
+ [JsonProperty(PropertyName = "contactEmails")]
+ public IList ContactEmails { get; set; }
+
+ ///
+ /// Gets or sets contact roles to send the budget notification to when
+ /// the threshold is exceeded.
+ ///
+ [JsonProperty(PropertyName = "contactRoles")]
+ public IList ContactRoles { get; set; }
+
+ ///
+ /// Gets or sets action groups to send the budget notification to when
+ /// the threshold is exceeded.
+ ///
+ [JsonProperty(PropertyName = "contactGroups")]
+ public IList ContactGroups { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (OperatorProperty == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "OperatorProperty");
+ }
+ if (ContactEmails == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ContactEmails");
+ }
+ if (ContactEmails != null)
+ {
+ if (ContactEmails.Count > 50)
+ {
+ throw new ValidationException(ValidationRules.MaxItems, "ContactEmails", 50);
+ }
+ if (ContactEmails.Count < 1)
+ {
+ throw new ValidationException(ValidationRules.MinItems, "ContactEmails", 1);
+ }
+ }
+ if (ContactGroups != null)
+ {
+ if (ContactGroups.Count > 50)
+ {
+ throw new ValidationException(ValidationRules.MaxItems, "ContactGroups", 50);
+ }
+ if (ContactGroups.Count < 0)
+ {
+ throw new ValidationException(ValidationRules.MinItems, "ContactGroups", 0);
+ }
+ }
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/NotificationOperatorType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/NotificationOperatorType.cs
new file mode 100644
index 0000000000000..e5b8501977e24
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/NotificationOperatorType.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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for NotificationOperatorType.
+ ///
+ public static class NotificationOperatorType
+ {
+ public const string EqualTo = "EqualTo";
+ public const string GreaterThan = "GreaterThan";
+ public const string GreaterThanOrEqualTo = "GreaterThanOrEqualTo";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Operation.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Operation.cs
new file mode 100644
index 0000000000000..bed6fe698a613
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Operation.cs
@@ -0,0 +1,61 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// A Cost management REST API operation.
+ ///
+ public partial class Operation
+ {
+ ///
+ /// Initializes a new instance of the Operation class.
+ ///
+ public Operation()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Operation class.
+ ///
+ /// Operation name:
+ /// {provider}/{resource}/{operation}.
+ /// The object that represents the
+ /// operation.
+ public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay))
+ {
+ Name = name;
+ Display = display;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets operation name: {provider}/{resource}/{operation}.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets or sets the object that represents the operation.
+ ///
+ [JsonProperty(PropertyName = "display")]
+ public OperationDisplay Display { get; set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/OperationDisplay.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/OperationDisplay.cs
new file mode 100644
index 0000000000000..b8731cf3636b7
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/OperationDisplay.cs
@@ -0,0 +1,71 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The object that represents the operation.
+ ///
+ public partial class OperationDisplay
+ {
+ ///
+ /// Initializes a new instance of the OperationDisplay class.
+ ///
+ public OperationDisplay()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the OperationDisplay class.
+ ///
+ /// Service provider:
+ /// Microsoft.CostManagement.
+ /// Resource on which the operation is
+ /// performed: Dimensions, Query.
+ /// Operation type: Read, write, delete,
+ /// etc.
+ public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string))
+ {
+ Provider = provider;
+ Resource = resource;
+ Operation = operation;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets service provider: Microsoft.CostManagement.
+ ///
+ [JsonProperty(PropertyName = "provider")]
+ public string Provider { get; private set; }
+
+ ///
+ /// Gets resource on which the operation is performed: Dimensions,
+ /// Query.
+ ///
+ [JsonProperty(PropertyName = "resource")]
+ public string Resource { get; private set; }
+
+ ///
+ /// Gets operation type: Read, write, delete, etc.
+ ///
+ [JsonProperty(PropertyName = "operation")]
+ public string Operation { get; private set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/OperatorType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/OperatorType.cs
new file mode 100644
index 0000000000000..04835817077f3
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/OperatorType.cs
@@ -0,0 +1,22 @@
+//
+// 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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for OperatorType.
+ ///
+ public static class OperatorType
+ {
+ public const string In = "In";
+ public const string Contains = "Contains";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Page.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Page.cs
new file mode 100644
index 0000000000000..a431dbedbb4d7
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Page.cs
@@ -0,0 +1,53 @@
+//
+// 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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+
+ ///
+ /// Defines a page in Azure responses.
+ ///
+ /// Type of the page content items
+ [JsonObject]
+ public class Page : IPage
+ {
+ ///
+ /// Gets the link to the next page.
+ ///
+ [JsonProperty("nextLink")]
+ public string NextPageLink { get; private set; }
+
+ [JsonProperty("value")]
+ private IList Items{ get; set; }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ public IEnumerator GetEnumerator()
+ {
+ return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator();
+ }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/PivotProperties.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/PivotProperties.cs
new file mode 100644
index 0000000000000..7761b4a3ea879
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/PivotProperties.cs
@@ -0,0 +1,61 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Each pivot must contain a 'type' and 'name'.
+ ///
+ public partial class PivotProperties
+ {
+ ///
+ /// Initializes a new instance of the PivotProperties class.
+ ///
+ public PivotProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PivotProperties class.
+ ///
+ /// Data type to show in view. Possible values
+ /// include: 'Dimension', 'TagKey'
+ /// Data field to show in view.
+ public PivotProperties(string type = default(string), string name = default(string))
+ {
+ Type = type;
+ Name = name;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets data type to show in view. Possible values include:
+ /// 'Dimension', 'TagKey'
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ /// Gets or sets data field to show in view.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/PivotTypeType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/PivotTypeType.cs
new file mode 100644
index 0000000000000..01ce2abd7bb73
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/PivotTypeType.cs
@@ -0,0 +1,22 @@
+//
+// 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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for PivotTypeType.
+ ///
+ public static class PivotTypeType
+ {
+ public const string Dimension = "Dimension";
+ public const string TagKey = "TagKey";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ProxyResource.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ProxyResource.cs
new file mode 100644
index 0000000000000..d38be096c86a3
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ProxyResource.cs
@@ -0,0 +1,81 @@
+//
+// 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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The Resource model definition.
+ ///
+ public partial class ProxyResource : IResource
+ {
+ ///
+ /// Initializes a new instance of the ProxyResource class.
+ ///
+ public ProxyResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ProxyResource class.
+ ///
+ /// Resource Id.
+ /// Resource name.
+ /// Resource type.
+ /// eTag of the resource. To handle concurrent
+ /// update scenario, this field will be used to determine whether the
+ /// user is updating the latest version or not.
+ public ProxyResource(string id = default(string), string name = default(string), string type = default(string), string eTag = default(string))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ ETag = eTag;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets resource Id.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets resource 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 eTag of the resource. To handle concurrent update
+ /// scenario, this field will be used to determine whether the user is
+ /// updating the latest version or not.
+ ///
+ [JsonProperty(PropertyName = "eTag")]
+ public string ETag { get; set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigAggregation.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigAggregation.cs
new file mode 100644
index 0000000000000..0f65a66d0699e
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigAggregation.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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The aggregation expression to be used in the report.
+ ///
+ public partial class ReportConfigAggregation
+ {
+ ///
+ /// Initializes a new instance of the ReportConfigAggregation class.
+ ///
+ public ReportConfigAggregation()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ReportConfigAggregation class.
+ ///
+ /// The name of the column to aggregate.
+ public ReportConfigAggregation(string name)
+ {
+ Name = name;
+ CustomInit();
+ }
+ ///
+ /// Static constructor for ReportConfigAggregation class.
+ ///
+ static ReportConfigAggregation()
+ {
+ Function = "Sum";
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the name of the column to aggregate.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// The name of the aggregation function to use.
+ ///
+ [JsonProperty(PropertyName = "function")]
+ public static string Function { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigColumnType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigColumnType.cs
new file mode 100644
index 0000000000000..1f891b17234d1
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigColumnType.cs
@@ -0,0 +1,22 @@
+//
+// 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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for ReportConfigColumnType.
+ ///
+ public static class ReportConfigColumnType
+ {
+ public const string Tag = "Tag";
+ public const string Dimension = "Dimension";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigComparisonExpression.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigComparisonExpression.cs
new file mode 100644
index 0000000000000..61dc4e845a91c
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigComparisonExpression.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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The comparison expression to be used in the report.
+ ///
+ public partial class ReportConfigComparisonExpression
+ {
+ ///
+ /// Initializes a new instance of the ReportConfigComparisonExpression
+ /// class.
+ ///
+ public ReportConfigComparisonExpression()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ReportConfigComparisonExpression
+ /// class.
+ ///
+ /// The name of the column to use in
+ /// comparison.
+ /// The operator to use for comparison.
+ /// Possible values include: 'In', 'Contains'
+ /// Array of values to use for comparison
+ public ReportConfigComparisonExpression(string name, string operatorProperty, IList values)
+ {
+ Name = name;
+ OperatorProperty = operatorProperty;
+ Values = values;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the name of the column to use in comparison.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the operator to use for comparison. Possible values
+ /// include: 'In', 'Contains'
+ ///
+ [JsonProperty(PropertyName = "operator")]
+ public string OperatorProperty { get; set; }
+
+ ///
+ /// Gets or sets array of values to use for comparison
+ ///
+ [JsonProperty(PropertyName = "values")]
+ public IList Values { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ if (OperatorProperty == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "OperatorProperty");
+ }
+ if (Values == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Values");
+ }
+ if (Values != null)
+ {
+ if (Values.Count < 1)
+ {
+ throw new ValidationException(ValidationRules.MinItems, "Values", 1);
+ }
+ }
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigDataset.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigDataset.cs
new file mode 100644
index 0000000000000..605ea38bf6271
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigDataset.cs
@@ -0,0 +1,156 @@
+//
+// 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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The definition of data present in the report.
+ ///
+ public partial class ReportConfigDataset
+ {
+ ///
+ /// Initializes a new instance of the ReportConfigDataset class.
+ ///
+ public ReportConfigDataset()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ReportConfigDataset class.
+ ///
+ /// The granularity of rows in the report.
+ /// Possible values include: 'Daily', 'Monthly'
+ /// Has configuration information for the
+ /// data in the report. The configuration will be ignored if
+ /// aggregation and grouping are provided.
+ /// Dictionary of aggregation expression to
+ /// use in the report. The key of each item in the dictionary is the
+ /// alias for the aggregated column. Report can have up to 2
+ /// aggregation clauses.
+ /// Array of group by expression to use in the
+ /// report. Report can have up to 2 group by clauses.
+ /// Array of order by expression to use in the
+ /// report.
+ /// Has filter expression to use in the
+ /// report.
+ public ReportConfigDataset(string granularity = default(string), ReportConfigDatasetConfiguration configuration = default(ReportConfigDatasetConfiguration), IDictionary aggregation = default(IDictionary), IList grouping = default(IList), IList sorting = default(IList), ReportConfigFilter filter = default(ReportConfigFilter))
+ {
+ Granularity = granularity;
+ Configuration = configuration;
+ Aggregation = aggregation;
+ Grouping = grouping;
+ Sorting = sorting;
+ Filter = filter;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the granularity of rows in the report. Possible values
+ /// include: 'Daily', 'Monthly'
+ ///
+ [JsonProperty(PropertyName = "granularity")]
+ public string Granularity { get; set; }
+
+ ///
+ /// Gets or sets has configuration information for the data in the
+ /// report. The configuration will be ignored if aggregation and
+ /// grouping are provided.
+ ///
+ [JsonProperty(PropertyName = "configuration")]
+ public ReportConfigDatasetConfiguration Configuration { get; set; }
+
+ ///
+ /// Gets or sets dictionary of aggregation expression to use in the
+ /// report. The key of each item in the dictionary is the alias for the
+ /// aggregated column. Report can have up to 2 aggregation clauses.
+ ///
+ [JsonProperty(PropertyName = "aggregation")]
+ public IDictionary Aggregation { get; set; }
+
+ ///
+ /// Gets or sets array of group by expression to use in the report.
+ /// Report can have up to 2 group by clauses.
+ ///
+ [JsonProperty(PropertyName = "grouping")]
+ public IList Grouping { get; set; }
+
+ ///
+ /// Gets or sets array of order by expression to use in the report.
+ ///
+ [JsonProperty(PropertyName = "sorting")]
+ public IList Sorting { get; set; }
+
+ ///
+ /// Gets or sets has filter expression to use in the report.
+ ///
+ [JsonProperty(PropertyName = "filter")]
+ public ReportConfigFilter Filter { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Aggregation != null)
+ {
+ foreach (var valueElement in Aggregation.Values)
+ {
+ if (valueElement != null)
+ {
+ valueElement.Validate();
+ }
+ }
+ }
+ if (Grouping != null)
+ {
+ if (Grouping.Count > 2)
+ {
+ throw new ValidationException(ValidationRules.MaxItems, "Grouping", 2);
+ }
+ foreach (var element in Grouping)
+ {
+ if (element != null)
+ {
+ element.Validate();
+ }
+ }
+ }
+ if (Sorting != null)
+ {
+ foreach (var element1 in Sorting)
+ {
+ if (element1 != null)
+ {
+ element1.Validate();
+ }
+ }
+ }
+ if (Filter != null)
+ {
+ Filter.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigDatasetConfiguration.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigDatasetConfiguration.cs
new file mode 100644
index 0000000000000..eeb8dc20dc98d
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigDatasetConfiguration.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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The configuration of dataset in the report.
+ ///
+ public partial class ReportConfigDatasetConfiguration
+ {
+ ///
+ /// Initializes a new instance of the ReportConfigDatasetConfiguration
+ /// class.
+ ///
+ public ReportConfigDatasetConfiguration()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ReportConfigDatasetConfiguration
+ /// class.
+ ///
+ /// Array of column names to be included in the
+ /// report. Any valid report column name is allowed. If not provided,
+ /// then report includes all columns.
+ public ReportConfigDatasetConfiguration(IList columns = default(IList))
+ {
+ Columns = columns;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets array of column names to be included in the report.
+ /// Any valid report column name is allowed. If not provided, then
+ /// report includes all columns.
+ ///
+ [JsonProperty(PropertyName = "columns")]
+ public IList Columns { get; set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigFilter.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigFilter.cs
new file mode 100644
index 0000000000000..501c07680265d
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigFilter.cs
@@ -0,0 +1,140 @@
+//
+// 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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The filter expression to be used in the report.
+ ///
+ public partial class ReportConfigFilter
+ {
+ ///
+ /// Initializes a new instance of the ReportConfigFilter class.
+ ///
+ public ReportConfigFilter()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ReportConfigFilter class.
+ ///
+ /// The logical "AND" expression. Must have at least
+ /// 2 items.
+ /// The logical "OR" expression. Must have at least 2
+ /// items.
+ /// The logical "NOT" expression.
+ /// Has comparison expression for a
+ /// dimension
+ /// Has comparison expression for a tag
+ public ReportConfigFilter(IList and = default(IList), IList or = default(IList), ReportConfigFilter not = default(ReportConfigFilter), ReportConfigComparisonExpression dimension = default(ReportConfigComparisonExpression), ReportConfigComparisonExpression tag = default(ReportConfigComparisonExpression))
+ {
+ And = and;
+ Or = or;
+ Not = not;
+ Dimension = dimension;
+ Tag = tag;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the logical "AND" expression. Must have at least 2
+ /// items.
+ ///
+ [JsonProperty(PropertyName = "and")]
+ public IList And { get; set; }
+
+ ///
+ /// Gets or sets the logical "OR" expression. Must have at least 2
+ /// items.
+ ///
+ [JsonProperty(PropertyName = "or")]
+ public IList Or { get; set; }
+
+ ///
+ /// Gets or sets the logical "NOT" expression.
+ ///
+ [JsonProperty(PropertyName = "not")]
+ public ReportConfigFilter Not { get; set; }
+
+ ///
+ /// Gets or sets has comparison expression for a dimension
+ ///
+ [JsonProperty(PropertyName = "dimension")]
+ public ReportConfigComparisonExpression Dimension { get; set; }
+
+ ///
+ /// Gets or sets has comparison expression for a tag
+ ///
+ [JsonProperty(PropertyName = "tag")]
+ public ReportConfigComparisonExpression Tag { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (And != null)
+ {
+ if (And.Count < 2)
+ {
+ throw new ValidationException(ValidationRules.MinItems, "And", 2);
+ }
+ foreach (var element in And)
+ {
+ if (element != null)
+ {
+ element.Validate();
+ }
+ }
+ }
+ if (Or != null)
+ {
+ if (Or.Count < 2)
+ {
+ throw new ValidationException(ValidationRules.MinItems, "Or", 2);
+ }
+ foreach (var element1 in Or)
+ {
+ if (element1 != null)
+ {
+ element1.Validate();
+ }
+ }
+ }
+ if (Not != null)
+ {
+ Not.Validate();
+ }
+ if (Dimension != null)
+ {
+ Dimension.Validate();
+ }
+ if (Tag != null)
+ {
+ Tag.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigGrouping.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigGrouping.cs
new file mode 100644
index 0000000000000..ce12933eb064c
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigGrouping.cs
@@ -0,0 +1,81 @@
+//
+// 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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The group by expression to be used in the report.
+ ///
+ public partial class ReportConfigGrouping
+ {
+ ///
+ /// Initializes a new instance of the ReportConfigGrouping class.
+ ///
+ public ReportConfigGrouping()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ReportConfigGrouping class.
+ ///
+ /// Has type of the column to group. Possible values
+ /// include: 'Tag', 'Dimension'
+ /// The name of the column to group. This version
+ /// supports subscription lowest possible grain.
+ public ReportConfigGrouping(string type, string name)
+ {
+ Type = type;
+ Name = name;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets has type of the column to group. Possible values
+ /// include: 'Tag', 'Dimension'
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ /// Gets or sets the name of the column to group. This version supports
+ /// subscription lowest possible grain.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Type == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Type");
+ }
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigSorting.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigSorting.cs
new file mode 100644
index 0000000000000..ae83953a20e47
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigSorting.cs
@@ -0,0 +1,75 @@
+//
+// 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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The order by expression to be used in the report.
+ ///
+ public partial class ReportConfigSorting
+ {
+ ///
+ /// Initializes a new instance of the ReportConfigSorting class.
+ ///
+ public ReportConfigSorting()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ReportConfigSorting class.
+ ///
+ /// The name of the column to sort.
+ /// Direction of sort. Possible values include:
+ /// 'Ascending', 'Descending'
+ public ReportConfigSorting(string name, string direction = default(string))
+ {
+ Direction = direction;
+ Name = name;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets direction of sort. Possible values include:
+ /// 'Ascending', 'Descending'
+ ///
+ [JsonProperty(PropertyName = "direction")]
+ public string Direction { get; set; }
+
+ ///
+ /// Gets or sets the name of the column to sort.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigTimePeriod.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigTimePeriod.cs
new file mode 100644
index 0000000000000..2c4dabb854579
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/ReportConfigTimePeriod.cs
@@ -0,0 +1,70 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The start and end date for pulling data for the report.
+ ///
+ public partial class ReportConfigTimePeriod
+ {
+ ///
+ /// Initializes a new instance of the ReportConfigTimePeriod class.
+ ///
+ public ReportConfigTimePeriod()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ReportConfigTimePeriod class.
+ ///
+ /// The start date to pull data
+ /// from.
+ /// The end date to pull data to.
+ public ReportConfigTimePeriod(System.DateTime fromProperty, System.DateTime to)
+ {
+ FromProperty = fromProperty;
+ To = to;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the start date to pull data from.
+ ///
+ [JsonProperty(PropertyName = "from")]
+ public System.DateTime FromProperty { get; set; }
+
+ ///
+ /// Gets or sets the end date to pull data to.
+ ///
+ [JsonProperty(PropertyName = "to")]
+ public System.DateTime To { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ //Nothing to validate
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Resource.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Resource.cs
new file mode 100644
index 0000000000000..c6dbf27e4db33
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Resource.cs
@@ -0,0 +1,79 @@
+//
+// 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.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The Resource model definition.
+ ///
+ public partial class Resource : IResource
+ {
+ ///
+ /// Initializes a new instance of the Resource class.
+ ///
+ public Resource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Resource class.
+ ///
+ /// Resource Id.
+ /// Resource name.
+ /// Resource type.
+ /// Resource tags.
+ public Resource(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ Tags = tags;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets resource Id.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets resource name.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets resource type.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets resource tags.
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; private set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Scope.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Scope.cs
new file mode 100644
index 0000000000000..daeac5d6a1f9b
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/Scope.cs
@@ -0,0 +1,73 @@
+//
+// 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.CostManagement.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The Scope model definition
+ ///
+ public partial class Scope
+ {
+ ///
+ /// Initializes a new instance of the Scope class.
+ ///
+ public Scope()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Scope class.
+ ///
+ /// Scope id
+ /// Scope name
+ /// Scope type
+ public Scope(string id = default(string), string name = default(string), string type = default(string), Scope childScope = default(Scope))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ ChildScope = childScope;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets scope id
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ ///
+ /// Gets or sets scope name
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets scope type
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "childScope")]
+ public Scope ChildScope { get; set; }
+
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/TimeGrainType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/TimeGrainType.cs
new file mode 100644
index 0000000000000..6db6f5f3cb8a3
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/TimeGrainType.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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for TimeGrainType.
+ ///
+ public static class TimeGrainType
+ {
+ public const string Monthly = "Monthly";
+ public const string Quarterly = "Quarterly";
+ public const string Annually = "Annually";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/TimeframeType.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/TimeframeType.cs
new file mode 100644
index 0000000000000..9dd044fc073d8
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/TimeframeType.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.CostManagement.Models
+{
+
+ ///
+ /// Defines values for TimeframeType.
+ ///
+ public static class TimeframeType
+ {
+ public const string WeekToDate = "WeekToDate";
+ public const string MonthToDate = "MonthToDate";
+ public const string YearToDate = "YearToDate";
+ public const string Custom = "Custom";
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/View.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/View.cs
new file mode 100644
index 0000000000000..af80e43c9a91c
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Models/View.cs
@@ -0,0 +1,245 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CostManagement.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// States and configurations of Cost Analysis.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class View : ProxyResource
+ {
+ ///
+ /// Initializes a new instance of the View class.
+ ///
+ public View()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the View class.
+ ///
+ /// The time frame for pulling data for the
+ /// report. If custom, then a specific time period must be provided.
+ /// Possible values include: 'WeekToDate', 'MonthToDate', 'YearToDate',
+ /// 'Custom'
+ /// Resource Id.
+ /// Resource name.
+ /// Resource type.
+ /// eTag of the resource. To handle concurrent
+ /// update scenario, this field will be used to determine whether the
+ /// user is updating the latest version or not.
+ /// User input name of the view.
+ /// Required.
+ /// Cost Management scope to save the view on. This
+ /// includes 'subscriptions/{subscriptionId}' for subscription scope,
+ /// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for BillingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for InvoiceSection scope,
+ /// 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'
+ /// for ExternalBillingAccount scope, and
+ /// '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'
+ /// for ExternalSubscription scope.
+ /// Date the user created this view.
+ /// Date when the user last modified this
+ /// view.
+ /// Has time period for pulling data for the
+ /// report.
+ /// Has definition for data in this report
+ /// config.
+ /// Chart type of the main view in Cost Analysis.
+ /// Required. Possible values include: 'Area', 'Line', 'StackedColumn',
+ /// 'GroupedColumn', 'Table'
+ /// Show costs accumulated over time.
+ /// Possible values include: 'true', 'false'
+ /// Metric to use when displaying costs. Possible
+ /// values include: 'ActualCost', 'AmortizedCost', 'AHUB'
+ /// List of KPIs to show in Cost Analysis
+ /// UI.
+ /// Configuration of 3 sub-views in the Cost
+ /// Analysis UI.
+ public View(string timeframe, string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), string displayName = default(string), string scope = default(string), System.DateTime? createdOn = default(System.DateTime?), System.DateTime? modifiedOn = default(System.DateTime?), ReportConfigTimePeriod timePeriod = default(ReportConfigTimePeriod), ReportConfigDataset dataset = default(ReportConfigDataset), string chart = default(string), string accumulated = default(string), string metric = default(string), IList kpis = default(IList), IList pivots = default(IList))
+ : base(id, name, type, eTag)
+ {
+ DisplayName = displayName;
+ Scope = scope;
+ CreatedOn = createdOn;
+ ModifiedOn = modifiedOn;
+ Timeframe = timeframe;
+ TimePeriod = timePeriod;
+ Dataset = dataset;
+ Chart = chart;
+ Accumulated = accumulated;
+ Metric = metric;
+ Kpis = kpis;
+ Pivots = pivots;
+ CustomInit();
+ }
+ ///
+ /// Static constructor for View class.
+ ///
+ static View()
+ {
+ ViewType = "Usage";
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets user input name of the view. Required.
+ ///
+ [JsonProperty(PropertyName = "properties.displayName")]
+ public string DisplayName { get; set; }
+
+ ///
+ /// Gets or sets cost Management scope to save the view on. This
+ /// includes 'subscriptions/{subscriptionId}' for subscription scope,
+ /// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'
+ /// for resourceGroup scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}'
+ /// for Billing Account scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
+ /// for Department scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
+ /// for EnrollmentAccount scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ /// for BillingProfile scope,
+ /// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
+ /// for InvoiceSection scope,
+ /// 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
+ /// for Management Group scope,
+ /// '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'
+ /// for ExternalBillingAccount scope, and
+ /// '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'
+ /// for ExternalSubscription scope.
+ ///
+ [JsonProperty(PropertyName = "properties.scope")]
+ public string Scope { get; set; }
+
+ ///
+ /// Gets date the user created this view.
+ ///
+ [JsonProperty(PropertyName = "properties.createdOn")]
+ public System.DateTime? CreatedOn { get; private set; }
+
+ ///
+ /// Gets date when the user last modified this view.
+ ///
+ [JsonProperty(PropertyName = "properties.modifiedOn")]
+ public System.DateTime? ModifiedOn { get; private set; }
+
+ ///
+ /// Gets or sets the time frame for pulling data for the report. If
+ /// custom, then a specific time period must be provided. Possible
+ /// values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'Custom'
+ ///
+ [JsonProperty(PropertyName = "properties.query.timeframe")]
+ public string Timeframe { get; set; }
+
+ ///
+ /// Gets or sets has time period for pulling data for the report.
+ ///
+ [JsonProperty(PropertyName = "properties.query.timePeriod")]
+ public ReportConfigTimePeriod TimePeriod { get; set; }
+
+ ///
+ /// Gets or sets has definition for data in this report config.
+ ///
+ [JsonProperty(PropertyName = "properties.query.dataset")]
+ public ReportConfigDataset Dataset { get; set; }
+
+ ///
+ /// Gets or sets chart type of the main view in Cost Analysis.
+ /// Required. Possible values include: 'Area', 'Line', 'StackedColumn',
+ /// 'GroupedColumn', 'Table'
+ ///
+ [JsonProperty(PropertyName = "properties.chart")]
+ public string Chart { get; set; }
+
+ ///
+ /// Gets or sets show costs accumulated over time. Possible values
+ /// include: 'true', 'false'
+ ///
+ [JsonProperty(PropertyName = "properties.accumulated")]
+ public string Accumulated { get; set; }
+
+ ///
+ /// Gets or sets metric to use when displaying costs. Possible values
+ /// include: 'ActualCost', 'AmortizedCost', 'AHUB'
+ ///
+ [JsonProperty(PropertyName = "properties.metric")]
+ public string Metric { get; set; }
+
+ ///
+ /// Gets or sets list of KPIs to show in Cost Analysis UI.
+ ///
+ [JsonProperty(PropertyName = "properties.kpis")]
+ public IList Kpis { get; set; }
+
+ ///
+ /// Gets or sets configuration of 3 sub-views in the Cost Analysis UI.
+ ///
+ [JsonProperty(PropertyName = "properties.pivots")]
+ public IList Pivots { get; set; }
+
+ ///
+ /// The type of the report. Usage represents actual usage, forecast
+ /// represents forecasted data and UsageAndForecast represents both
+ /// usage and forecasted data. Actual usage and forecasted data can be
+ /// differentiated based on dates.
+ ///
+ [JsonProperty(PropertyName = "properties.query.type")]
+ public static string ViewType { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Timeframe == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Timeframe");
+ }
+ if (TimePeriod != null)
+ {
+ TimePeriod.Validate();
+ }
+ if (Dataset != null)
+ {
+ Dataset.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Operations.cs b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Operations.cs
new file mode 100644
index 0000000000000..72bbdd61c1c15
--- /dev/null
+++ b/sdk/cost-management/Microsoft.Azure.Management.CostManagement/src/Generated/Operations.cs
@@ -0,0 +1,390 @@
+//
+// 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.CostManagement
+{
+ 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;
+
+ ///
+ /// Operations operations.
+ ///
+ internal partial class Operations : IServiceOperations, IOperations
+ {
+ ///
+ /// Initializes a new instance of the Operations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal Operations(CostManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CostManagementClient
+ ///
+ public CostManagementClient Client { get; private set; }
+
+ ///
+ /// Lists all of the available consumption REST API operations.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.CostManagement/operations").ToString();
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject