diff --git a/eng/mgmt/mgmtmetadata/datadog_resource-manager.txt b/eng/mgmt/mgmtmetadata/datadog_resource-manager.txt
deleted file mode 100644
index 257f0550fb77a..0000000000000
--- a/eng/mgmt/mgmtmetadata/datadog_resource-manager.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Installing AutoRest version: v2
-AutoRest installed successfully.
-Commencing code generation
-Generating CSharp code
-Executing AutoRest command
-cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datadog/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\work\azure-sdk-for-net\sdk
-2020-10-09 01:08:52 UTC
-Azure-rest-api-specs repository information
-GitHub fork: Azure
-Branch: master
-Commit: 183db615e7e870d12668972c874897f095fe256c
-AutoRest information
-Requested version: v2
-Bootstrapper version: autorest@2.0.4413
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/AzSdk.RP.props b/sdk/datadog/Microsoft.Azure.Management.Datadog/AzSdk.RP.props
deleted file mode 100644
index e76727bfc708c..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/AzSdk.RP.props
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
- Datadog_2020-02-01-preview;
- $(PackageTags);$(CommonTags);$(AzureApiTag);
-
-
\ No newline at end of file
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/Microsoft.Azure.Management.Datadog.sln b/sdk/datadog/Microsoft.Azure.Management.Datadog/Microsoft.Azure.Management.Datadog.sln
deleted file mode 100644
index 04caeaddb6401..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/Microsoft.Azure.Management.Datadog.sln
+++ /dev/null
@@ -1,28 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.4
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Management.Datadog.Tests", "tests\Microsoft.Azure.Management.Datadog.Tests.csproj", "{CCDAE481-FF4A-4018-88EF-C3FE4AEB4C8B}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Management.Datadog", "src\Microsoft.Azure.Management.Datadog.csproj", "{18EFDFC3-523F-4AA2-BD40-21CB366C83EF}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CCDAE481-FF4A-4018-88EF-C3FE4AEB4C8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CCDAE481-FF4A-4018-88EF-C3FE4AEB4C8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CCDAE481-FF4A-4018-88EF-C3FE4AEB4C8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CCDAE481-FF4A-4018-88EF-C3FE4AEB4C8B}.Release|Any CPU.Build.0 = Release|Any CPU
- {18EFDFC3-523F-4AA2-BD40-21CB366C83EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {18EFDFC3-523F-4AA2-BD40-21CB366C83EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {18EFDFC3-523F-4AA2-BD40-21CB366C83EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {18EFDFC3-523F-4AA2-BD40-21CB366C83EF}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ApiKeysOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ApiKeysOperations.cs
deleted file mode 100644
index 769079fd90606..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ApiKeysOperations.cs
+++ /dev/null
@@ -1,808 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- 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;
-
- ///
- /// ApiKeysOperations operations.
- ///
- internal partial class ApiKeysOperations : IServiceOperations, IApiKeysOperations
- {
- ///
- /// Initializes a new instance of the ApiKeysOperations class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- internal ApiKeysOperations(MicrosoftDatadogClient client)
- {
- if (client == null)
- {
- throw new System.ArgumentNullException("client");
- }
- Client = client;
- }
-
- ///
- /// Gets a reference to the MicrosoftDatadogClient
- ///
- public MicrosoftDatadogClient Client { get; private set; }
-
- ///
- /// List the api keys for a given monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, 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 (monitorName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "monitorName");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("monitorName", monitorName);
- 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{monitorName}", System.Uri.EscapeDataString(monitorName));
- 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new AzureOperationResponse>();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
- // Deserialize Response
- if ((int)_statusCode == 200)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
- if (_shouldTrace)
- {
- ServiceClientTracing.Exit(_invocationId, _result);
- }
- return _result;
- }
-
- ///
- /// Get the default api key.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource 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> GetDefaultKeyWithHttpMessagesAsync(string resourceGroupName, string monitorName, 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 (monitorName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "monitorName");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("monitorName", monitorName);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetDefaultKey", 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.Datadog/monitors/{monitorName}/getDefaultKey").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{monitorName}", System.Uri.EscapeDataString(monitorName));
- 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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;
- }
-
- ///
- /// Set the default api key.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource 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 SetDefaultKeyWithHttpMessagesAsync(string resourceGroupName, string monitorName, DatadogApiKey body = default(DatadogApiKey), 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 (monitorName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "monitorName");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- if (body != null)
- {
- body.Validate();
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("monitorName", monitorName);
- tracingParameters.Add("body", body);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "SetDefaultKey", 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.Datadog/monitors/{monitorName}/setDefaultKey").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{monitorName}", System.Uri.EscapeDataString(monitorName));
- 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- if(body != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
- {
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
- }
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200)
- {
- var ex = new ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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;
- }
-
- ///
- /// List the api keys for a given monitor resource.
- ///
- ///
- /// 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ApiKeysOperationsExtensions.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ApiKeysOperationsExtensions.cs
deleted file mode 100644
index 81015b2c1588c..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ApiKeysOperationsExtensions.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// Extension methods for ApiKeysOperations.
- ///
- public static partial class ApiKeysOperationsExtensions
- {
- ///
- /// List the api keys for a given monitor resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- public static IPage List(this IApiKeysOperations operations, string resourceGroupName, string monitorName)
- {
- return operations.ListAsync(resourceGroupName, monitorName).GetAwaiter().GetResult();
- }
-
- ///
- /// List the api keys for a given monitor resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this IApiKeysOperations operations, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, monitorName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Get the default api key.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- public static DatadogApiKey GetDefaultKey(this IApiKeysOperations operations, string resourceGroupName, string monitorName)
- {
- return operations.GetDefaultKeyAsync(resourceGroupName, monitorName).GetAwaiter().GetResult();
- }
-
- ///
- /// Get the default api key.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetDefaultKeyAsync(this IApiKeysOperations operations, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.GetDefaultKeyWithHttpMessagesAsync(resourceGroupName, monitorName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Set the default api key.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- ///
- ///
- public static void SetDefaultKey(this IApiKeysOperations operations, string resourceGroupName, string monitorName, DatadogApiKey body = default(DatadogApiKey))
- {
- operations.SetDefaultKeyAsync(resourceGroupName, monitorName, body).GetAwaiter().GetResult();
- }
-
- ///
- /// Set the default api key.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- ///
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task SetDefaultKeyAsync(this IApiKeysOperations operations, string resourceGroupName, string monitorName, DatadogApiKey body = default(DatadogApiKey), CancellationToken cancellationToken = default(CancellationToken))
- {
- (await operations.SetDefaultKeyWithHttpMessagesAsync(resourceGroupName, monitorName, body, null, cancellationToken).ConfigureAwait(false)).Dispose();
- }
-
- ///
- /// List the api keys for a given monitor resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- public static IPage ListNext(this IApiKeysOperations operations, string nextPageLink)
- {
- return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
- }
-
- ///
- /// List the api keys for a given monitor resource.
- ///
- ///
- /// 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 IApiKeysOperations 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/HostsOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/HostsOperations.cs
deleted file mode 100644
index ed1219877a563..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/HostsOperations.cs
+++ /dev/null
@@ -1,420 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- 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;
-
- ///
- /// HostsOperations operations.
- ///
- internal partial class HostsOperations : IServiceOperations, IHostsOperations
- {
- ///
- /// Initializes a new instance of the HostsOperations class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- internal HostsOperations(MicrosoftDatadogClient client)
- {
- if (client == null)
- {
- throw new System.ArgumentNullException("client");
- }
- Client = client;
- }
-
- ///
- /// Gets a reference to the MicrosoftDatadogClient
- ///
- public MicrosoftDatadogClient Client { get; private set; }
-
- ///
- /// List the hosts for a given monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, 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 (monitorName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "monitorName");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("monitorName", monitorName);
- 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{monitorName}", System.Uri.EscapeDataString(monitorName));
- 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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;
- }
-
- ///
- /// List the hosts for a given monitor resource.
- ///
- ///
- /// 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/HostsOperationsExtensions.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/HostsOperationsExtensions.cs
deleted file mode 100644
index 44029db154e8a..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/HostsOperationsExtensions.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// Extension methods for HostsOperations.
- ///
- public static partial class HostsOperationsExtensions
- {
- ///
- /// List the hosts for a given monitor resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- public static IPage List(this IHostsOperations operations, string resourceGroupName, string monitorName)
- {
- return operations.ListAsync(resourceGroupName, monitorName).GetAwaiter().GetResult();
- }
-
- ///
- /// List the hosts for a given monitor resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this IHostsOperations operations, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, monitorName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// List the hosts for a given monitor resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- public static IPage ListNext(this IHostsOperations operations, string nextPageLink)
- {
- return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
- }
-
- ///
- /// List the hosts for a given monitor resource.
- ///
- ///
- /// 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 IHostsOperations 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IApiKeysOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IApiKeysOperations.cs
deleted file mode 100644
index f41c56a87efe0..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IApiKeysOperations.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// ApiKeysOperations operations.
- ///
- public partial interface IApiKeysOperations
- {
- ///
- /// List the api keys for a given monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get the default api key.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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> GetDefaultKeyWithHttpMessagesAsync(string resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Set the default api key.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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 SetDefaultKeyWithHttpMessagesAsync(string resourceGroupName, string monitorName, DatadogApiKey body = default(DatadogApiKey), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// List the api keys for a given monitor resource.
- ///
- ///
- /// 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IHostsOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IHostsOperations.cs
deleted file mode 100644
index c715ef29b2e45..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IHostsOperations.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// HostsOperations operations.
- ///
- public partial interface IHostsOperations
- {
- ///
- /// List the hosts for a given monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// List the hosts for a given monitor resource.
- ///
- ///
- /// 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ILinkedResourcesOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ILinkedResourcesOperations.cs
deleted file mode 100644
index 4db15d26a5c1c..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ILinkedResourcesOperations.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// LinkedResourcesOperations operations.
- ///
- public partial interface ILinkedResourcesOperations
- {
- ///
- /// List all Azure resources associated to the same Datadog
- /// organization as the target resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// List all Azure resources associated to the same Datadog
- /// organization as the target resource.
- ///
- ///
- /// 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IMicrosoftDatadogClient.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IMicrosoftDatadogClient.cs
deleted file mode 100644
index c545fa3335702..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IMicrosoftDatadogClient.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using Newtonsoft.Json;
-
- ///
- ///
- public partial interface IMicrosoftDatadogClient : 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; }
-
- ///
- /// The Microsoft Azure subscription ID.
- ///
- string SubscriptionId { get; set; }
-
- ///
- /// The API version to use for this operation.
- ///
- string ApiVersion { get; }
-
- ///
- /// 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 IApiKeysOperations.
- ///
- IApiKeysOperations ApiKeys { get; }
-
- ///
- /// Gets the IHostsOperations.
- ///
- IHostsOperations Hosts { get; }
-
- ///
- /// Gets the ILinkedResourcesOperations.
- ///
- ILinkedResourcesOperations LinkedResources { get; }
-
- ///
- /// Gets the IMonitoredResourcesOperations.
- ///
- IMonitoredResourcesOperations MonitoredResources { get; }
-
- ///
- /// Gets the IOperations.
- ///
- IOperations Operations { get; }
-
- ///
- /// Gets the IMonitorsOperations.
- ///
- IMonitorsOperations Monitors { get; }
-
- ///
- /// Gets the IRefreshSetPasswordOperations.
- ///
- IRefreshSetPasswordOperations RefreshSetPassword { get; }
-
- ///
- /// Gets the ITagRulesOperations.
- ///
- ITagRulesOperations TagRules { get; }
-
- ///
- /// Gets the ISingleSignOnConfigurationsOperations.
- ///
- ISingleSignOnConfigurationsOperations SingleSignOnConfigurations { get; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IMonitoredResourcesOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IMonitoredResourcesOperations.cs
deleted file mode 100644
index 1f10b2a0bc604..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IMonitoredResourcesOperations.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// MonitoredResourcesOperations operations.
- ///
- public partial interface IMonitoredResourcesOperations
- {
- ///
- /// List the resources currently being monitored by the Datadog monitor
- /// resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// List the resources currently being monitored by the Datadog monitor
- /// resource.
- ///
- ///
- /// 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IMonitorsOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IMonitorsOperations.cs
deleted file mode 100644
index 5b573323c75ed..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IMonitorsOperations.cs
+++ /dev/null
@@ -1,269 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// MonitorsOperations operations.
- ///
- public partial interface IMonitorsOperations
- {
- ///
- /// List all monitors under the specified subscription.
- ///
- ///
- /// 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));
- ///
- /// List all monitors under the specified resource group.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get the properties of a specific monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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 resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Create a monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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> CreateWithHttpMessagesAsync(string resourceGroupName, string monitorName, DatadogMonitorResource body = default(DatadogMonitorResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Update a monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string monitorName, DatadogMonitorResourceUpdateParameters body = default(DatadogMonitorResourceUpdateParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Delete a monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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 resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Create a monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string monitorName, DatadogMonitorResource body = default(DatadogMonitorResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Delete a monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// List all monitors under the specified subscription.
- ///
- ///
- /// 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));
- ///
- /// List all monitors under the specified resource group.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IOperations.cs
deleted file mode 100644
index e5846ca36703a..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IOperations.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- 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
- {
- ///
- /// List all operations provided by Microsoft.Datadog for the
- /// 2020-02-01-preview api version.
- ///
- ///
- /// 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));
- ///
- /// List all operations provided by Microsoft.Datadog for the
- /// 2020-02-01-preview api version.
- ///
- ///
- /// 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IRefreshSetPasswordOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IRefreshSetPasswordOperations.cs
deleted file mode 100644
index c95070e8df9bc..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/IRefreshSetPasswordOperations.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// RefreshSetPasswordOperations operations.
- ///
- public partial interface IRefreshSetPasswordOperations
- {
- ///
- /// Refresh the set password link and return a latest one.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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 resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ISingleSignOnConfigurationsOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ISingleSignOnConfigurationsOperations.cs
deleted file mode 100644
index 176d2bc8cd65e..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ISingleSignOnConfigurationsOperations.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// SingleSignOnConfigurationsOperations operations.
- ///
- public partial interface ISingleSignOnConfigurationsOperations
- {
- ///
- /// List the single sign-on configurations for a given monitor
- /// resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Configures single-sign-on for this resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string monitorName, string configurationName, DatadogSingleSignOnProperties properties = default(DatadogSingleSignOnProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Gets the datadog single sign-on resource for the given Monitor.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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 resourceGroupName, string monitorName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Configures single-sign-on for this resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string monitorName, string configurationName, DatadogSingleSignOnProperties properties = default(DatadogSingleSignOnProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// List the single sign-on configurations for a given monitor
- /// resource.
- ///
- ///
- /// 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ITagRulesOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ITagRulesOperations.cs
deleted file mode 100644
index 0befb5e6db1d7..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/ITagRulesOperations.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// TagRulesOperations operations.
- ///
- public partial interface ITagRulesOperations
- {
- ///
- /// List the tag rules for a given monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Create or update a tag rule set for a given monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string monitorName, string ruleSetName, MonitoringTagRulesProperties properties = default(MonitoringTagRulesProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get a tag rule set for a given monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource
- /// belongs.
- ///
- ///
- /// Monitor resource 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 resourceGroupName, string monitorName, string ruleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// List the tag rules for a given monitor resource.
- ///
- ///
- /// 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/LinkedResourcesOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/LinkedResourcesOperations.cs
deleted file mode 100644
index 895cfe9333317..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/LinkedResourcesOperations.cs
+++ /dev/null
@@ -1,422 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- 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;
-
- ///
- /// LinkedResourcesOperations operations.
- ///
- internal partial class LinkedResourcesOperations : IServiceOperations, ILinkedResourcesOperations
- {
- ///
- /// Initializes a new instance of the LinkedResourcesOperations class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- internal LinkedResourcesOperations(MicrosoftDatadogClient client)
- {
- if (client == null)
- {
- throw new System.ArgumentNullException("client");
- }
- Client = client;
- }
-
- ///
- /// Gets a reference to the MicrosoftDatadogClient
- ///
- public MicrosoftDatadogClient Client { get; private set; }
-
- ///
- /// List all Azure resources associated to the same Datadog organization as the
- /// target resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, 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 (monitorName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "monitorName");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("monitorName", monitorName);
- 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{monitorName}", System.Uri.EscapeDataString(monitorName));
- 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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;
- }
-
- ///
- /// List all Azure resources associated to the same Datadog organization as the
- /// target resource.
- ///
- ///
- /// 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/LinkedResourcesOperationsExtensions.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/LinkedResourcesOperationsExtensions.cs
deleted file mode 100644
index befe4e89caefe..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/LinkedResourcesOperationsExtensions.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// Extension methods for LinkedResourcesOperations.
- ///
- public static partial class LinkedResourcesOperationsExtensions
- {
- ///
- /// List all Azure resources associated to the same Datadog organization as the
- /// target resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- public static IPage List(this ILinkedResourcesOperations operations, string resourceGroupName, string monitorName)
- {
- return operations.ListAsync(resourceGroupName, monitorName).GetAwaiter().GetResult();
- }
-
- ///
- /// List all Azure resources associated to the same Datadog organization as the
- /// target resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this ILinkedResourcesOperations operations, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, monitorName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// List all Azure resources associated to the same Datadog organization as the
- /// target resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- public static IPage ListNext(this ILinkedResourcesOperations operations, string nextPageLink)
- {
- return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
- }
-
- ///
- /// List all Azure resources associated to the same Datadog organization as the
- /// target resource.
- ///
- ///
- /// 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 ILinkedResourcesOperations 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MicrosoftDatadogClient.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MicrosoftDatadogClient.cs
deleted file mode 100644
index bbbac3388bcd5..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MicrosoftDatadogClient.cs
+++ /dev/null
@@ -1,403 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- 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 MicrosoftDatadogClient : ServiceClient, IMicrosoftDatadogClient, 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; }
-
- ///
- /// The Microsoft Azure subscription ID.
- ///
- public string SubscriptionId { get; set; }
-
- ///
- /// The API version to use for this operation.
- ///
- public string ApiVersion { get; private 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 IApiKeysOperations.
- ///
- public virtual IApiKeysOperations ApiKeys { get; private set; }
-
- ///
- /// Gets the IHostsOperations.
- ///
- public virtual IHostsOperations Hosts { get; private set; }
-
- ///
- /// Gets the ILinkedResourcesOperations.
- ///
- public virtual ILinkedResourcesOperations LinkedResources { get; private set; }
-
- ///
- /// Gets the IMonitoredResourcesOperations.
- ///
- public virtual IMonitoredResourcesOperations MonitoredResources { get; private set; }
-
- ///
- /// Gets the IOperations.
- ///
- public virtual IOperations Operations { get; private set; }
-
- ///
- /// Gets the IMonitorsOperations.
- ///
- public virtual IMonitorsOperations Monitors { get; private set; }
-
- ///
- /// Gets the IRefreshSetPasswordOperations.
- ///
- public virtual IRefreshSetPasswordOperations RefreshSetPassword { get; private set; }
-
- ///
- /// Gets the ITagRulesOperations.
- ///
- public virtual ITagRulesOperations TagRules { get; private set; }
-
- ///
- /// Gets the ISingleSignOnConfigurationsOperations.
- ///
- public virtual ISingleSignOnConfigurationsOperations SingleSignOnConfigurations { get; private set; }
-
- ///
- /// Initializes a new instance of the MicrosoftDatadogClient class.
- ///
- ///
- /// HttpClient to be used
- ///
- ///
- /// True: will dispose the provided httpClient on calling MicrosoftDatadogClient.Dispose(). False: will not dispose provided httpClient
- protected MicrosoftDatadogClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
- {
- Initialize();
- }
-
- ///
- /// Initializes a new instance of the MicrosoftDatadogClient class.
- ///
- ///
- /// Optional. The delegating handlers to add to the http client pipeline.
- ///
- protected MicrosoftDatadogClient(params DelegatingHandler[] handlers) : base(handlers)
- {
- Initialize();
- }
-
- ///
- /// Initializes a new instance of the MicrosoftDatadogClient class.
- ///
- ///
- /// Optional. The http client handler used to handle http transport.
- ///
- ///
- /// Optional. The delegating handlers to add to the http client pipeline.
- ///
- protected MicrosoftDatadogClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
- {
- Initialize();
- }
-
- ///
- /// Initializes a new instance of the MicrosoftDatadogClient 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 MicrosoftDatadogClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
- {
- if (baseUri == null)
- {
- throw new System.ArgumentNullException("baseUri");
- }
- BaseUri = baseUri;
- }
-
- ///
- /// Initializes a new instance of the MicrosoftDatadogClient 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 MicrosoftDatadogClient(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 MicrosoftDatadogClient 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 MicrosoftDatadogClient(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 MicrosoftDatadogClient class.
- ///
- ///
- /// Required. Credentials needed for the client to connect to Azure.
- ///
- ///
- /// HttpClient to be used
- ///
- ///
- /// True: will dispose the provided httpClient on calling MicrosoftDatadogClient.Dispose(). False: will not dispose provided httpClient
- ///
- /// Thrown when a required parameter is null
- ///
- public MicrosoftDatadogClient(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 MicrosoftDatadogClient 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 MicrosoftDatadogClient(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 MicrosoftDatadogClient 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 MicrosoftDatadogClient(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 MicrosoftDatadogClient 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 MicrosoftDatadogClient(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()
- {
- ApiKeys = new ApiKeysOperations(this);
- Hosts = new HostsOperations(this);
- LinkedResources = new LinkedResourcesOperations(this);
- MonitoredResources = new MonitoredResourcesOperations(this);
- Operations = new Operations(this);
- Monitors = new MonitorsOperations(this);
- RefreshSetPassword = new RefreshSetPasswordOperations(this);
- TagRules = new TagRulesOperations(this);
- SingleSignOnConfigurations = new SingleSignOnConfigurationsOperations(this);
- BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2020-02-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()
- }
- };
- 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 CloudErrorJsonConverter());
- }
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogApiKey.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogApiKey.cs
deleted file mode 100644
index 05c6ca54d6072..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogApiKey.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class DatadogApiKey
- {
- ///
- /// Initializes a new instance of the DatadogApiKey class.
- ///
- public DatadogApiKey()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogApiKey class.
- ///
- /// The value of the API key.
- /// The user that created the API key.
- /// The name of the API key.
- /// The time of creation of the API key.
- public DatadogApiKey(string key, string createdBy = default(string), string name = default(string), string created = default(string))
- {
- CreatedBy = createdBy;
- Name = name;
- Key = key;
- Created = created;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets the user that created the API key.
- ///
- [JsonProperty(PropertyName = "createdBy")]
- public string CreatedBy { get; set; }
-
- ///
- /// Gets or sets the name of the API key.
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; set; }
-
- ///
- /// Gets or sets the value of the API key.
- ///
- [JsonProperty(PropertyName = "key")]
- public string Key { get; set; }
-
- ///
- /// Gets or sets the time of creation of the API key.
- ///
- [JsonProperty(PropertyName = "created")]
- public string Created { get; set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (Key == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "Key");
- }
- }
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogHost.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogHost.cs
deleted file mode 100644
index b21a035e64557..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogHost.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- public partial class DatadogHost
- {
- ///
- /// Initializes a new instance of the DatadogHost class.
- ///
- public DatadogHost()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogHost class.
- ///
- /// The name of the host.
- /// The aliases for the host.
- /// The Datadog integrations reporting metrics for
- /// the host.
- public DatadogHost(string name = default(string), IList aliases = default(IList), IList apps = default(IList), DatadogHostMetadata meta = default(DatadogHostMetadata))
- {
- Name = name;
- Aliases = aliases;
- Apps = apps;
- Meta = meta;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets the name of the host.
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; set; }
-
- ///
- /// Gets or sets the aliases for the host.
- ///
- [JsonProperty(PropertyName = "aliases")]
- public IList Aliases { get; set; }
-
- ///
- /// Gets or sets the Datadog integrations reporting metrics for the
- /// host.
- ///
- [JsonProperty(PropertyName = "apps")]
- public IList Apps { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "meta")]
- public DatadogHostMetadata Meta { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogHostMetadata.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogHostMetadata.cs
deleted file mode 100644
index 803143063431b..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogHostMetadata.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class DatadogHostMetadata
- {
- ///
- /// Initializes a new instance of the DatadogHostMetadata class.
- ///
- public DatadogHostMetadata()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogHostMetadata class.
- ///
- /// The agent version.
- public DatadogHostMetadata(string agentVersion = default(string), DatadogInstallMethod installMethod = default(DatadogInstallMethod), DatadogLogsAgent logsAgent = default(DatadogLogsAgent))
- {
- AgentVersion = agentVersion;
- InstallMethod = installMethod;
- LogsAgent = logsAgent;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets the agent version.
- ///
- [JsonProperty(PropertyName = "agentVersion")]
- public string AgentVersion { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "installMethod")]
- public DatadogInstallMethod InstallMethod { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "logsAgent")]
- public DatadogLogsAgent LogsAgent { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogInstallMethod.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogInstallMethod.cs
deleted file mode 100644
index 15d8d90821cd6..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogInstallMethod.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class DatadogInstallMethod
- {
- ///
- /// Initializes a new instance of the DatadogInstallMethod class.
- ///
- public DatadogInstallMethod()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogInstallMethod class.
- ///
- /// The tool.
- /// The tool version.
- /// The installer version.
- public DatadogInstallMethod(string tool = default(string), string toolVersion = default(string), string installerVersion = default(string))
- {
- Tool = tool;
- ToolVersion = toolVersion;
- InstallerVersion = installerVersion;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets the tool.
- ///
- [JsonProperty(PropertyName = "tool")]
- public string Tool { get; set; }
-
- ///
- /// Gets or sets the tool version.
- ///
- [JsonProperty(PropertyName = "toolVersion")]
- public string ToolVersion { get; set; }
-
- ///
- /// Gets or sets the installer version.
- ///
- [JsonProperty(PropertyName = "installerVersion")]
- public string InstallerVersion { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogLogsAgent.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogLogsAgent.cs
deleted file mode 100644
index 73e14d1f319c3..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogLogsAgent.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class DatadogLogsAgent
- {
- ///
- /// Initializes a new instance of the DatadogLogsAgent class.
- ///
- public DatadogLogsAgent()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogLogsAgent class.
- ///
- /// The transport.
- public DatadogLogsAgent(string transport = default(string))
- {
- Transport = transport;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets the transport.
- ///
- [JsonProperty(PropertyName = "transport")]
- public string Transport { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogMonitorResource.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogMonitorResource.cs
deleted file mode 100644
index d779b00507b45..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogMonitorResource.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- public partial class DatadogMonitorResource : IResource
- {
- ///
- /// Initializes a new instance of the DatadogMonitorResource class.
- ///
- public DatadogMonitorResource()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogMonitorResource class.
- ///
- /// ARM id of the monitor resource.
- /// Name of the monitor resource.
- /// The type of the monitor resource.
- public DatadogMonitorResource(string location, string id = default(string), string name = default(string), string type = default(string), ResourceSku sku = default(ResourceSku), MonitorProperties properties = default(MonitorProperties), IdentityProperties identity = default(IdentityProperties), IDictionary tags = default(IDictionary))
- {
- Id = id;
- Name = name;
- Type = type;
- Sku = sku;
- Properties = properties;
- Identity = identity;
- Tags = tags;
- Location = location;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets ARM id of the monitor resource.
- ///
- [JsonProperty(PropertyName = "id")]
- public string Id { get; private set; }
-
- ///
- /// Gets name of the monitor resource.
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; private set; }
-
- ///
- /// Gets the type of the monitor resource.
- ///
- [JsonProperty(PropertyName = "type")]
- public string Type { get; private set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "sku")]
- public ResourceSku Sku { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "properties")]
- public MonitorProperties Properties { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "identity")]
- public IdentityProperties Identity { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "tags")]
- public IDictionary Tags { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "location")]
- public string Location { get; set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (Location == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "Location");
- }
- if (Sku != null)
- {
- Sku.Validate();
- }
- if (Properties != null)
- {
- Properties.Validate();
- }
- }
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogMonitorResourceUpdateParameters.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogMonitorResourceUpdateParameters.cs
deleted file mode 100644
index cccfd4d63c7ae..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogMonitorResourceUpdateParameters.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// The parameters for a PATCH request to a monitor resource.
- ///
- public partial class DatadogMonitorResourceUpdateParameters
- {
- ///
- /// Initializes a new instance of the
- /// DatadogMonitorResourceUpdateParameters class.
- ///
- public DatadogMonitorResourceUpdateParameters()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the
- /// DatadogMonitorResourceUpdateParameters class.
- ///
- /// The new tags of the monitor resource.
- public DatadogMonitorResourceUpdateParameters(MonitorUpdateProperties properties = default(MonitorUpdateProperties), IDictionary tags = default(IDictionary))
- {
- Properties = properties;
- Tags = tags;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- ///
- [JsonProperty(PropertyName = "properties")]
- public MonitorUpdateProperties Properties { get; set; }
-
- ///
- /// Gets or sets the new tags of the monitor resource.
- ///
- [JsonProperty(PropertyName = "tags")]
- public IDictionary Tags { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogOrganizationProperties.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogOrganizationProperties.cs
deleted file mode 100644
index 461996f98473d..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogOrganizationProperties.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class DatadogOrganizationProperties
- {
- ///
- /// Initializes a new instance of the DatadogOrganizationProperties
- /// class.
- ///
- public DatadogOrganizationProperties()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogOrganizationProperties
- /// class.
- ///
- /// Name of the Datadog organization.
- /// Id of the Datadog organization.
- /// The auth code used to linking to an
- /// existing datadog organization.
- /// The client_id from an existing in
- /// exchange for an auth token to link organization.
- /// The Id of the Enterprise App used for
- /// Single sign on.
- public DatadogOrganizationProperties(string name = default(string), string id = default(string), string linkingAuthCode = default(string), string linkingClientId = default(string), string enterpriseAppId = default(string))
- {
- Name = name;
- Id = id;
- LinkingAuthCode = linkingAuthCode;
- LinkingClientId = linkingClientId;
- EnterpriseAppId = enterpriseAppId;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets name of the Datadog organization.
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; private set; }
-
- ///
- /// Gets id of the Datadog organization.
- ///
- [JsonProperty(PropertyName = "id")]
- public string Id { get; private set; }
-
- ///
- /// Gets or sets the auth code used to linking to an existing datadog
- /// organization.
- ///
- [JsonProperty(PropertyName = "linkingAuthCode")]
- public string LinkingAuthCode { get; set; }
-
- ///
- /// Gets or sets the client_id from an existing in exchange for an auth
- /// token to link organization.
- ///
- [JsonProperty(PropertyName = "linkingClientId")]
- public string LinkingClientId { get; set; }
-
- ///
- /// Gets or sets the Id of the Enterprise App used for Single sign on.
- ///
- [JsonProperty(PropertyName = "enterpriseAppId")]
- public string EnterpriseAppId { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogSetPasswordLink.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogSetPasswordLink.cs
deleted file mode 100644
index 901692f7f040c..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogSetPasswordLink.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class DatadogSetPasswordLink
- {
- ///
- /// Initializes a new instance of the DatadogSetPasswordLink class.
- ///
- public DatadogSetPasswordLink()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogSetPasswordLink class.
- ///
- public DatadogSetPasswordLink(string setPasswordLink = default(string))
- {
- SetPasswordLink = setPasswordLink;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- ///
- [JsonProperty(PropertyName = "setPasswordLink")]
- public string SetPasswordLink { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.cs
deleted file mode 100644
index d61ed71857eae..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class DatadogSingleSignOnProperties
- {
- ///
- /// Initializes a new instance of the DatadogSingleSignOnProperties
- /// class.
- ///
- public DatadogSingleSignOnProperties()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogSingleSignOnProperties
- /// class.
- ///
- /// Possible values include: 'Initial',
- /// 'Enable', 'Disable', 'Existing'
- /// The Id of the Enterprise App used for
- /// Single sign-on.
- /// The login URL specific to this
- /// Datadog Organization.
- public DatadogSingleSignOnProperties(string singleSignOnState = default(string), string enterpriseAppId = default(string), string singleSignOnUrl = default(string))
- {
- SingleSignOnState = singleSignOnState;
- EnterpriseAppId = enterpriseAppId;
- SingleSignOnUrl = singleSignOnUrl;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets possible values include: 'Initial', 'Enable',
- /// 'Disable', 'Existing'
- ///
- [JsonProperty(PropertyName = "singleSignOnState")]
- public string SingleSignOnState { get; set; }
-
- ///
- /// Gets or sets the Id of the Enterprise App used for Single sign-on.
- ///
- [JsonProperty(PropertyName = "enterpriseAppId")]
- public string EnterpriseAppId { get; set; }
-
- ///
- /// Gets or sets the login URL specific to this Datadog Organization.
- ///
- [JsonProperty(PropertyName = "singleSignOnUrl")]
- public string SingleSignOnUrl { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogSingleSignOnResource.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogSingleSignOnResource.cs
deleted file mode 100644
index f18d9af0b5d69..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/DatadogSingleSignOnResource.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class DatadogSingleSignOnResource : IResource
- {
- ///
- /// Initializes a new instance of the DatadogSingleSignOnResource
- /// class.
- ///
- public DatadogSingleSignOnResource()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the DatadogSingleSignOnResource
- /// class.
- ///
- /// ARM id of the resource.
- /// Name of the configuration.
- /// The type of the resource.
- public DatadogSingleSignOnResource(string id = default(string), string name = default(string), string type = default(string), DatadogSingleSignOnProperties properties = default(DatadogSingleSignOnProperties))
- {
- Id = id;
- Name = name;
- Type = type;
- Properties = properties;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets ARM id of the resource.
- ///
- [JsonProperty(PropertyName = "id")]
- public string Id { get; private set; }
-
- ///
- /// Gets name of the configuration.
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; private set; }
-
- ///
- /// Gets the type of the resource.
- ///
- [JsonProperty(PropertyName = "type")]
- public string Type { get; private set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "properties")]
- public DatadogSingleSignOnProperties Properties { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ErrorResponseBody.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ErrorResponseBody.cs
deleted file mode 100644
index 6bc9344ead5d9..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ErrorResponseBody.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- public partial class ErrorResponseBody
- {
- ///
- /// Initializes a new instance of the ErrorResponseBody class.
- ///
- public ErrorResponseBody()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the ErrorResponseBody class.
- ///
- public ErrorResponseBody(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();
-
- ///
- ///
- [JsonProperty(PropertyName = "code")]
- public string Code { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "message")]
- public string Message { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "target")]
- public string Target { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "details")]
- public IList Details { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/FilteringTag.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/FilteringTag.cs
deleted file mode 100644
index c114f88cbbcab..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/FilteringTag.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// The definition of a filtering tag. Filtering tags are used for
- /// capturing resources and include/exclude them from being monitored.
- ///
- public partial class FilteringTag
- {
- ///
- /// Initializes a new instance of the FilteringTag class.
- ///
- public FilteringTag()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the FilteringTag class.
- ///
- /// The name (also known as the key) of the
- /// tag.
- /// The value of the tag.
- /// Possible values include: 'Include',
- /// 'Exclude'
- public FilteringTag(string name = default(string), string value = default(string), string action = default(string))
- {
- Name = name;
- Value = value;
- Action = action;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets the name (also known as the key) of the tag.
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; set; }
-
- ///
- /// Gets or sets the value of the tag.
- ///
- [JsonProperty(PropertyName = "value")]
- public string Value { get; set; }
-
- ///
- /// Gets or sets possible values include: 'Include', 'Exclude'
- ///
- [JsonProperty(PropertyName = "action")]
- public string Action { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/IdentityProperties.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/IdentityProperties.cs
deleted file mode 100644
index 649e00dfcdad7..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/IdentityProperties.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class IdentityProperties
- {
- ///
- /// Initializes a new instance of the IdentityProperties class.
- ///
- public IdentityProperties()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the IdentityProperties class.
- ///
- /// The identity ID.
- /// The tenant ID of resource.
- /// Possible values include: 'SystemAssigned',
- /// 'UserAssigned'
- public IdentityProperties(string principalId = default(string), string tenantId = default(string), string type = default(string))
- {
- PrincipalId = principalId;
- TenantId = tenantId;
- Type = type;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets the identity ID.
- ///
- [JsonProperty(PropertyName = "principalId")]
- public string PrincipalId { get; private set; }
-
- ///
- /// Gets the tenant ID of resource.
- ///
- [JsonProperty(PropertyName = "tenantId")]
- public string TenantId { get; private set; }
-
- ///
- /// Gets or sets possible values include: 'SystemAssigned',
- /// 'UserAssigned'
- ///
- [JsonProperty(PropertyName = "type")]
- public string Type { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/LiftrResourceCategories.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/LiftrResourceCategories.cs
deleted file mode 100644
index 1ffbd9a0fd60f..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/LiftrResourceCategories.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
-
- ///
- /// Defines values for LiftrResourceCategories.
- ///
- public static class LiftrResourceCategories
- {
- public const string Unknown = "Unknown";
- public const string MonitorLogs = "MonitorLogs";
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/LinkedResource.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/LinkedResource.cs
deleted file mode 100644
index 3463829a55ee5..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/LinkedResource.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// The definition of a linked resource.
- ///
- public partial class LinkedResource
- {
- ///
- /// Initializes a new instance of the LinkedResource class.
- ///
- public LinkedResource()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the LinkedResource class.
- ///
- /// The ARM id of the linked resource.
- public LinkedResource(string id = default(string))
- {
- Id = id;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets the ARM id of the linked resource.
- ///
- [JsonProperty(PropertyName = "id")]
- public string Id { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/LogRules.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/LogRules.cs
deleted file mode 100644
index 6eff70a787a96..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/LogRules.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// Set of rules for sending logs for the Monitor resource.
- ///
- public partial class LogRules
- {
- ///
- /// Initializes a new instance of the LogRules class.
- ///
- public LogRules()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the LogRules class.
- ///
- /// Flag specifying if AAD logs should be
- /// sent for the Monitor resource.
- /// Flag specifying if Azure
- /// subscription logs should be sent for the Monitor resource.
- /// Flag specifying if Azure resource
- /// logs should be sent for the Monitor resource.
- /// List of filtering tags to be used for
- /// capturing logs. This only takes effect if SendResourceLogs flag is
- /// enabled. If empty, all resources will be captured. If only Exclude
- /// action is specified, the rules will apply to the list of all
- /// available resources. If Include actions are specified, the rules
- /// will only include resources with the associated tags.
- public LogRules(bool? sendAadLogs = default(bool?), bool? sendSubscriptionLogs = default(bool?), bool? sendResourceLogs = default(bool?), IList filteringTags = default(IList))
- {
- SendAadLogs = sendAadLogs;
- SendSubscriptionLogs = sendSubscriptionLogs;
- SendResourceLogs = sendResourceLogs;
- FilteringTags = filteringTags;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets flag specifying if AAD logs should be sent for the
- /// Monitor resource.
- ///
- [JsonProperty(PropertyName = "sendAadLogs")]
- public bool? SendAadLogs { get; set; }
-
- ///
- /// Gets or sets flag specifying if Azure subscription logs should be
- /// sent for the Monitor resource.
- ///
- [JsonProperty(PropertyName = "sendSubscriptionLogs")]
- public bool? SendSubscriptionLogs { get; set; }
-
- ///
- /// Gets or sets flag specifying if Azure resource logs should be sent
- /// for the Monitor resource.
- ///
- [JsonProperty(PropertyName = "sendResourceLogs")]
- public bool? SendResourceLogs { get; set; }
-
- ///
- /// Gets or sets list of filtering tags to be used for capturing logs.
- /// This only takes effect if SendResourceLogs flag is enabled. If
- /// empty, all resources will be captured. If only Exclude action is
- /// specified, the rules will apply to the list of all available
- /// resources. If Include actions are specified, the rules will only
- /// include resources with the associated tags.
- ///
- [JsonProperty(PropertyName = "filteringTags")]
- public IList FilteringTags { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ManagedIdentityTypes.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ManagedIdentityTypes.cs
deleted file mode 100644
index e6626ef4c6b69..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ManagedIdentityTypes.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
-
- ///
- /// Defines values for ManagedIdentityTypes.
- ///
- public static class ManagedIdentityTypes
- {
- public const string SystemAssigned = "SystemAssigned";
- public const string UserAssigned = "UserAssigned";
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MarketplaceSubscriptionStatus.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MarketplaceSubscriptionStatus.cs
deleted file mode 100644
index 7ca947d6e37a8..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MarketplaceSubscriptionStatus.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
-
- ///
- /// Defines values for MarketplaceSubscriptionStatus.
- ///
- public static class MarketplaceSubscriptionStatus
- {
- public const string Active = "Active";
- public const string Suspended = "Suspended";
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MetricRules.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MetricRules.cs
deleted file mode 100644
index 32b90a585d5ec..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MetricRules.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// Set of rules for sending metrics for the Monitor resource.
- ///
- public partial class MetricRules
- {
- ///
- /// Initializes a new instance of the MetricRules class.
- ///
- public MetricRules()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the MetricRules class.
- ///
- /// List of filtering tags to be used for
- /// capturing metrics. If empty, all resources will be captured. If
- /// only Exclude action is specified, the rules will apply to the list
- /// of all available resources. If Include actions are specified, the
- /// rules will only include resources with the associated tags.
- public MetricRules(IList filteringTags = default(IList))
- {
- FilteringTags = filteringTags;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets list of filtering tags to be used for capturing
- /// metrics. If empty, all resources will be captured. If only Exclude
- /// action is specified, the rules will apply to the list of all
- /// available resources. If Include actions are specified, the rules
- /// will only include resources with the associated tags.
- ///
- [JsonProperty(PropertyName = "filteringTags")]
- public IList FilteringTags { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitorProperties.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitorProperties.cs
deleted file mode 100644
index 7f124a490d6b2..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitorProperties.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// Properties specific to the monitor resource.
- ///
- public partial class MonitorProperties
- {
- ///
- /// Initializes a new instance of the MonitorProperties class.
- ///
- public MonitorProperties()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the MonitorProperties class.
- ///
- /// Possible values include:
- /// 'Accepted', 'Creating', 'Updating', 'Deleting', 'Succeeded',
- /// 'Failed', 'Canceled', 'Deleted', 'NotSpecified'
- /// Possible values include: 'Enabled',
- /// 'Disabled'
- /// Possible values
- /// include: 'Active', 'Suspended'
- /// Possible values include:
- /// 'Unknown', 'MonitorLogs'
- /// The priority of the
- /// resource.
- public MonitorProperties(string provisioningState = default(string), string monitoringStatus = default(string), string marketplaceSubscriptionStatus = default(string), DatadogOrganizationProperties datadogOrganizationProperties = default(DatadogOrganizationProperties), UserInfo userInfo = default(UserInfo), string liftrResourceCategory = default(string), int? liftrResourcePreference = default(int?))
- {
- ProvisioningState = provisioningState;
- MonitoringStatus = monitoringStatus;
- MarketplaceSubscriptionStatus = marketplaceSubscriptionStatus;
- DatadogOrganizationProperties = datadogOrganizationProperties;
- UserInfo = userInfo;
- LiftrResourceCategory = liftrResourceCategory;
- LiftrResourcePreference = liftrResourcePreference;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets possible values include: 'Accepted', 'Creating',
- /// 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled',
- /// 'Deleted', 'NotSpecified'
- ///
- [JsonProperty(PropertyName = "provisioningState")]
- public string ProvisioningState { get; set; }
-
- ///
- /// Gets or sets possible values include: 'Enabled', 'Disabled'
- ///
- [JsonProperty(PropertyName = "monitoringStatus")]
- public string MonitoringStatus { get; set; }
-
- ///
- /// Gets or sets possible values include: 'Active', 'Suspended'
- ///
- [JsonProperty(PropertyName = "marketplaceSubscriptionStatus")]
- public string MarketplaceSubscriptionStatus { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "datadogOrganizationProperties")]
- public DatadogOrganizationProperties DatadogOrganizationProperties { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "userInfo")]
- public UserInfo UserInfo { get; set; }
-
- ///
- /// Gets or sets possible values include: 'Unknown', 'MonitorLogs'
- ///
- [JsonProperty(PropertyName = "liftrResourceCategory")]
- public string LiftrResourceCategory { get; set; }
-
- ///
- /// Gets the priority of the resource.
- ///
- [JsonProperty(PropertyName = "liftrResourcePreference")]
- public int? LiftrResourcePreference { get; private set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (UserInfo != null)
- {
- UserInfo.Validate();
- }
- }
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitorUpdateProperties.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitorUpdateProperties.cs
deleted file mode 100644
index 3ecb045c2166e..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitorUpdateProperties.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// The set of properties that can be update in a PATCH request to a
- /// monitor resource.
- ///
- public partial class MonitorUpdateProperties
- {
- ///
- /// Initializes a new instance of the MonitorUpdateProperties class.
- ///
- public MonitorUpdateProperties()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the MonitorUpdateProperties class.
- ///
- /// Possible values include: 'Enabled',
- /// 'Disabled'
- public MonitorUpdateProperties(string monitoringStatus = default(string))
- {
- MonitoringStatus = monitoringStatus;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets possible values include: 'Enabled', 'Disabled'
- ///
- [JsonProperty(PropertyName = "monitoringStatus")]
- public string MonitoringStatus { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoredResource.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoredResource.cs
deleted file mode 100644
index 028d9ed16aa8d..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoredResource.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// The properties of a resource currently being monitored by the Datadog
- /// monitor resource.
- ///
- public partial class MonitoredResource
- {
- ///
- /// Initializes a new instance of the MonitoredResource class.
- ///
- public MonitoredResource()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the MonitoredResource class.
- ///
- /// The ARM id of the resource.
- /// Flag indicating if resource is sending
- /// metrics to Datadog.
- /// Reason for why the resource is
- /// sending metrics (or why it is not sending).
- /// Flag indicating if resource is sending
- /// logs to Datadog.
- /// Reason for why the resource is
- /// sending logs (or why it is not sending).
- public MonitoredResource(string id = default(string), bool? sendingMetrics = default(bool?), string reasonForMetricsStatus = default(string), bool? sendingLogs = default(bool?), string reasonForLogsStatus = default(string))
- {
- Id = id;
- SendingMetrics = sendingMetrics;
- ReasonForMetricsStatus = reasonForMetricsStatus;
- SendingLogs = sendingLogs;
- ReasonForLogsStatus = reasonForLogsStatus;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets the ARM id of the resource.
- ///
- [JsonProperty(PropertyName = "id")]
- public string Id { get; set; }
-
- ///
- /// Gets or sets flag indicating if resource is sending metrics to
- /// Datadog.
- ///
- [JsonProperty(PropertyName = "sendingMetrics")]
- public bool? SendingMetrics { get; set; }
-
- ///
- /// Gets or sets reason for why the resource is sending metrics (or why
- /// it is not sending).
- ///
- [JsonProperty(PropertyName = "reasonForMetricsStatus")]
- public string ReasonForMetricsStatus { get; set; }
-
- ///
- /// Gets or sets flag indicating if resource is sending logs to
- /// Datadog.
- ///
- [JsonProperty(PropertyName = "sendingLogs")]
- public bool? SendingLogs { get; set; }
-
- ///
- /// Gets or sets reason for why the resource is sending logs (or why it
- /// is not sending).
- ///
- [JsonProperty(PropertyName = "reasonForLogsStatus")]
- public string ReasonForLogsStatus { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoringStatus.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoringStatus.cs
deleted file mode 100644
index 15668e0b3857c..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoringStatus.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
-
- ///
- /// Defines values for MonitoringStatus.
- ///
- public static class MonitoringStatus
- {
- public const string Enabled = "Enabled";
- public const string Disabled = "Disabled";
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoringTagRules.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoringTagRules.cs
deleted file mode 100644
index 8d9088b8cf24a..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoringTagRules.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// Capture logs and metrics of Azure resources based on ARM tags.
- ///
- public partial class MonitoringTagRules : IResource
- {
- ///
- /// Initializes a new instance of the MonitoringTagRules class.
- ///
- public MonitoringTagRules()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the MonitoringTagRules class.
- ///
- /// Name of the rule set.
- /// The id of the rule set.
- /// The type of the rule set.
- public MonitoringTagRules(string name = default(string), string id = default(string), string type = default(string), MonitoringTagRulesProperties properties = default(MonitoringTagRulesProperties))
- {
- Name = name;
- Id = id;
- Type = type;
- Properties = properties;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets name of the rule set.
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; private set; }
-
- ///
- /// Gets the id of the rule set.
- ///
- [JsonProperty(PropertyName = "id")]
- public string Id { get; private set; }
-
- ///
- /// Gets the type of the rule set.
- ///
- [JsonProperty(PropertyName = "type")]
- public string Type { get; private set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "properties")]
- public MonitoringTagRulesProperties Properties { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoringTagRulesProperties.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoringTagRulesProperties.cs
deleted file mode 100644
index 5cf27df24b697..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/MonitoringTagRulesProperties.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// Definition of the properties for a TagRules resource.
- ///
- public partial class MonitoringTagRulesProperties
- {
- ///
- /// Initializes a new instance of the MonitoringTagRulesProperties
- /// class.
- ///
- public MonitoringTagRulesProperties()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the MonitoringTagRulesProperties
- /// class.
- ///
- public MonitoringTagRulesProperties(LogRules logRules = default(LogRules), MetricRules metricRules = default(MetricRules))
- {
- LogRules = logRules;
- MetricRules = metricRules;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- ///
- [JsonProperty(PropertyName = "logRules")]
- public LogRules LogRules { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "metricRules")]
- public MetricRules MetricRules { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/OperationDisplay.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/OperationDisplay.cs
deleted file mode 100644
index 0c1b6d0cb648f..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/OperationDisplay.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.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, i.e.,
- /// Microsoft.Datadog.
- /// Type on which the operation is performed,
- /// e.g., 'monitors'.
- /// Operation type, e.g., read, write, delete,
- /// etc.
- /// Description of the operation, e.g.,
- /// 'Write monitors'.
- public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string))
- {
- Provider = provider;
- Resource = resource;
- Operation = operation;
- Description = description;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets service provider, i.e., Microsoft.Datadog.
- ///
- [JsonProperty(PropertyName = "provider")]
- public string Provider { get; set; }
-
- ///
- /// Gets or sets type on which the operation is performed, e.g.,
- /// 'monitors'.
- ///
- [JsonProperty(PropertyName = "resource")]
- public string Resource { get; set; }
-
- ///
- /// Gets or sets operation type, e.g., read, write, delete, etc.
- ///
- [JsonProperty(PropertyName = "operation")]
- public string Operation { get; set; }
-
- ///
- /// Gets or sets description of the operation, e.g., 'Write monitors'.
- ///
- [JsonProperty(PropertyName = "description")]
- public string Description { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/OperationResult.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/OperationResult.cs
deleted file mode 100644
index c773585163462..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/OperationResult.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// A Microsoft.Datadog REST API operation.
- ///
- public partial class OperationResult
- {
- ///
- /// Initializes a new instance of the OperationResult class.
- ///
- public OperationResult()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the OperationResult class.
- ///
- /// Operation name, i.e.,
- /// {provider}/{resource}/{operation}.
- /// Indicates whether the operation is a
- /// data action
- public OperationResult(string name = default(string), OperationDisplay display = default(OperationDisplay), bool? isDataAction = default(bool?))
- {
- Name = name;
- Display = display;
- IsDataAction = isDataAction;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets operation name, i.e.,
- /// {provider}/{resource}/{operation}.
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; set; }
-
- ///
- ///
- [JsonProperty(PropertyName = "display")]
- public OperationDisplay Display { get; set; }
-
- ///
- /// Gets or sets indicates whether the operation is a data action
- ///
- [JsonProperty(PropertyName = "isDataAction")]
- public bool? IsDataAction { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/Page.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/Page.cs
deleted file mode 100644
index c2d0c32eadd01..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/Page.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ProvisioningState.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ProvisioningState.cs
deleted file mode 100644
index 4f0f988f49192..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ProvisioningState.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
-
- ///
- /// Defines values for ProvisioningState.
- ///
- public static class ProvisioningState
- {
- public const string Accepted = "Accepted";
- public const string Creating = "Creating";
- public const string Updating = "Updating";
- public const string Deleting = "Deleting";
- public const string Succeeded = "Succeeded";
- public const string Failed = "Failed";
- public const string Canceled = "Canceled";
- public const string Deleted = "Deleted";
- public const string NotSpecified = "NotSpecified";
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ResourceProviderDefaultErrorResponse.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ResourceProviderDefaultErrorResponse.cs
deleted file mode 100644
index 52bccfa4645cf..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ResourceProviderDefaultErrorResponse.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class ResourceProviderDefaultErrorResponse
- {
- ///
- /// Initializes a new instance of the
- /// ResourceProviderDefaultErrorResponse class.
- ///
- public ResourceProviderDefaultErrorResponse()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the
- /// ResourceProviderDefaultErrorResponse class.
- ///
- public ResourceProviderDefaultErrorResponse(ErrorResponseBody error = default(ErrorResponseBody))
- {
- Error = error;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- ///
- [JsonProperty(PropertyName = "error")]
- public ErrorResponseBody Error { get; set; }
-
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ResourceProviderDefaultErrorResponseException.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ResourceProviderDefaultErrorResponseException.cs
deleted file mode 100644
index 1f7bc4d63fb9b..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ResourceProviderDefaultErrorResponseException.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Microsoft.Rest;
-
- ///
- /// Exception thrown for an invalid response with
- /// ResourceProviderDefaultErrorResponse information.
- ///
- public partial class ResourceProviderDefaultErrorResponseException : 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 ResourceProviderDefaultErrorResponse Body { get; set; }
-
- ///
- /// Initializes a new instance of the ResourceProviderDefaultErrorResponseException class.
- ///
- public ResourceProviderDefaultErrorResponseException()
- {
- }
-
- ///
- /// Initializes a new instance of the ResourceProviderDefaultErrorResponseException class.
- ///
- /// The exception message.
- public ResourceProviderDefaultErrorResponseException(string message)
- : this(message, null)
- {
- }
-
- ///
- /// Initializes a new instance of the ResourceProviderDefaultErrorResponseException class.
- ///
- /// The exception message.
- /// Inner exception.
- public ResourceProviderDefaultErrorResponseException(string message, System.Exception innerException)
- : base(message, innerException)
- {
- }
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ResourceSku.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ResourceSku.cs
deleted file mode 100644
index 1da1837d4e9fe..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/ResourceSku.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class ResourceSku
- {
- ///
- /// Initializes a new instance of the ResourceSku class.
- ///
- public ResourceSku()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the ResourceSku class.
- ///
- /// Name of the SKU.
- public ResourceSku(string name)
- {
- Name = name;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets name of the SKU.
- ///
- [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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/SingleSignOnStates.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/SingleSignOnStates.cs
deleted file mode 100644
index d947c26e33261..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/SingleSignOnStates.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
-
- ///
- /// Defines values for SingleSignOnStates.
- ///
- public static class SingleSignOnStates
- {
- public const string Initial = "Initial";
- public const string Enable = "Enable";
- public const string Disable = "Disable";
- public const string Existing = "Existing";
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/TagAction.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/TagAction.cs
deleted file mode 100644
index 3e067599da305..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/TagAction.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
-
- ///
- /// Defines values for TagAction.
- ///
- public static class TagAction
- {
- public const string Include = "Include";
- public const string Exclude = "Exclude";
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/UserInfo.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/UserInfo.cs
deleted file mode 100644
index 3f5d83619f355..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/Models/UserInfo.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
- using System.Linq;
-
- public partial class UserInfo
- {
- ///
- /// Initializes a new instance of the UserInfo class.
- ///
- public UserInfo()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the UserInfo class.
- ///
- /// Name of the user
- /// Email of the user used by Datadog for
- /// contacting them if needed
- /// Phone number of the user used by Datadog
- /// for contacting them if needed
- public UserInfo(string name = default(string), string emailAddress = default(string), string phoneNumber = default(string))
- {
- Name = name;
- EmailAddress = emailAddress;
- PhoneNumber = phoneNumber;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets name of the user
- ///
- [JsonProperty(PropertyName = "name")]
- public string Name { get; set; }
-
- ///
- /// Gets or sets email of the user used by Datadog for contacting them
- /// if needed
- ///
- [JsonProperty(PropertyName = "emailAddress")]
- public string EmailAddress { get; set; }
-
- ///
- /// Gets or sets phone number of the user used by Datadog for
- /// contacting them if needed
- ///
- [JsonProperty(PropertyName = "phoneNumber")]
- public string PhoneNumber { get; set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (Name != null)
- {
- if (Name.Length > 50)
- {
- throw new ValidationException(ValidationRules.MaxLength, "Name", 50);
- }
- }
- if (EmailAddress != null)
- {
- if (!System.Text.RegularExpressions.Regex.IsMatch(EmailAddress, "^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "EmailAddress", "^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$");
- }
- }
- if (PhoneNumber != null)
- {
- if (PhoneNumber.Length > 40)
- {
- throw new ValidationException(ValidationRules.MaxLength, "PhoneNumber", 40);
- }
- }
- }
- }
-}
diff --git a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MonitoredResourcesOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MonitoredResourcesOperations.cs
deleted file mode 100644
index 386c7b53818ac..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MonitoredResourcesOperations.cs
+++ /dev/null
@@ -1,422 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- 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;
-
- ///
- /// MonitoredResourcesOperations operations.
- ///
- internal partial class MonitoredResourcesOperations : IServiceOperations, IMonitoredResourcesOperations
- {
- ///
- /// Initializes a new instance of the MonitoredResourcesOperations class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- internal MonitoredResourcesOperations(MicrosoftDatadogClient client)
- {
- if (client == null)
- {
- throw new System.ArgumentNullException("client");
- }
- Client = client;
- }
-
- ///
- /// Gets a reference to the MicrosoftDatadogClient
- ///
- public MicrosoftDatadogClient Client { get; private set; }
-
- ///
- /// List the resources currently being monitored by the Datadog monitor
- /// resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource 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>> ListWithHttpMessagesAsync(string resourceGroupName, string monitorName, 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 (monitorName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "monitorName");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("monitorName", monitorName);
- 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{monitorName}", System.Uri.EscapeDataString(monitorName));
- 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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;
- }
-
- ///
- /// List the resources currently being monitored by the Datadog monitor
- /// resource.
- ///
- ///
- /// 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("POST");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MonitoredResourcesOperationsExtensions.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MonitoredResourcesOperationsExtensions.cs
deleted file mode 100644
index 0cb64a4ac5b80..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MonitoredResourcesOperationsExtensions.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// Extension methods for MonitoredResourcesOperations.
- ///
- public static partial class MonitoredResourcesOperationsExtensions
- {
- ///
- /// List the resources currently being monitored by the Datadog monitor
- /// resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- public static IPage List(this IMonitoredResourcesOperations operations, string resourceGroupName, string monitorName)
- {
- return operations.ListAsync(resourceGroupName, monitorName).GetAwaiter().GetResult();
- }
-
- ///
- /// List the resources currently being monitored by the Datadog monitor
- /// resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this IMonitoredResourcesOperations operations, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, monitorName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// List the resources currently being monitored by the Datadog monitor
- /// resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- public static IPage ListNext(this IMonitoredResourcesOperations operations, string nextPageLink)
- {
- return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
- }
-
- ///
- /// List the resources currently being monitored by the Datadog monitor
- /// resource.
- ///
- ///
- /// 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 IMonitoredResourcesOperations 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/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MonitorsOperations.cs b/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MonitorsOperations.cs
deleted file mode 100644
index a9909dde73aed..0000000000000
--- a/sdk/datadog/Microsoft.Azure.Management.Datadog/src/Generated/MonitorsOperations.cs
+++ /dev/null
@@ -1,1616 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Datadog
-{
- 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;
-
- ///
- /// MonitorsOperations operations.
- ///
- internal partial class MonitorsOperations : IServiceOperations, IMonitorsOperations
- {
- ///
- /// Initializes a new instance of the MonitorsOperations class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- internal MonitorsOperations(MicrosoftDatadogClient client)
- {
- if (client == null)
- {
- throw new System.ArgumentNullException("client");
- }
- Client = client;
- }
-
- ///
- /// Gets a reference to the MicrosoftDatadogClient
- ///
- public MicrosoftDatadogClient Client { get; private set; }
-
- ///
- /// List all monitors under the specified subscription.
- ///
- ///
- /// 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.SubscriptionId == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- // 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
- }
- // Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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;
- }
-
- ///
- /// List all monitors under the specified resource group.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, 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 (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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.Datadog/monitors").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
- }
- catch (JsonException)
- {
- // Ignore the exception
- }
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
- }
- // Create Result
- var _result = new AzureOperationResponse>();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
- // Deserialize Response
- if ((int)_statusCode == 200)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
- if (_shouldTrace)
- {
- ServiceClientTracing.Exit(_invocationId, _result);
- }
- return _result;
- }
-
- ///
- /// Get the properties of a specific monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource 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 resourceGroupName, string monitorName, 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 (monitorName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "monitorName");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("monitorName", monitorName);
- 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{monitorName}", System.Uri.EscapeDataString(monitorName));
- 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 ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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;
- }
-
- ///
- /// Create a monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- ///
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string monitorName, DatadogMonitorResource body = default(DatadogMonitorResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- // Send Request
- AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, monitorName, body, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Update a monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string monitorName, DatadogMonitorResourceUpdateParameters body = default(DatadogMonitorResourceUpdateParameters), 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 (monitorName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "monitorName");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("monitorName", monitorName);
- tracingParameters.Add("body", body);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
- }
- // Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{monitorName}", System.Uri.EscapeDataString(monitorName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
- }
- if (_queryParameters.Count > 0)
- {
- _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
- }
- // Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PATCH");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
- {
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
- }
- if (Client.AcceptLanguage != null)
- {
- if (_httpRequest.Headers.Contains("accept-language"))
- {
- _httpRequest.Headers.Remove("accept-language");
- }
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
- }
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- if(body != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
- {
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
- }
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200)
- {
- var ex = new ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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;
- }
-
- ///
- /// Delete a monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource name
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string monitorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- // Send request
- AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, monitorName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Create a monitor resource.
- ///
- ///
- /// The name of the resource group to which the Datadog resource belongs.
- ///
- ///
- /// Monitor resource 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> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string monitorName, DatadogMonitorResource body = default(DatadogMonitorResource), 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 (monitorName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "monitorName");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
- }
- if (body != null)
- {
- body.Validate();
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("monitorName", monitorName);
- tracingParameters.Add("body", body);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", 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.Datadog/monitors/{monitorName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{monitorName}", System.Uri.EscapeDataString(monitorName));
- 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(body != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
- {
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
- }
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
- {
- var ex = new ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ResourceProviderDefaultErrorResponse _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;
- }
-
- ///