| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.Attestation |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Microsoft.Rest.Azure; |
| | 15 | | using Models; |
| | 16 | | using System.Threading; |
| | 17 | | using System.Threading.Tasks; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Extension methods for PolicyCertificatesOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class PolicyCertificatesOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Retrieves the set of certificates used to express policy for the current |
| | 26 | | /// tenant. |
| | 27 | | /// </summary> |
| | 28 | | /// <param name='operations'> |
| | 29 | | /// The operations group for this extension method. |
| | 30 | | /// </param> |
| | 31 | | /// <param name='tenantBaseUrl'> |
| | 32 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 33 | | /// </param> |
| | 34 | | public static object Get(this IPolicyCertificatesOperations operations, string tenantBaseUrl) |
| | 35 | | { |
| 0 | 36 | | return operations.GetAsync(tenantBaseUrl).GetAwaiter().GetResult(); |
| | 37 | | } |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// Retrieves the set of certificates used to express policy for the current |
| | 41 | | /// tenant. |
| | 42 | | /// </summary> |
| | 43 | | /// <param name='operations'> |
| | 44 | | /// The operations group for this extension method. |
| | 45 | | /// </param> |
| | 46 | | /// <param name='tenantBaseUrl'> |
| | 47 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 48 | | /// </param> |
| | 49 | | /// <param name='cancellationToken'> |
| | 50 | | /// The cancellation token. |
| | 51 | | /// </param> |
| | 52 | | public static async Task<object> GetAsync(this IPolicyCertificatesOperations operations, string tenantBaseUr |
| | 53 | | { |
| 0 | 54 | | using (var _result = await operations.GetWithHttpMessagesAsync(tenantBaseUrl, null, cancellationToken).C |
| | 55 | | { |
| 0 | 56 | | return _result.Body; |
| | 57 | | } |
| 0 | 58 | | } |
| | 59 | |
|
| | 60 | | /// <summary> |
| | 61 | | /// Adds a new attestation policy certificate to the set of policy management |
| | 62 | | /// certificates. |
| | 63 | | /// </summary> |
| | 64 | | /// <param name='operations'> |
| | 65 | | /// The operations group for this extension method. |
| | 66 | | /// </param> |
| | 67 | | /// <param name='tenantBaseUrl'> |
| | 68 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 69 | | /// </param> |
| | 70 | | /// <param name='policyCertificateToAdd'> |
| | 71 | | /// An RFC7519 JSON Web Token containing a claim named "aas-policyCertificate" |
| | 72 | | /// whose value is an RFC7517 JSON Web Key which specifies a new key to add. |
| | 73 | | /// The RFC7519 JWT must be signed with one of the existing signing |
| | 74 | | /// certificates |
| | 75 | | /// </param> |
| | 76 | | public static object Add(this IPolicyCertificatesOperations operations, string tenantBaseUrl, string policyC |
| | 77 | | { |
| 0 | 78 | | return operations.AddAsync(tenantBaseUrl, policyCertificateToAdd).GetAwaiter().GetResult(); |
| | 79 | | } |
| | 80 | |
|
| | 81 | | /// <summary> |
| | 82 | | /// Adds a new attestation policy certificate to the set of policy management |
| | 83 | | /// certificates. |
| | 84 | | /// </summary> |
| | 85 | | /// <param name='operations'> |
| | 86 | | /// The operations group for this extension method. |
| | 87 | | /// </param> |
| | 88 | | /// <param name='tenantBaseUrl'> |
| | 89 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 90 | | /// </param> |
| | 91 | | /// <param name='policyCertificateToAdd'> |
| | 92 | | /// An RFC7519 JSON Web Token containing a claim named "aas-policyCertificate" |
| | 93 | | /// whose value is an RFC7517 JSON Web Key which specifies a new key to add. |
| | 94 | | /// The RFC7519 JWT must be signed with one of the existing signing |
| | 95 | | /// certificates |
| | 96 | | /// </param> |
| | 97 | | /// <param name='cancellationToken'> |
| | 98 | | /// The cancellation token. |
| | 99 | | /// </param> |
| | 100 | | public static async Task<object> AddAsync(this IPolicyCertificatesOperations operations, string tenantBaseUr |
| | 101 | | { |
| 0 | 102 | | using (var _result = await operations.AddWithHttpMessagesAsync(tenantBaseUrl, policyCertificateToAdd, nu |
| | 103 | | { |
| 0 | 104 | | return _result.Body; |
| | 105 | | } |
| 0 | 106 | | } |
| | 107 | |
|
| | 108 | | /// <summary> |
| | 109 | | /// Removes the specified policy management certificate. Note that the final |
| | 110 | | /// policy management certificate cannot be removed. |
| | 111 | | /// </summary> |
| | 112 | | /// <param name='operations'> |
| | 113 | | /// The operations group for this extension method. |
| | 114 | | /// </param> |
| | 115 | | /// <param name='tenantBaseUrl'> |
| | 116 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 117 | | /// </param> |
| | 118 | | /// <param name='policyCertificateToRemove'> |
| | 119 | | /// An RFC7519 JSON Web Token containing a claim named "aas-policyCertificate" |
| | 120 | | /// whose value is an RFC7517 JSON Web Key which specifies a new key to update. |
| | 121 | | /// The RFC7519 JWT must be signed with one of the existing signing |
| | 122 | | /// certificates |
| | 123 | | /// </param> |
| | 124 | | public static object Remove(this IPolicyCertificatesOperations operations, string tenantBaseUrl, string poli |
| | 125 | | { |
| 0 | 126 | | return operations.RemoveAsync(tenantBaseUrl, policyCertificateToRemove).GetAwaiter().GetResult(); |
| | 127 | | } |
| | 128 | |
|
| | 129 | | /// <summary> |
| | 130 | | /// Removes the specified policy management certificate. Note that the final |
| | 131 | | /// policy management certificate cannot be removed. |
| | 132 | | /// </summary> |
| | 133 | | /// <param name='operations'> |
| | 134 | | /// The operations group for this extension method. |
| | 135 | | /// </param> |
| | 136 | | /// <param name='tenantBaseUrl'> |
| | 137 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 138 | | /// </param> |
| | 139 | | /// <param name='policyCertificateToRemove'> |
| | 140 | | /// An RFC7519 JSON Web Token containing a claim named "aas-policyCertificate" |
| | 141 | | /// whose value is an RFC7517 JSON Web Key which specifies a new key to update. |
| | 142 | | /// The RFC7519 JWT must be signed with one of the existing signing |
| | 143 | | /// certificates |
| | 144 | | /// </param> |
| | 145 | | /// <param name='cancellationToken'> |
| | 146 | | /// The cancellation token. |
| | 147 | | /// </param> |
| | 148 | | public static async Task<object> RemoveAsync(this IPolicyCertificatesOperations operations, string tenantBas |
| | 149 | | { |
| 0 | 150 | | using (var _result = await operations.RemoveWithHttpMessagesAsync(tenantBaseUrl, policyCertificateToRemo |
| | 151 | | { |
| 0 | 152 | | return _result.Body; |
| | 153 | | } |
| 0 | 154 | | } |
| | 155 | |
|
| | 156 | | } |
| | 157 | | } |