From 40ea5c637ef92d75c1c82448693384c24bfb6cd5 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 22 Oct 2020 10:43:04 +0000 Subject: [PATCH] Generated from c72a0a9d481a0fba9be8e15c917cea5fb1960733 --- .../Generated/ConfluentManagementClient.cs | 363 ++++ .../Generated/IConfluentManagementClient.cs | 82 + .../src/Generated/IOrganizationOperations.cs | 68 + .../IOrganizationOperationsOperations.cs | 284 +++ .../src/Generated/Models/AgreementTerms.cs | 123 ++ .../src/Generated/Models/ErrorResponseBody.cs | 80 + .../src/Generated/Models/OfferDetail.cs | 141 ++ .../src/Generated/Models/OperationDisplay.cs | 80 + .../src/Generated/Models/OperationResult.cs | 61 + .../Generated/Models/OrganizationResource.cs | 145 ++ .../Models/OrganizationResourceProperties.cs | 101 + ...ganizationResourcePropertiesOfferDetail.cs | 64 + ...rganizationResourcePropertiesUserDetail.cs | 58 + .../Models/OrganizationResourceUpdate.cs | 53 + .../src/Generated/Models/Page.cs | 53 + .../src/Generated/Models/ProvisionState.cs | 29 + .../src/Generated/Models/Resource.cs | 69 + .../ResourceProviderDefaultErrorResponse.cs | 56 + ...ceProviderDefaultErrorResponseException.cs | 62 + .../src/Generated/Models/SaaSOfferStatus.cs | 30 + .../src/Generated/Models/UserDetail.cs | 98 + .../src/Generated/OrganizationOperations.cs | 380 ++++ .../OrganizationOperationsExtensions.cs | 87 + .../OrganizationOperationsOperations.cs | 1724 +++++++++++++++++ ...anizationOperationsOperationsExtensions.cs | 437 +++++ .../SdkInfo_ConfluentManagementClient.cs | 28 + 26 files changed, 4756 insertions(+) create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IOrganizationOperations.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IOrganizationOperationsOperations.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/AgreementTerms.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ErrorResponseBody.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OfferDetail.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OperationDisplay.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OperationResult.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResource.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourceProperties.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesOfferDetail.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesUserDetail.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourceUpdate.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/Page.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ProvisionState.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/Resource.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ResourceProviderDefaultErrorResponse.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ResourceProviderDefaultErrorResponseException.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/SaaSOfferStatus.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/UserDetail.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperations.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsExtensions.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperations.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperationsExtensions.cs create mode 100644 sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/SdkInfo_ConfluentManagementClient.cs diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs new file mode 100644 index 000000000000..d24603241333 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs @@ -0,0 +1,363 @@ +// +// 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.Confluent +{ + 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 ConfluentManagementClient : ServiceClient, IConfluentManagementClient, 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; } + + /// + /// Client Api Version. + /// + public string ApiVersion { get; private set; } + + /// + /// Microsoft Azure subscription id + /// + public string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IOrganizationOperations. + /// + public virtual IOrganizationOperations OrganizationOperations { get; private set; } + + /// + /// Gets the IOrganizationOperationsOperations. + /// + public virtual IOrganizationOperationsOperations Organization { get; private set; } + + /// + /// Initializes a new instance of the ConfluentManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling ConfluentManagementClient.Dispose(). False: will not dispose provided httpClient + protected ConfluentManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the ConfluentManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected ConfluentManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the ConfluentManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected ConfluentManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the ConfluentManagementClient 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 ConfluentManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the ConfluentManagementClient 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 ConfluentManagementClient(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 ConfluentManagementClient 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 ConfluentManagementClient(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 ConfluentManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling ConfluentManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public ConfluentManagementClient(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 ConfluentManagementClient 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 ConfluentManagementClient(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 ConfluentManagementClient 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 ConfluentManagementClient(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 ConfluentManagementClient 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 ConfluentManagementClient(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() + { + OrganizationOperations = new OrganizationOperations(this); + Organization = new OrganizationOperationsOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2020-03-01-preview"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs new file mode 100644 index 000000000000..b8891af5dab8 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// + public partial interface IConfluentManagementClient : 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; } + + /// + /// Client Api Version. + /// + string ApiVersion { get; } + + /// + /// Microsoft Azure subscription id + /// + string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IOrganizationOperations. + /// + IOrganizationOperations OrganizationOperations { get; } + + /// + /// Gets the IOrganizationOperationsOperations. + /// + IOrganizationOperationsOperations Organization { get; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IOrganizationOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IOrganizationOperations.cs new file mode 100644 index 000000000000..cb08fb1325c8 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IOrganizationOperations.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OrganizationOperations operations. + /// + public partial interface IOrganizationOperations + { + /// + /// List all operations provided by Microsoft.Confluent. + /// + /// + /// 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.Confluent. + /// + /// + /// 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/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IOrganizationOperationsOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IOrganizationOperationsOperations.cs new file mode 100644 index 000000000000..bf4c438e3eed --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IOrganizationOperationsOperations.cs @@ -0,0 +1,284 @@ +// +// 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.Confluent +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OrganizationOperationsOperations operations. + /// + public partial interface IOrganizationOperationsOperations + { + /// + /// List all organizations 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get marketplace agreement in the 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> GetAgreementMarketplaceTermsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all Organizations under the specified resource group. + /// + /// + /// Resource group 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the properties of a specific Organization resource. + /// + /// + /// Resource group name + /// + /// + /// Organization 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 organizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + /// + /// 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 organizationName, OrganizationResource body = default(OrganizationResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// ARM resource tags + /// + /// + /// 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 organizationName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization 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 organizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + /// + /// 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 organizationName, OrganizationResource body = default(OrganizationResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization 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 organizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all organizations 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all Organizations 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/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/AgreementTerms.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/AgreementTerms.cs new file mode 100644 index 000000000000..be33740ea53b --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/AgreementTerms.cs @@ -0,0 +1,123 @@ +// +// 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.Confluent.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Terms properties for provided Publisher/Offer/Plan tuple + /// + [Rest.Serialization.JsonTransformation] + public partial class AgreementTerms : Resource + { + /// + /// Initializes a new instance of the AgreementTerms class. + /// + public AgreementTerms() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AgreementTerms class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Publisher identifier string of image being + /// deployed. + /// Offer identifier string of image being + /// deployed. + /// Plan identifier string of image being + /// deployed. + /// Link to HTML with Microsoft and + /// Publisher terms. + /// Link to the privacy policy of the + /// publisher. + /// Date and time in UTC of when the + /// terms were accepted. This is empty if Accepted is false. + /// Terms signature. + /// If any version of the terms have been + /// accepted, otherwise false. + public AgreementTerms(string id = default(string), string name = default(string), string type = default(string), string publisher = default(string), string product = default(string), string plan = default(string), string licenseTextLink = default(string), string privacyPolicyLink = default(string), System.DateTime? retrieveDatetime = default(System.DateTime?), string signature = default(string), string accepted = default(string)) + : base(id, name, type) + { + Publisher = publisher; + Product = product; + Plan = plan; + LicenseTextLink = licenseTextLink; + PrivacyPolicyLink = privacyPolicyLink; + RetrieveDatetime = retrieveDatetime; + Signature = signature; + Accepted = accepted; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets publisher identifier string of image being deployed. + /// + [JsonProperty(PropertyName = "properties.publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets offer identifier string of image being deployed. + /// + [JsonProperty(PropertyName = "properties.product")] + public string Product { get; set; } + + /// + /// Gets or sets plan identifier string of image being deployed. + /// + [JsonProperty(PropertyName = "properties.plan")] + public string Plan { get; set; } + + /// + /// Gets or sets link to HTML with Microsoft and Publisher terms. + /// + [JsonProperty(PropertyName = "properties.licenseTextLink")] + public string LicenseTextLink { get; set; } + + /// + /// Gets or sets link to the privacy policy of the publisher. + /// + [JsonProperty(PropertyName = "properties.privacyPolicyLink")] + public string PrivacyPolicyLink { get; set; } + + /// + /// Gets or sets date and time in UTC of when the terms were accepted. + /// This is empty if Accepted is false. + /// + [JsonProperty(PropertyName = "properties.retrieveDatetime")] + public System.DateTime? RetrieveDatetime { get; set; } + + /// + /// Gets or sets terms signature. + /// + [JsonProperty(PropertyName = "properties.signature")] + public string Signature { get; set; } + + /// + /// Gets or sets if any version of the terms have been accepted, + /// otherwise false. + /// + [JsonProperty(PropertyName = "properties.accepted")] + public string Accepted { get; set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ErrorResponseBody.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ErrorResponseBody.cs new file mode 100644 index 000000000000..60aa418ecc42 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ErrorResponseBody.cs @@ -0,0 +1,80 @@ +// +// 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.Confluent.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ErrorResponseBody + /// + /// + /// Response body of Error + /// + public partial class ErrorResponseBody + { + /// + /// Initializes a new instance of the ErrorResponseBody class. + /// + public ErrorResponseBody() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseBody class. + /// + /// Error code + /// Error message + /// Error target + /// Error detail + 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(); + + /// + /// Gets error code + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets error message + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets error target + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets error detail + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OfferDetail.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OfferDetail.cs new file mode 100644 index 000000000000..92f7f74e5d85 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OfferDetail.cs @@ -0,0 +1,141 @@ +// +// 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.Confluent.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Confluent Offer detail + /// + public partial class OfferDetail + { + /// + /// Initializes a new instance of the OfferDetail class. + /// + public OfferDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OfferDetail class. + /// + /// Publisher Id + /// Offer Id + /// Offer Plan Id + /// Offer Plan Name + /// Offer Plan Term unit + /// SaaS Offer Status. Possible values include: + /// 'Started', 'PendingFulfillmentStart', 'InProgress', 'Subscribed', + /// 'Suspended', 'Reinstated', 'Succeeded', 'Failed', 'Unsubscribed', + /// 'Updating' + public OfferDetail(string publisherId = default(string), string id = default(string), string planId = default(string), string planName = default(string), string termUnit = default(string), string status = default(string)) + { + PublisherId = publisherId; + Id = id; + PlanId = planId; + PlanName = planName; + TermUnit = termUnit; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets publisher Id + /// + [JsonProperty(PropertyName = "publisherId")] + public string PublisherId { get; set; } + + /// + /// Gets or sets offer Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets offer Plan Id + /// + [JsonProperty(PropertyName = "planId")] + public string PlanId { get; set; } + + /// + /// Gets or sets offer Plan Name + /// + [JsonProperty(PropertyName = "planName")] + public string PlanName { get; set; } + + /// + /// Gets or sets offer Plan Term unit + /// + [JsonProperty(PropertyName = "termUnit")] + public string TermUnit { get; set; } + + /// + /// Gets or sets saaS Offer Status. Possible values include: 'Started', + /// 'PendingFulfillmentStart', 'InProgress', 'Subscribed', 'Suspended', + /// 'Reinstated', 'Succeeded', 'Failed', 'Unsubscribed', 'Updating' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PublisherId != null) + { + if (PublisherId.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "PublisherId", 50); + } + } + if (Id != null) + { + if (Id.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "Id", 50); + } + } + if (PlanId != null) + { + if (PlanId.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "PlanId", 50); + } + } + if (PlanName != null) + { + if (PlanName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "PlanName", 50); + } + } + if (TermUnit != null) + { + if (TermUnit.Length > 25) + { + throw new ValidationException(ValidationRules.MaxLength, "TermUnit", 25); + } + } + } + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OperationDisplay.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..2b5f2c1ba3a7 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,80 @@ +// +// 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.Confluent.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The object that represents the operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Service provider: + /// Microsoft.Confluent + /// Type on which the operation is performed, + /// e.g., 'clusters'. + /// Operation type, e.g., read, write, delete, + /// etc. + /// Description of the operation, e.g., + /// 'Write confluent'. + 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: Microsoft.Confluent + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets type on which the operation is performed, e.g., + /// 'clusters'. + /// + [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 confluent'. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OperationResult.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OperationResult.cs new file mode 100644 index 000000000000..c9d6764f8dd8 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OperationResult.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An Confluent 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: + /// {provider}/{resource}/{operation} + /// The object that represents the + /// operation. + public OperationResult(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation name: {provider}/{resource}/{operation} + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the object that represents the operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResource.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResource.cs new file mode 100644 index 000000000000..88b34bce0955 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResource.cs @@ -0,0 +1,145 @@ +// +// 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.Confluent.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Organization resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class OrganizationResource : IResource + { + /// + /// Initializes a new instance of the OrganizationResource class. + /// + public OrganizationResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OrganizationResource class. + /// + /// The ARM id of the resource. + /// The name of the resource. + /// The type of the resource. + /// The creation time of the + /// resource. + /// Provision states for confluent RP. + /// Possible values include: 'Accepted', 'Creating', 'Updating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', + /// 'NotSpecified' + /// Id of the Confluent + /// organization. + /// SSO url for the Confluent + /// organization. + /// Confluent offer detail + /// Subscriber detail + /// Organization resource tags + /// Location of Organization resource + public OrganizationResource(string id = default(string), string name = default(string), string type = default(string), System.DateTime? createdTime = default(System.DateTime?), string provisioningState = default(string), string organizationId = default(string), string ssoUrl = default(string), OrganizationResourcePropertiesOfferDetail offerDetail = default(OrganizationResourcePropertiesOfferDetail), OrganizationResourcePropertiesUserDetail userDetail = default(OrganizationResourcePropertiesUserDetail), IDictionary tags = default(IDictionary), string location = default(string)) + { + Id = id; + Name = name; + Type = type; + CreatedTime = createdTime; + ProvisioningState = provisioningState; + OrganizationId = organizationId; + SsoUrl = ssoUrl; + OfferDetail = offerDetail; + UserDetail = userDetail; + Tags = tags; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ARM id of the resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the creation time of the resource. + /// + [JsonProperty(PropertyName = "properties.createdTime")] + public System.DateTime? CreatedTime { get; private set; } + + /// + /// Gets or sets provision states for confluent RP. Possible values + /// include: 'Accepted', 'Creating', 'Updating', 'Deleting', + /// 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets id of the Confluent organization. + /// + [JsonProperty(PropertyName = "properties.organizationId")] + public string OrganizationId { get; private set; } + + /// + /// Gets SSO url for the Confluent organization. + /// + [JsonProperty(PropertyName = "properties.ssoUrl")] + public string SsoUrl { get; private set; } + + /// + /// Gets or sets confluent offer detail + /// + [JsonProperty(PropertyName = "properties.offerDetail")] + public OrganizationResourcePropertiesOfferDetail OfferDetail { get; set; } + + /// + /// Gets or sets subscriber detail + /// + [JsonProperty(PropertyName = "properties.userDetail")] + public OrganizationResourcePropertiesUserDetail UserDetail { get; set; } + + /// + /// Gets or sets organization resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets location of Organization resource + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourceProperties.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourceProperties.cs new file mode 100644 index 000000000000..d3075d98127f --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourceProperties.cs @@ -0,0 +1,101 @@ +// +// 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.Confluent.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Organization resource property + /// + public partial class OrganizationResourceProperties + { + /// + /// Initializes a new instance of the OrganizationResourceProperties + /// class. + /// + public OrganizationResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OrganizationResourceProperties + /// class. + /// + /// The creation time of the + /// resource. + /// Provision states for confluent RP. + /// Possible values include: 'Accepted', 'Creating', 'Updating', + /// 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', + /// 'NotSpecified' + /// Id of the Confluent + /// organization. + /// SSO url for the Confluent + /// organization. + /// Confluent offer detail + /// Subscriber detail + public OrganizationResourceProperties(System.DateTime? createdTime = default(System.DateTime?), string provisioningState = default(string), string organizationId = default(string), string ssoUrl = default(string), OrganizationResourcePropertiesOfferDetail offerDetail = default(OrganizationResourcePropertiesOfferDetail), OrganizationResourcePropertiesUserDetail userDetail = default(OrganizationResourcePropertiesUserDetail)) + { + CreatedTime = createdTime; + ProvisioningState = provisioningState; + OrganizationId = organizationId; + SsoUrl = ssoUrl; + OfferDetail = offerDetail; + UserDetail = userDetail; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the creation time of the resource. + /// + [JsonProperty(PropertyName = "createdTime")] + public System.DateTime? CreatedTime { get; private set; } + + /// + /// Gets or sets provision states for confluent RP. Possible values + /// include: 'Accepted', 'Creating', 'Updating', 'Deleting', + /// 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets id of the Confluent organization. + /// + [JsonProperty(PropertyName = "organizationId")] + public string OrganizationId { get; private set; } + + /// + /// Gets SSO url for the Confluent organization. + /// + [JsonProperty(PropertyName = "ssoUrl")] + public string SsoUrl { get; private set; } + + /// + /// Gets or sets confluent offer detail + /// + [JsonProperty(PropertyName = "offerDetail")] + public OrganizationResourcePropertiesOfferDetail OfferDetail { get; set; } + + /// + /// Gets or sets subscriber detail + /// + [JsonProperty(PropertyName = "userDetail")] + public OrganizationResourcePropertiesUserDetail UserDetail { get; set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesOfferDetail.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesOfferDetail.cs new file mode 100644 index 000000000000..d658b00b25d0 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesOfferDetail.cs @@ -0,0 +1,64 @@ +// +// 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.Confluent.Models +{ + using System.Linq; + + /// + /// Confluent offer detail + /// + public partial class OrganizationResourcePropertiesOfferDetail : OfferDetail + { + /// + /// Initializes a new instance of the + /// OrganizationResourcePropertiesOfferDetail class. + /// + public OrganizationResourcePropertiesOfferDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// OrganizationResourcePropertiesOfferDetail class. + /// + /// Publisher Id + /// Offer Id + /// Offer Plan Id + /// Offer Plan Name + /// Offer Plan Term unit + /// SaaS Offer Status. Possible values include: + /// 'Started', 'PendingFulfillmentStart', 'InProgress', 'Subscribed', + /// 'Suspended', 'Reinstated', 'Succeeded', 'Failed', 'Unsubscribed', + /// 'Updating' + public OrganizationResourcePropertiesOfferDetail(string publisherId = default(string), string id = default(string), string planId = default(string), string planName = default(string), string termUnit = default(string), string status = default(string)) + : base(publisherId, id, planId, planName, termUnit, status) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesUserDetail.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesUserDetail.cs new file mode 100644 index 000000000000..db8fbb989149 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesUserDetail.cs @@ -0,0 +1,58 @@ +// +// 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.Confluent.Models +{ + using System.Linq; + + /// + /// Subscriber detail + /// + public partial class OrganizationResourcePropertiesUserDetail : UserDetail + { + /// + /// Initializes a new instance of the + /// OrganizationResourcePropertiesUserDetail class. + /// + public OrganizationResourcePropertiesUserDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// OrganizationResourcePropertiesUserDetail class. + /// + /// First name + /// Last name + /// Email address + public OrganizationResourcePropertiesUserDetail(string firstName = default(string), string lastName = default(string), string emailAddress = default(string)) + : base(firstName, lastName, emailAddress) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourceUpdate.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourceUpdate.cs new file mode 100644 index 000000000000..ad6586806412 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourceUpdate.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Organization Resource update + /// + public partial class OrganizationResourceUpdate + { + /// + /// Initializes a new instance of the OrganizationResourceUpdate class. + /// + public OrganizationResourceUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OrganizationResourceUpdate class. + /// + /// ARM resource tags + public OrganizationResourceUpdate(IDictionary tags = default(IDictionary)) + { + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ARM resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/Page.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/Page.cs new file mode 100644 index 000000000000..b140177b15a4 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.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/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ProvisionState.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ProvisionState.cs new file mode 100644 index 000000000000..e22ce390d6a1 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ProvisionState.cs @@ -0,0 +1,29 @@ +// +// 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.Confluent.Models +{ + + /// + /// Defines values for ProvisionState. + /// + public static class ProvisionState + { + 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/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/Resource.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/Resource.cs new file mode 100644 index 000000000000..d4fc18836b52 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/Resource.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// ARM resource. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + public Resource(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ResourceProviderDefaultErrorResponse.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ResourceProviderDefaultErrorResponse.cs new file mode 100644 index 000000000000..effdda2e7e37 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ResourceProviderDefaultErrorResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// ResourceProviderDefaultErrorResponse + /// + /// + /// Default error response for resource provider + /// + public partial class ResourceProviderDefaultErrorResponse + { + /// + /// Initializes a new instance of the + /// ResourceProviderDefaultErrorResponse class. + /// + public ResourceProviderDefaultErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceProviderDefaultErrorResponse class. + /// + /// Response body of Error + public ResourceProviderDefaultErrorResponse(ErrorResponseBody error = default(ErrorResponseBody)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets response body of Error + /// + [JsonProperty(PropertyName = "error")] + public ErrorResponseBody Error { get; private set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ResourceProviderDefaultErrorResponseException.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ResourceProviderDefaultErrorResponseException.cs new file mode 100644 index 000000000000..ea04b57cce3e --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ResourceProviderDefaultErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.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/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/SaaSOfferStatus.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/SaaSOfferStatus.cs new file mode 100644 index 000000000000..abd6245f20fc --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/SaaSOfferStatus.cs @@ -0,0 +1,30 @@ +// +// 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.Confluent.Models +{ + + /// + /// Defines values for SaaSOfferStatus. + /// + public static class SaaSOfferStatus + { + public const string Started = "Started"; + public const string PendingFulfillmentStart = "PendingFulfillmentStart"; + public const string InProgress = "InProgress"; + public const string Subscribed = "Subscribed"; + public const string Suspended = "Suspended"; + public const string Reinstated = "Reinstated"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Unsubscribed = "Unsubscribed"; + public const string Updating = "Updating"; + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/UserDetail.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/UserDetail.cs new file mode 100644 index 000000000000..e04e69287a4b --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/UserDetail.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Subscriber detail + /// + public partial class UserDetail + { + /// + /// Initializes a new instance of the UserDetail class. + /// + public UserDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserDetail class. + /// + /// First name + /// Last name + /// Email address + public UserDetail(string firstName = default(string), string lastName = default(string), string emailAddress = default(string)) + { + FirstName = firstName; + LastName = lastName; + EmailAddress = emailAddress; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets first name + /// + [JsonProperty(PropertyName = "firstName")] + public string FirstName { get; set; } + + /// + /// Gets or sets last name + /// + [JsonProperty(PropertyName = "lastName")] + public string LastName { get; set; } + + /// + /// Gets or sets email address + /// + [JsonProperty(PropertyName = "emailAddress")] + public string EmailAddress { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (FirstName != null) + { + if (FirstName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "FirstName", 50); + } + } + if (LastName != null) + { + if (LastName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "LastName", 50); + } + } + if (EmailAddress != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(EmailAddress, "^[\\w\\.\\-+!%\"\\s]+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$")) + { + throw new ValidationException(ValidationRules.Pattern, "EmailAddress", "^[\\w\\.\\-+!%\"\\s]+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$"); + } + } + } + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperations.cs new file mode 100644 index 000000000000..870983768cc8 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperations.cs @@ -0,0 +1,380 @@ +// +// 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.Confluent +{ + 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; + + /// + /// OrganizationOperations operations. + /// + internal partial class OrganizationOperations : IServiceOperations, IOrganizationOperations + { + /// + /// Initializes a new instance of the OrganizationOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OrganizationOperations(ConfluentManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ConfluentManagementClient + /// + public ConfluentManagementClient Client { get; private set; } + + /// + /// List all operations provided by Microsoft.Confluent. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Confluent/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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 operations provided by Microsoft.Confluent. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsExtensions.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsExtensions.cs new file mode 100644 index 000000000000..93dfa5dd518c --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OrganizationOperations. + /// + public static partial class OrganizationOperationsExtensions + { + /// + /// List all operations provided by Microsoft.Confluent. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOrganizationOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// List all operations provided by Microsoft.Confluent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOrganizationOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all operations provided by Microsoft.Confluent. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOrganizationOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all operations provided by Microsoft.Confluent. + /// + /// + /// 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 IOrganizationOperations 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/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperations.cs new file mode 100644 index 000000000000..6a933dfbafed --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperations.cs @@ -0,0 +1,1724 @@ +// +// 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.Confluent +{ + 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; + + /// + /// OrganizationOperationsOperations operations. + /// + internal partial class OrganizationOperationsOperations : IServiceOperations, IOrganizationOperationsOperations + { + /// + /// Initializes a new instance of the OrganizationOperationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OrganizationOperationsOperations(ConfluentManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ConfluentManagementClient + /// + public ConfluentManagementClient Client { get; private set; } + + /// + /// List all organizations 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // 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, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations").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; + } + + /// + /// Get marketplace agreement in the 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> GetAgreementMarketplaceTermsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // 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, "GetAgreementMarketplaceTerms", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements").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 Organizations under the specified resource group. + /// + /// + /// Resource group 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>> 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"); + } + // 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.Confluent/organizations").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 Organization resource. + /// + /// + /// Resource group name + /// + /// + /// Organization 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 organizationName, 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 (organizationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "organizationName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("organizationName", organizationName); + 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.Confluent/organizations/{organizationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{organizationName}", System.Uri.EscapeDataString(organizationName)); + 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 Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string organizationName, OrganizationResource body = default(OrganizationResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, organizationName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// ARM resource tags + /// + /// + /// 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 organizationName, IDictionary tags = default(IDictionary), 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 (organizationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "organizationName"); + } + OrganizationResourceUpdate body = default(OrganizationResourceUpdate); + if (tags != null) + { + body = new OrganizationResourceUpdate(); + body.Tags = tags; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("organizationName", organizationName); + 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.Confluent/organizations/{organizationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{organizationName}", System.Uri.EscapeDataString(organizationName)); + 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 Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string organizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, organizationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + /// + /// 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 organizationName, OrganizationResource body = default(OrganizationResource), 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 (organizationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "organizationName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("organizationName", organizationName); + 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.Confluent/organizations/{organizationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{organizationName}", System.Uri.EscapeDataString(organizationName)); + 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; + } + + /// + /// Delete Organization resource + /// + /// + /// Resource group name + /// + /// + /// Organization 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string organizationName, 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 (organizationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "organizationName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("organizationName", organizationName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.Confluent/organizations/{organizationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{organizationName}", System.Uri.EscapeDataString(organizationName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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 all organizations under the specified subscription. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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 Organizations under the specified resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperationsExtensions.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperationsExtensions.cs new file mode 100644 index 000000000000..9e969b9e58ce --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperationsExtensions.cs @@ -0,0 +1,437 @@ +// +// 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.Confluent +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OrganizationOperationsOperations. + /// + public static partial class OrganizationOperationsOperationsExtensions + { + /// + /// List all organizations under the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListBySubscription(this IOrganizationOperationsOperations operations) + { + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// List all organizations under the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IOrganizationOperationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get marketplace agreement in the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static AgreementTerms GetAgreementMarketplaceTerms(this IOrganizationOperationsOperations operations) + { + return operations.GetAgreementMarketplaceTermsAsync().GetAwaiter().GetResult(); + } + + /// + /// Get marketplace agreement in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task GetAgreementMarketplaceTermsAsync(this IOrganizationOperationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAgreementMarketplaceTermsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all Organizations under the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + public static IPage ListByResourceGroup(this IOrganizationOperationsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// List all Organizations under the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IOrganizationOperationsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the properties of a specific Organization resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + public static OrganizationResource Get(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName) + { + return operations.GetAsync(resourceGroupName, organizationName).GetAwaiter().GetResult(); + } + + /// + /// Get the properties of a specific Organization resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, organizationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + public static OrganizationResource Create(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName, OrganizationResource body = default(OrganizationResource)) + { + return operations.CreateAsync(resourceGroupName, organizationName, body).GetAwaiter().GetResult(); + } + + /// + /// Create Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName, OrganizationResource body = default(OrganizationResource), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, organizationName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// ARM resource tags + /// + public static OrganizationResource Update(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName, IDictionary tags = default(IDictionary)) + { + return operations.UpdateAsync(resourceGroupName, organizationName, tags).GetAwaiter().GetResult(); + } + + /// + /// Update Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// ARM resource tags + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, organizationName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + public static void Delete(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName) + { + operations.DeleteAsync(resourceGroupName, organizationName).GetAwaiter().GetResult(); + } + + /// + /// Delete Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, organizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + public static OrganizationResource BeginCreate(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName, OrganizationResource body = default(OrganizationResource)) + { + return operations.BeginCreateAsync(resourceGroupName, organizationName, body).GetAwaiter().GetResult(); + } + + /// + /// Create Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName, OrganizationResource body = default(OrganizationResource), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, organizationName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + public static void BeginDelete(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName) + { + operations.BeginDeleteAsync(resourceGroupName, organizationName).GetAwaiter().GetResult(); + } + + /// + /// Delete Organization resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IOrganizationOperationsOperations operations, string resourceGroupName, string organizationName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, organizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List all organizations under the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IOrganizationOperationsOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all organizations under the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this IOrganizationOperationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all Organizations under the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IOrganizationOperationsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all Organizations under the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IOrganizationOperationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/SdkInfo_ConfluentManagementClient.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/SdkInfo_ConfluentManagementClient.cs new file mode 100644 index 000000000000..f71238563fcb --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/SdkInfo_ConfluentManagementClient.cs @@ -0,0 +1,28 @@ + +// +// 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.Confluent +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_ConfluentManagementClient + { + get + { + return new Tuple[] + { + new Tuple("Confluent", "Organization", "2020-03-01-preview"), + new Tuple("Confluent", "OrganizationOperations", "2020-03-01-preview"), + }.AsEnumerable(); + } + } + } +}