From 3889208bcc6e3781f153d2d732265e1e95e73305 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 8 Jul 2021 08:13:01 +0000 Subject: [PATCH] CodeGen from PR 12427 in Azure/azure-rest-api-specs Added isVeritied field to CertificateBodyDescription. (#12427) --- .../src/Generated/DpsCertificateOperations.cs | 16 ++++++-------- .../DpsCertificateOperationsExtensions.cs | 22 +++++++++---------- .../Generated/IDpsCertificateOperations.cs | 9 ++++---- .../Models/CertificateBodyDescription.cs | 13 ++++++++++- .../src/Generated/SdkInfo_iotDpsClient.cs | 11 ---------- 5 files changed, 33 insertions(+), 38 deletions(-) diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperations.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperations.cs index 8069f6cf91d1..681c44a2f83d 100644 --- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperations.cs +++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperations.cs @@ -277,14 +277,13 @@ internal DpsCertificateOperations(IotDpsClient client) /// /// The name of the certificate create or update. /// + /// + /// The certificate body. + /// /// /// ETag of the certificate. This is required to update an existing /// certificate, and ignored while creating a brand new certificate. /// - /// - /// Base-64 representation of the X509 leaf certificate .cer file or just .pem - /// file content. - /// /// /// Headers that will be added to request. /// @@ -306,7 +305,7 @@ internal DpsCertificateOperations(IotDpsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch = default(string), string certificate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -328,10 +327,9 @@ internal DpsCertificateOperations(IotDpsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "certificateName"); } - CertificateBodyDescription certificateDescription = new CertificateBodyDescription(); - if (certificate != null) + if (certificateDescription == null) { - certificateDescription.Certificate = certificate; + throw new ValidationException(ValidationRules.CannotBeNull, "certificateDescription"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -343,8 +341,8 @@ internal DpsCertificateOperations(IotDpsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("provisioningServiceName", provisioningServiceName); tracingParameters.Add("certificateName", certificateName); - tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("certificateDescription", certificateDescription); + tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperationsExtensions.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperationsExtensions.cs index da68b00bbfc8..a64246965d7c 100644 --- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperationsExtensions.cs +++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperationsExtensions.cs @@ -91,17 +91,16 @@ public static partial class DpsCertificateOperationsExtensions /// /// The name of the certificate create or update. /// + /// + /// The certificate body. + /// /// /// ETag of the certificate. This is required to update an existing /// certificate, and ignored while creating a brand new certificate. /// - /// - /// Base-64 representation of the X509 leaf certificate .cer file or just .pem - /// file content. - /// - public static CertificateResponse CreateOrUpdate(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch = default(string), string certificate = default(string)) + public static CertificateResponse CreateOrUpdate(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string)) { - return operations.CreateOrUpdateAsync(resourceGroupName, provisioningServiceName, certificateName, ifMatch, certificate).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, provisioningServiceName, certificateName, certificateDescription, ifMatch).GetAwaiter().GetResult(); } /// @@ -122,20 +121,19 @@ public static partial class DpsCertificateOperationsExtensions /// /// The name of the certificate create or update. /// + /// + /// The certificate body. + /// /// /// ETag of the certificate. This is required to update an existing /// certificate, and ignored while creating a brand new certificate. /// - /// - /// Base-64 representation of the X509 leaf certificate .cer file or just .pem - /// file content. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch = default(string), string certificate = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, certificateName, ifMatch, certificate, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, certificateName, certificateDescription, ifMatch, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IDpsCertificateOperations.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IDpsCertificateOperations.cs index 9ec14ce8004f..3fd764b79132 100644 --- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IDpsCertificateOperations.cs +++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IDpsCertificateOperations.cs @@ -70,14 +70,13 @@ public partial interface IDpsCertificateOperations /// /// The name of the certificate create or update. /// + /// + /// The certificate body. + /// /// /// ETag of the certificate. This is required to update an existing /// certificate, and ignored while creating a brand new certificate. /// - /// - /// Base-64 representation of the X509 leaf certificate .cer file or - /// just .pem file content. - /// /// /// The headers that will be added to request. /// @@ -93,7 +92,7 @@ public partial interface IDpsCertificateOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch = default(string), string certificate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete the Provisioning Service Certificate. /// diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/CertificateBodyDescription.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/CertificateBodyDescription.cs index 9f0f9360730b..9afb0012a1e2 100644 --- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/CertificateBodyDescription.cs +++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/CertificateBodyDescription.cs @@ -31,9 +31,13 @@ public CertificateBodyDescription() /// /// Base-64 representation of the X509 leaf /// certificate .cer file or just .pem file content. - public CertificateBodyDescription(string certificate = default(string)) + /// True indicates that the certificate will + /// be created in verified state and proof of possession will not be + /// required. + public CertificateBodyDescription(string certificate = default(string), bool? isVerified = default(bool?)) { Certificate = certificate; + IsVerified = isVerified; CustomInit(); } @@ -49,5 +53,12 @@ public CertificateBodyDescription() [JsonProperty(PropertyName = "certificate")] public string Certificate { get; set; } + /// + /// Gets or sets true indicates that the certificate will be created in + /// verified state and proof of possession will not be required. + /// + [JsonProperty(PropertyName = "isVerified")] + public bool? IsVerified { get; set; } + } } diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/SdkInfo_iotDpsClient.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/SdkInfo_iotDpsClient.cs index 1820b9445880..3b70d953c078 100644 --- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/SdkInfo_iotDpsClient.cs +++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/SdkInfo_iotDpsClient.cs @@ -25,16 +25,5 @@ public static IEnumerable> ApiInfo_iotDpsClient }.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/deviceprovisioningservices/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\code\\Azure\\asfn1\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "c16cf9c92d5c28983a8bbeb56bc02674cb2f77ec"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -