diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs index d246032413338..226c6c129e830 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs @@ -71,6 +71,11 @@ public partial class ConfluentManagementClient : ServiceClient public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IMarketplaceAgreementsOperations. + /// + public virtual IMarketplaceAgreementsOperations MarketplaceAgreements { get; private set; } + /// /// Gets the IOrganizationOperations. /// @@ -322,6 +327,7 @@ public ConfluentManagementClient(System.Uri baseUri, ServiceClientCredentials cr /// private void Initialize() { + MarketplaceAgreements = new MarketplaceAgreementsOperations(this); OrganizationOperations = new OrganizationOperations(this); Organization = new OrganizationOperationsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs index b8891af5dab89..cc299f221e034 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs @@ -68,6 +68,11 @@ public partial interface IConfluentManagementClient : System.IDisposable bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IMarketplaceAgreementsOperations. + /// + IMarketplaceAgreementsOperations MarketplaceAgreements { get; } + /// /// Gets the IOrganizationOperations. /// diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IMarketplaceAgreementsOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IMarketplaceAgreementsOperations.cs new file mode 100644 index 0000000000000..1d2028d473459 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IMarketplaceAgreementsOperations.cs @@ -0,0 +1,90 @@ +// +// 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; + + /// + /// MarketplaceAgreementsOperations operations. + /// + public partial interface IMarketplaceAgreementsOperations + { + /// + /// List Confluent marketplace agreements 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create Confluent Marketplace agreement in the subscription. + /// + /// + /// Represents the properties of the resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(ConfluentAgreementProperties properties = default(ConfluentAgreementProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List Confluent marketplace agreements in the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperations.cs new file mode 100644 index 0000000000000..8a422313340da --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperations.cs @@ -0,0 +1,568 @@ +// +// 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; + + /// + /// MarketplaceAgreementsOperations operations. + /// + internal partial class MarketplaceAgreementsOperations : IServiceOperations, IMarketplaceAgreementsOperations + { + /// + /// Initializes a new instance of the MarketplaceAgreementsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MarketplaceAgreementsOperations(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 Confluent marketplace agreements 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>> ListWithHttpMessagesAsync(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, "List", 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 (_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 Confluent Marketplace agreement in the subscription. + /// + /// + /// Represents the properties of the resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(ConfluentAgreementProperties properties = default(ConfluentAgreementProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + ConfluentAgreementResource body = default(ConfluentAgreementResource); + if (properties != null) + { + body = new ConfluentAgreementResource(); + body.Properties = properties; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", 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/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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 Confluent marketplace agreements in the 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>> 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/MarketplaceAgreementsOperationsExtensions.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperationsExtensions.cs new file mode 100644 index 0000000000000..ed46cd1beefff --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperationsExtensions.cs @@ -0,0 +1,121 @@ +// +// 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 MarketplaceAgreementsOperations. + /// + public static partial class MarketplaceAgreementsOperationsExtensions + { + /// + /// List Confluent marketplace agreements in the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IMarketplaceAgreementsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// List Confluent marketplace agreements in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IMarketplaceAgreementsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create Confluent Marketplace agreement in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Represents the properties of the resource. + /// + public static ConfluentAgreementResource Create(this IMarketplaceAgreementsOperations operations, ConfluentAgreementProperties properties = default(ConfluentAgreementProperties)) + { + return operations.CreateAsync(properties).GetAwaiter().GetResult(); + } + + /// + /// Create Confluent Marketplace agreement in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Represents the properties of the resource. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IMarketplaceAgreementsOperations operations, ConfluentAgreementProperties properties = default(ConfluentAgreementProperties), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List Confluent marketplace agreements in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IMarketplaceAgreementsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List Confluent marketplace agreements in the 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> ListNextAsync(this IMarketplaceAgreementsOperations 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/Models/ConfluentAgreementProperties.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ConfluentAgreementProperties.cs new file mode 100644 index 0000000000000..06349f02a0dc9 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ConfluentAgreementProperties.cs @@ -0,0 +1,115 @@ +// +// 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; + + /// + /// Terms properties for Marketplace and Confluent. + /// + public partial class ConfluentAgreementProperties + { + /// + /// Initializes a new instance of the ConfluentAgreementProperties + /// class. + /// + public ConfluentAgreementProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfluentAgreementProperties + /// class. + /// + /// Publisher identifier string. + /// Product identifier string. + /// Plan identifier string. + /// 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 ConfluentAgreementProperties(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), bool? accepted = default(bool?)) + { + 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. + /// + [JsonProperty(PropertyName = "publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets product identifier string. + /// + [JsonProperty(PropertyName = "product")] + public string Product { get; set; } + + /// + /// Gets or sets plan identifier string. + /// + [JsonProperty(PropertyName = "plan")] + public string Plan { get; set; } + + /// + /// Gets or sets link to HTML with Microsoft and Publisher terms. + /// + [JsonProperty(PropertyName = "licenseTextLink")] + public string LicenseTextLink { get; set; } + + /// + /// Gets or sets link to the privacy policy of the publisher. + /// + [JsonProperty(PropertyName = "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 = "retrieveDatetime")] + public System.DateTime? RetrieveDatetime { get; set; } + + /// + /// Gets or sets terms signature. + /// + [JsonProperty(PropertyName = "signature")] + public string Signature { get; set; } + + /// + /// Gets or sets if any version of the terms have been accepted, + /// otherwise false. + /// + [JsonProperty(PropertyName = "accepted")] + public bool? Accepted { get; set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ConfluentAgreementResource.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ConfluentAgreementResource.cs new file mode 100644 index 0000000000000..1d00972bd5103 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ConfluentAgreementResource.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Agreement Terms definition + /// + public partial class ConfluentAgreementResource : IResource + { + /// + /// Initializes a new instance of the ConfluentAgreementResource class. + /// + public ConfluentAgreementResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfluentAgreementResource class. + /// + /// The ARM id of the resource. + /// The name of the agreement. + /// The type of the agreement. + /// Represents the properties of the + /// resource. + public ConfluentAgreementResource(string id = default(string), string name = default(string), string type = default(string), ConfluentAgreementProperties properties = default(ConfluentAgreementProperties)) + { + Id = id; + Name = name; + Type = type; + Properties = properties; + 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 agreement. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the agreement. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets represents the properties of the resource. + /// + [JsonProperty(PropertyName = "properties")] + public ConfluentAgreementProperties Properties { get; set; } + + } +} 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 index e04e69287a4b1..b59db0713b8f6 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/UserDetail.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/UserDetail.cs @@ -88,9 +88,9 @@ public virtual void Validate() } if (EmailAddress != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(EmailAddress, "^[\\w\\.\\-+!%\"\\s]+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(EmailAddress, "^\\S+@\\S+\\.\\S+$")) { - throw new ValidationException(ValidationRules.Pattern, "EmailAddress", "^[\\w\\.\\-+!%\"\\s]+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$"); + throw new ValidationException(ValidationRules.Pattern, "EmailAddress", "^\\S+@\\S+\\.\\S+$"); } } } 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 0000000000000..fd9f5a44497a0 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/SdkInfo_ConfluentManagementClient.cs @@ -0,0 +1,29 @@ + +// +// 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", "MarketplaceAgreements", "2020-03-01-preview"), + new Tuple("Confluent", "Organization", "2020-03-01-preview"), + new Tuple("Confluent", "OrganizationOperations", "2020-03-01-preview"), + }.AsEnumerable(); + } + } + } +}