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 165411152f33..033f36f401f0 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ConfluentManagementClient.cs @@ -86,6 +86,11 @@ public partial class ConfluentManagementClient : ServiceClient public virtual IOrganizationOperationsOperations Organization { get; private set; } + /// + /// Gets the IValidationsOperations. + /// + public virtual IValidationsOperations Validations { get; private set; } + /// /// Initializes a new instance of the ConfluentManagementClient class. /// @@ -330,8 +335,9 @@ private void Initialize() MarketplaceAgreements = new MarketplaceAgreementsOperations(this); OrganizationOperations = new OrganizationOperations(this); Organization = new OrganizationOperationsOperations(this); + Validations = new ValidationsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-03-01"; + ApiVersion = "2021-03-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; 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 cc299f221e03..9288180454c8 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IConfluentManagementClient.cs @@ -83,5 +83,10 @@ public partial interface IConfluentManagementClient : System.IDisposable /// IOrganizationOperationsOperations Organization { get; } + /// + /// Gets the IValidationsOperations. + /// + IValidationsOperations Validations { get; } + } } diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IMarketplaceAgreementsOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IMarketplaceAgreementsOperations.cs index 353ce32da5af..de6cae30e745 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IMarketplaceAgreementsOperations.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IMarketplaceAgreementsOperations.cs @@ -43,10 +43,10 @@ public partial interface IMarketplaceAgreementsOperations /// Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Accept marketplace terms. + /// Create Confluent Marketplace agreement in the subscription. /// /// - /// Confluent Agreement resource + /// Confluent Marketplace Agreement resource /// /// /// The headers that will be added to request. diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IValidationsOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IValidationsOperations.cs new file mode 100644 index 000000000000..c8ddd5423b0e --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/IValidationsOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ValidationsOperations operations. + /// + public partial interface IValidationsOperations + { + /// + /// Organization Validate proxy 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> ValidateOrganizationWithHttpMessagesAsync(string resourceGroupName, string organizationName, OrganizationResource body, 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 index 85a13ea00ce6..387dcb246be0 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperations.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperations.cs @@ -95,6 +95,10 @@ internal MarketplaceAgreementsOperations(ConfluentManagementClient client) 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); @@ -216,10 +220,10 @@ internal MarketplaceAgreementsOperations(ConfluentManagementClient client) } /// - /// Accept marketplace terms. + /// Create Confluent Marketplace agreement in the subscription. /// /// - /// Confluent Agreement resource + /// Confluent Marketplace Agreement resource /// /// /// Headers that will be added to request. @@ -264,6 +268,10 @@ internal MarketplaceAgreementsOperations(ConfluentManagementClient client) 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 (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); diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperationsExtensions.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperationsExtensions.cs index deb43ce51832..0337ae21f40e 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperationsExtensions.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/MarketplaceAgreementsOperationsExtensions.cs @@ -50,13 +50,13 @@ public static IPage List(this IMarketplaceAgreements } /// - /// Accept marketplace terms. + /// Create Confluent Marketplace agreement in the subscription. /// /// /// The operations group for this extension method. /// /// - /// Confluent Agreement resource + /// Confluent Marketplace Agreement resource /// public static ConfluentAgreementResource Create(this IMarketplaceAgreementsOperations operations, ConfluentAgreementResource body = default(ConfluentAgreementResource)) { @@ -64,13 +64,13 @@ public static IPage List(this IMarketplaceAgreements } /// - /// Accept marketplace terms. + /// Create Confluent Marketplace agreement in the subscription. /// /// /// The operations group for this extension method. /// /// - /// Confluent Agreement resource + /// Confluent Marketplace Agreement resource /// /// /// The cancellation token. 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 index 8bb02564592e..59e0da038d21 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ConfluentAgreementResource.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/ConfluentAgreementResource.cs @@ -17,7 +17,7 @@ namespace Microsoft.Azure.Management.Confluent.Models using System.Linq; /// - /// Confluent Agreements Resource. + /// Agreement Terms definition /// [Rest.Serialization.JsonTransformation] public partial class ConfluentAgreementResource : IResource @@ -33,9 +33,11 @@ public ConfluentAgreementResource() /// /// Initializes a new instance of the ConfluentAgreementResource class. /// - /// ARM id of the resource. - /// Name of the agreement. - /// The type of the resource. + /// The ARM id of the resource. + /// The name of the agreement. + /// The type of the agreement. + /// Metadata pertaining to creation and last + /// modification of the resource /// Publisher identifier string. /// Product identifier string. /// Plan identifier string. @@ -48,11 +50,12 @@ public ConfluentAgreementResource() /// Terms signature. /// If any version of the terms have been /// accepted, otherwise false. - public ConfluentAgreementResource(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), bool? accepted = default(bool?)) + public ConfluentAgreementResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), 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?)) { Id = id; Name = name; Type = type; + SystemData = systemData; Publisher = publisher; Product = product; Plan = plan; @@ -70,23 +73,30 @@ public ConfluentAgreementResource() partial void CustomInit(); /// - /// Gets ARM id of the resource. + /// Gets the ARM id of the resource. /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets name of the agreement. + /// Gets the name of the agreement. /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets the type of the resource. + /// Gets the type of the agreement. /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Gets metadata pertaining to creation and last modification of the + /// resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Gets or sets publisher identifier string. /// diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/CreatedByType.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..6dcd3cacb691 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OfferDetail.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OfferDetail.cs index 92f7f74e5d85..d06153f544ce 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OfferDetail.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OfferDetail.cs @@ -39,7 +39,7 @@ public OfferDetail() /// '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)) + public OfferDetail(string publisherId, string id, string planId, string planName, string termUnit, string status = default(string)) { PublisherId = publisherId; Id = id; @@ -101,6 +101,26 @@ public OfferDetail() /// public virtual void Validate() { + if (PublisherId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PublisherId"); + } + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + if (PlanId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PlanId"); + } + if (PlanName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PlanName"); + } + if (TermUnit == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TermUnit"); + } if (PublisherId != null) { if (PublisherId.Length > 50) 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 index 88b34bce0955..ece55960778c 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResource.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResource.cs @@ -35,9 +35,13 @@ public OrganizationResource() /// /// Initializes a new instance of the OrganizationResource class. /// + /// Confluent offer detail + /// Subscriber detail /// The ARM id of the resource. /// The name of the resource. /// The type of the resource. + /// Metadata pertaining to creation and last + /// modification of the resource /// The creation time of the /// resource. /// Provision states for confluent RP. @@ -48,15 +52,14 @@ public OrganizationResource() /// 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)) + public OrganizationResource(OfferDetail offerDetail, UserDetail userDetail, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.DateTime? createdTime = default(System.DateTime?), string provisioningState = default(string), string organizationId = default(string), string ssoUrl = default(string), IDictionary tags = default(IDictionary), string location = default(string)) { Id = id; Name = name; Type = type; + SystemData = systemData; CreatedTime = createdTime; ProvisioningState = provisioningState; OrganizationId = organizationId; @@ -91,6 +94,13 @@ public OrganizationResource() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Gets metadata pertaining to creation and last modification of the + /// resource + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Gets the creation time of the resource. /// @@ -98,12 +108,12 @@ public OrganizationResource() 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' + /// Gets 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; } + public string ProvisioningState { get; private set; } /// /// Gets id of the Confluent organization. @@ -121,13 +131,13 @@ public OrganizationResource() /// Gets or sets confluent offer detail /// [JsonProperty(PropertyName = "properties.offerDetail")] - public OrganizationResourcePropertiesOfferDetail OfferDetail { get; set; } + public OfferDetail OfferDetail { get; set; } /// /// Gets or sets subscriber detail /// [JsonProperty(PropertyName = "properties.userDetail")] - public OrganizationResourcePropertiesUserDetail UserDetail { get; set; } + public UserDetail UserDetail { get; set; } /// /// Gets or sets organization resource tags @@ -141,5 +151,30 @@ public OrganizationResource() [JsonProperty(PropertyName = "location")] public string Location { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (OfferDetail == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OfferDetail"); + } + if (UserDetail == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "UserDetail"); + } + if (OfferDetail != null) + { + OfferDetail.Validate(); + } + if (UserDetail != null) + { + UserDetail.Validate(); + } + } } } 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 deleted file mode 100644 index d3075d98127f..000000000000 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourceProperties.cs +++ /dev/null @@ -1,101 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.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 deleted file mode 100644 index d658b00b25d0..000000000000 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesOfferDetail.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.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 deleted file mode 100644 index db8fbb989149..000000000000 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/OrganizationResourcePropertiesUserDetail.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.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/SystemData.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..880fbeeacf6a --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/UserDetail.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/Models/UserDetail.cs index d435c68c65fa..98afaf6c5441 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 @@ -30,10 +30,10 @@ public UserDetail() /// /// Initializes a new instance of the UserDetail class. /// + /// Email address /// First name /// Last name - /// Email address - public UserDetail(string firstName = default(string), string lastName = default(string), string emailAddress = default(string)) + public UserDetail(string emailAddress, string firstName = default(string), string lastName = default(string)) { FirstName = firstName; LastName = lastName; @@ -72,6 +72,10 @@ public UserDetail() /// public virtual void Validate() { + if (EmailAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "EmailAddress"); + } if (FirstName != null) { if (FirstName.Length > 50) @@ -88,9 +92,9 @@ public virtual void Validate() } if (EmailAddress != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(EmailAddress, "\\S+@\\S+\\.\\S+")) + if (!System.Text.RegularExpressions.Regex.IsMatch(EmailAddress, "^\\S+@\\S+\\.\\S+$")) { - throw new ValidationException(ValidationRules.Pattern, "EmailAddress", "\\S+@\\S+\\.\\S+"); + throw new ValidationException(ValidationRules.Pattern, "EmailAddress", "^\\S+@\\S+\\.\\S+$"); } } } diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperations.cs index 061e72639640..079aa5a53c5e 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperations.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/OrganizationOperationsOperations.cs @@ -881,6 +881,10 @@ internal OrganizationOperationsOperations(ConfluentManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "organizationName"); } + if (body != null) + { + body.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 index ad5da04ed629..85014386a536 100644 --- a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/SdkInfo_ConfluentManagementClient.cs +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/SdkInfo_ConfluentManagementClient.cs @@ -19,22 +19,12 @@ public static IEnumerable> ApiInfo_ConfluentManage { return new Tuple[] { - new Tuple("Confluent", "MarketplaceAgreements", "2020-03-01"), - new Tuple("Confluent", "Organization", "2020-03-01"), - new Tuple("Confluent", "OrganizationOperations", "2020-03-01"), + new Tuple("Confluent", "MarketplaceAgreements", "2021-03-01-preview"), + new Tuple("Confluent", "Organization", "2021-03-01-preview"), + new Tuple("Confluent", "OrganizationOperations", "2021-03-01-preview"), + new Tuple("Confluent", "Validations", "2021-03-01-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/confluent/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Users\\sralluri\\source\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "14313ea8bb4807f71b970334262b4e199797a4a1"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ValidationsOperations.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ValidationsOperations.cs new file mode 100644 index 000000000000..6907152f9f52 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ValidationsOperations.cs @@ -0,0 +1,259 @@ +// +// 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; + + /// + /// ValidationsOperations operations. + /// + internal partial class ValidationsOperations : IServiceOperations, IValidationsOperations + { + /// + /// Initializes a new instance of the ValidationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ValidationsOperations(ConfluentManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ConfluentManagementClient + /// + public ConfluentManagementClient Client { get; private set; } + + /// + /// Organization Validate proxy 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> ValidateOrganizationWithHttpMessagesAsync(string resourceGroupName, string organizationName, OrganizationResource body, 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"); + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("organizationName", organizationName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ValidateOrganization", 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/validations/{organizationName}/orgvalidate").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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ResourceProviderDefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ResourceProviderDefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // 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/ValidationsOperationsExtensions.cs b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ValidationsOperationsExtensions.cs new file mode 100644 index 000000000000..c04ad8aa5820 --- /dev/null +++ b/sdk/confluent/Microsoft.Azure.Management.Confluent/src/Generated/ValidationsOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Confluent +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ValidationsOperations. + /// + public static partial class ValidationsOperationsExtensions + { + /// + /// Organization Validate proxy resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + public static OrganizationResource ValidateOrganization(this IValidationsOperations operations, string resourceGroupName, string organizationName, OrganizationResource body) + { + return operations.ValidateOrganizationAsync(resourceGroupName, organizationName, body).GetAwaiter().GetResult(); + } + + /// + /// Organization Validate proxy resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name + /// + /// + /// Organization resource name + /// + /// + /// Organization resource model + /// + /// + /// The cancellation token. + /// + public static async Task ValidateOrganizationAsync(this IValidationsOperations operations, string resourceGroupName, string organizationName, OrganizationResource body, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateOrganizationWithHttpMessagesAsync(resourceGroupName, organizationName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}