Skip to content

Commit

Permalink
[IotHub] Az.IotHub the Track 1 to SDK (Azure#26845)
Browse files Browse the repository at this point in the history
* Az.IotHub the Track 1 to SDK

* update changelog
  • Loading branch information
lijinpei2008 authored Dec 9, 2024
1 parent e6142d5 commit 2815707
Showing 141 changed files with 27,522 additions and 19,217 deletions.
1,464 changes: 1,464 additions & 0 deletions src/IotHub/IotHub.Management.Sdk/Generated/CertificatesOperations.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
// 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.IotHub
{
using Microsoft.Rest.Azure;
using Models;

/// <summary>
/// Extension methods for CertificatesOperations
/// </summary>
public static partial class CertificatesOperationsExtensions
{
/// <summary>
/// Returns the list of certificates.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
public static CertificateListDescription ListByIotHub(this ICertificatesOperations operations, string resourceGroupName, string resourceName)
{
return ((ICertificatesOperations)operations).ListByIotHubAsync(resourceGroupName, resourceName).GetAwaiter().GetResult();
}

/// <summary>
/// Returns the list of certificates.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<CertificateListDescription> ListByIotHubAsync(this ICertificatesOperations operations, string resourceGroupName, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
using (var _result = await operations.ListByIotHubWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Returns the certificate.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
public static CertificateDescription Get(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName)
{
return ((ICertificatesOperations)operations).GetAsync(resourceGroupName, resourceName, certificateName).GetAwaiter().GetResult();
}

/// <summary>
/// Returns the certificate.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<CertificateDescription> GetAsync(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, certificateName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Adds new or replaces existing certificate.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
/// <param name='ifMatch'>
/// ETag of the Certificate. Do not specify for creating a brand new
/// certificate. Required to update an existing certificate.
/// </param>
public static CertificateDescription CreateOrUpdate(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, CertificateDescription certificateDescription, string ifMatch = default(string))
{
return ((ICertificatesOperations)operations).CreateOrUpdateAsync(resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch).GetAwaiter().GetResult();
}

/// <summary>
/// Adds new or replaces existing certificate.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
/// <param name='ifMatch'>
/// ETag of the Certificate. Do not specify for creating a brand new
/// certificate. Required to update an existing certificate.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<CertificateDescription> CreateOrUpdateAsync(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, CertificateDescription certificateDescription, string ifMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Deletes an existing X509 certificate or does nothing if it does not exist.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
/// <param name='ifMatch'>
/// ETag of the Certificate.
/// </param>
public static void Delete(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, string ifMatch)
{
((ICertificatesOperations)operations).DeleteAsync(resourceGroupName, resourceName, certificateName, ifMatch).GetAwaiter().GetResult();
}

/// <summary>
/// Deletes an existing X509 certificate or does nothing if it does not exist.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
/// <param name='ifMatch'>
/// ETag of the Certificate.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task DeleteAsync(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, string ifMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
(await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, certificateName, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
/// <summary>
/// Generates verification code for proof of possession flow. The verification
/// code will be used to generate a leaf certificate.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
/// <param name='ifMatch'>
/// ETag of the Certificate.
/// </param>
public static CertificateWithNonceDescription GenerateVerificationCode(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, string ifMatch)
{
return ((ICertificatesOperations)operations).GenerateVerificationCodeAsync(resourceGroupName, resourceName, certificateName, ifMatch).GetAwaiter().GetResult();
}

/// <summary>
/// Generates verification code for proof of possession flow. The verification
/// code will be used to generate a leaf certificate.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
/// <param name='ifMatch'>
/// ETag of the Certificate.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<CertificateWithNonceDescription> GenerateVerificationCodeAsync(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, string ifMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
using (var _result = await operations.GenerateVerificationCodeWithHttpMessagesAsync(resourceGroupName, resourceName, certificateName, ifMatch, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
/// <summary>
/// Verifies the certificate&#39;s private key possession by providing the leaf
/// cert issued by the verifying pre uploaded certificate.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
/// <param name='ifMatch'>
/// ETag of the Certificate.
/// </param>
public static CertificateDescription Verify(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, string ifMatch, CertificateVerificationDescription certificateVerificationBody)
{
return ((ICertificatesOperations)operations).VerifyAsync(resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody).GetAwaiter().GetResult();
}

/// <summary>
/// Verifies the certificate&#39;s private key possession by providing the leaf
/// cert issued by the verifying pre uploaded certificate.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the IoT hub.
/// </param>
/// <param name='resourceName'>
/// The name of the IoT hub.
/// </param>
/// <param name='certificateName'>
/// The name of the certificate
/// </param>
/// <param name='ifMatch'>
/// ETag of the Certificate.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<CertificateDescription> VerifyAsync(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, string ifMatch, CertificateVerificationDescription certificateVerificationBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
using (var _result = await operations.VerifyWithHttpMessagesAsync(resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
}
}
Loading

0 comments on commit 2815707

Please sign in to comment.