| | 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.Batch.Protocol |
| | 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 CertificateOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class CertificateOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Adds a Certificate to the specified Account. |
| | 26 | | /// </summary> |
| | 27 | | /// <param name='operations'> |
| | 28 | | /// The operations group for this extension method. |
| | 29 | | /// </param> |
| | 30 | | /// <param name='certificate'> |
| | 31 | | /// The Certificate to be added. |
| | 32 | | /// </param> |
| | 33 | | /// <param name='certificateAddOptions'> |
| | 34 | | /// Additional parameters for the operation |
| | 35 | | /// </param> |
| | 36 | | public static CertificateAddHeaders Add(this ICertificateOperations operations, CertificateAddParameter cert |
| | 37 | | { |
| 0 | 38 | | return operations.AddAsync(certificate, certificateAddOptions).GetAwaiter().GetResult(); |
| | 39 | | } |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// Adds a Certificate to the specified Account. |
| | 43 | | /// </summary> |
| | 44 | | /// <param name='operations'> |
| | 45 | | /// The operations group for this extension method. |
| | 46 | | /// </param> |
| | 47 | | /// <param name='certificate'> |
| | 48 | | /// The Certificate to be added. |
| | 49 | | /// </param> |
| | 50 | | /// <param name='certificateAddOptions'> |
| | 51 | | /// Additional parameters for the operation |
| | 52 | | /// </param> |
| | 53 | | /// <param name='cancellationToken'> |
| | 54 | | /// The cancellation token. |
| | 55 | | /// </param> |
| | 56 | | public static async Task<CertificateAddHeaders> AddAsync(this ICertificateOperations operations, Certificate |
| | 57 | | { |
| 0 | 58 | | using (var _result = await operations.AddWithHttpMessagesAsync(certificate, certificateAddOptions, null, |
| | 59 | | { |
| 0 | 60 | | return _result.Headers; |
| | 61 | | } |
| 0 | 62 | | } |
| | 63 | |
|
| | 64 | | /// <summary> |
| | 65 | | /// Lists all of the Certificates that have been added to the specified |
| | 66 | | /// Account. |
| | 67 | | /// </summary> |
| | 68 | | /// <param name='operations'> |
| | 69 | | /// The operations group for this extension method. |
| | 70 | | /// </param> |
| | 71 | | /// <param name='certificateListOptions'> |
| | 72 | | /// Additional parameters for the operation |
| | 73 | | /// </param> |
| | 74 | | public static IPage<Certificate> List(this ICertificateOperations operations, CertificateListOptions certifi |
| | 75 | | { |
| 0 | 76 | | return operations.ListAsync(certificateListOptions).GetAwaiter().GetResult(); |
| | 77 | | } |
| | 78 | |
|
| | 79 | | /// <summary> |
| | 80 | | /// Lists all of the Certificates that have been added to the specified |
| | 81 | | /// Account. |
| | 82 | | /// </summary> |
| | 83 | | /// <param name='operations'> |
| | 84 | | /// The operations group for this extension method. |
| | 85 | | /// </param> |
| | 86 | | /// <param name='certificateListOptions'> |
| | 87 | | /// Additional parameters for the operation |
| | 88 | | /// </param> |
| | 89 | | /// <param name='cancellationToken'> |
| | 90 | | /// The cancellation token. |
| | 91 | | /// </param> |
| | 92 | | public static async Task<IPage<Certificate>> ListAsync(this ICertificateOperations operations, CertificateLi |
| | 93 | | { |
| 0 | 94 | | using (var _result = await operations.ListWithHttpMessagesAsync(certificateListOptions, null, cancellati |
| | 95 | | { |
| 0 | 96 | | return _result.Body; |
| | 97 | | } |
| 0 | 98 | | } |
| | 99 | |
|
| | 100 | | /// <summary> |
| | 101 | | /// Cancels a failed deletion of a Certificate from the specified Account. |
| | 102 | | /// </summary> |
| | 103 | | /// <remarks> |
| | 104 | | /// If you try to delete a Certificate that is being used by a Pool or Compute |
| | 105 | | /// Node, the status of the Certificate changes to deleteFailed. If you decide |
| | 106 | | /// that you want to continue using the Certificate, you can use this operation |
| | 107 | | /// to set the status of the Certificate back to active. If you intend to |
| | 108 | | /// delete the Certificate, you do not need to run this operation after the |
| | 109 | | /// deletion failed. You must make sure that the Certificate is not being used |
| | 110 | | /// by any resources, and then you can try again to delete the Certificate. |
| | 111 | | /// </remarks> |
| | 112 | | /// <param name='operations'> |
| | 113 | | /// The operations group for this extension method. |
| | 114 | | /// </param> |
| | 115 | | /// <param name='thumbprintAlgorithm'> |
| | 116 | | /// The algorithm used to derive the thumbprint parameter. This must be sha1. |
| | 117 | | /// </param> |
| | 118 | | /// <param name='thumbprint'> |
| | 119 | | /// The thumbprint of the Certificate being deleted. |
| | 120 | | /// </param> |
| | 121 | | /// <param name='certificateCancelDeletionOptions'> |
| | 122 | | /// Additional parameters for the operation |
| | 123 | | /// </param> |
| | 124 | | public static CertificateCancelDeletionHeaders CancelDeletion(this ICertificateOperations operations, string |
| | 125 | | { |
| 0 | 126 | | return operations.CancelDeletionAsync(thumbprintAlgorithm, thumbprint, certificateCancelDeletionOptions) |
| | 127 | | } |
| | 128 | |
|
| | 129 | | /// <summary> |
| | 130 | | /// Cancels a failed deletion of a Certificate from the specified Account. |
| | 131 | | /// </summary> |
| | 132 | | /// <remarks> |
| | 133 | | /// If you try to delete a Certificate that is being used by a Pool or Compute |
| | 134 | | /// Node, the status of the Certificate changes to deleteFailed. If you decide |
| | 135 | | /// that you want to continue using the Certificate, you can use this operation |
| | 136 | | /// to set the status of the Certificate back to active. If you intend to |
| | 137 | | /// delete the Certificate, you do not need to run this operation after the |
| | 138 | | /// deletion failed. You must make sure that the Certificate is not being used |
| | 139 | | /// by any resources, and then you can try again to delete the Certificate. |
| | 140 | | /// </remarks> |
| | 141 | | /// <param name='operations'> |
| | 142 | | /// The operations group for this extension method. |
| | 143 | | /// </param> |
| | 144 | | /// <param name='thumbprintAlgorithm'> |
| | 145 | | /// The algorithm used to derive the thumbprint parameter. This must be sha1. |
| | 146 | | /// </param> |
| | 147 | | /// <param name='thumbprint'> |
| | 148 | | /// The thumbprint of the Certificate being deleted. |
| | 149 | | /// </param> |
| | 150 | | /// <param name='certificateCancelDeletionOptions'> |
| | 151 | | /// Additional parameters for the operation |
| | 152 | | /// </param> |
| | 153 | | /// <param name='cancellationToken'> |
| | 154 | | /// The cancellation token. |
| | 155 | | /// </param> |
| | 156 | | public static async Task<CertificateCancelDeletionHeaders> CancelDeletionAsync(this ICertificateOperations o |
| | 157 | | { |
| 0 | 158 | | using (var _result = await operations.CancelDeletionWithHttpMessagesAsync(thumbprintAlgorithm, thumbprin |
| | 159 | | { |
| 0 | 160 | | return _result.Headers; |
| | 161 | | } |
| 0 | 162 | | } |
| | 163 | |
|
| | 164 | | /// <summary> |
| | 165 | | /// Deletes a Certificate from the specified Account. |
| | 166 | | /// </summary> |
| | 167 | | /// <remarks> |
| | 168 | | /// You cannot delete a Certificate if a resource (Pool or Compute Node) is |
| | 169 | | /// using it. Before you can delete a Certificate, you must therefore make sure |
| | 170 | | /// that the Certificate is not associated with any existing Pools, the |
| | 171 | | /// Certificate is not installed on any Nodes (even if you remove a Certificate |
| | 172 | | /// from a Pool, it is not removed from existing Compute Nodes in that Pool |
| | 173 | | /// until they restart), and no running Tasks depend on the Certificate. If you |
| | 174 | | /// try to delete a Certificate that is in use, the deletion fails. The |
| | 175 | | /// Certificate status changes to deleteFailed. You can use Cancel Delete |
| | 176 | | /// Certificate to set the status back to active if you decide that you want to |
| | 177 | | /// continue using the Certificate. |
| | 178 | | /// </remarks> |
| | 179 | | /// <param name='operations'> |
| | 180 | | /// The operations group for this extension method. |
| | 181 | | /// </param> |
| | 182 | | /// <param name='thumbprintAlgorithm'> |
| | 183 | | /// The algorithm used to derive the thumbprint parameter. This must be sha1. |
| | 184 | | /// </param> |
| | 185 | | /// <param name='thumbprint'> |
| | 186 | | /// The thumbprint of the Certificate to be deleted. |
| | 187 | | /// </param> |
| | 188 | | /// <param name='certificateDeleteOptions'> |
| | 189 | | /// Additional parameters for the operation |
| | 190 | | /// </param> |
| | 191 | | public static CertificateDeleteHeaders Delete(this ICertificateOperations operations, string thumbprintAlgor |
| | 192 | | { |
| 0 | 193 | | return operations.DeleteAsync(thumbprintAlgorithm, thumbprint, certificateDeleteOptions).GetAwaiter().Ge |
| | 194 | | } |
| | 195 | |
|
| | 196 | | /// <summary> |
| | 197 | | /// Deletes a Certificate from the specified Account. |
| | 198 | | /// </summary> |
| | 199 | | /// <remarks> |
| | 200 | | /// You cannot delete a Certificate if a resource (Pool or Compute Node) is |
| | 201 | | /// using it. Before you can delete a Certificate, you must therefore make sure |
| | 202 | | /// that the Certificate is not associated with any existing Pools, the |
| | 203 | | /// Certificate is not installed on any Nodes (even if you remove a Certificate |
| | 204 | | /// from a Pool, it is not removed from existing Compute Nodes in that Pool |
| | 205 | | /// until they restart), and no running Tasks depend on the Certificate. If you |
| | 206 | | /// try to delete a Certificate that is in use, the deletion fails. The |
| | 207 | | /// Certificate status changes to deleteFailed. You can use Cancel Delete |
| | 208 | | /// Certificate to set the status back to active if you decide that you want to |
| | 209 | | /// continue using the Certificate. |
| | 210 | | /// </remarks> |
| | 211 | | /// <param name='operations'> |
| | 212 | | /// The operations group for this extension method. |
| | 213 | | /// </param> |
| | 214 | | /// <param name='thumbprintAlgorithm'> |
| | 215 | | /// The algorithm used to derive the thumbprint parameter. This must be sha1. |
| | 216 | | /// </param> |
| | 217 | | /// <param name='thumbprint'> |
| | 218 | | /// The thumbprint of the Certificate to be deleted. |
| | 219 | | /// </param> |
| | 220 | | /// <param name='certificateDeleteOptions'> |
| | 221 | | /// Additional parameters for the operation |
| | 222 | | /// </param> |
| | 223 | | /// <param name='cancellationToken'> |
| | 224 | | /// The cancellation token. |
| | 225 | | /// </param> |
| | 226 | | public static async Task<CertificateDeleteHeaders> DeleteAsync(this ICertificateOperations operations, strin |
| | 227 | | { |
| 0 | 228 | | using (var _result = await operations.DeleteWithHttpMessagesAsync(thumbprintAlgorithm, thumbprint, certi |
| | 229 | | { |
| 0 | 230 | | return _result.Headers; |
| | 231 | | } |
| 0 | 232 | | } |
| | 233 | |
|
| | 234 | | /// <summary> |
| | 235 | | /// Gets information about the specified Certificate. |
| | 236 | | /// </summary> |
| | 237 | | /// <param name='operations'> |
| | 238 | | /// The operations group for this extension method. |
| | 239 | | /// </param> |
| | 240 | | /// <param name='thumbprintAlgorithm'> |
| | 241 | | /// The algorithm used to derive the thumbprint parameter. This must be sha1. |
| | 242 | | /// </param> |
| | 243 | | /// <param name='thumbprint'> |
| | 244 | | /// The thumbprint of the Certificate to get. |
| | 245 | | /// </param> |
| | 246 | | /// <param name='certificateGetOptions'> |
| | 247 | | /// Additional parameters for the operation |
| | 248 | | /// </param> |
| | 249 | | public static Certificate Get(this ICertificateOperations operations, string thumbprintAlgorithm, string thu |
| | 250 | | { |
| 0 | 251 | | return operations.GetAsync(thumbprintAlgorithm, thumbprint, certificateGetOptions).GetAwaiter().GetResul |
| | 252 | | } |
| | 253 | |
|
| | 254 | | /// <summary> |
| | 255 | | /// Gets information about the specified Certificate. |
| | 256 | | /// </summary> |
| | 257 | | /// <param name='operations'> |
| | 258 | | /// The operations group for this extension method. |
| | 259 | | /// </param> |
| | 260 | | /// <param name='thumbprintAlgorithm'> |
| | 261 | | /// The algorithm used to derive the thumbprint parameter. This must be sha1. |
| | 262 | | /// </param> |
| | 263 | | /// <param name='thumbprint'> |
| | 264 | | /// The thumbprint of the Certificate to get. |
| | 265 | | /// </param> |
| | 266 | | /// <param name='certificateGetOptions'> |
| | 267 | | /// Additional parameters for the operation |
| | 268 | | /// </param> |
| | 269 | | /// <param name='cancellationToken'> |
| | 270 | | /// The cancellation token. |
| | 271 | | /// </param> |
| | 272 | | public static async Task<Certificate> GetAsync(this ICertificateOperations operations, string thumbprintAlgo |
| | 273 | | { |
| 0 | 274 | | using (var _result = await operations.GetWithHttpMessagesAsync(thumbprintAlgorithm, thumbprint, certific |
| | 275 | | { |
| 0 | 276 | | return _result.Body; |
| | 277 | | } |
| 0 | 278 | | } |
| | 279 | |
|
| | 280 | | /// <summary> |
| | 281 | | /// Lists all of the Certificates that have been added to the specified |
| | 282 | | /// Account. |
| | 283 | | /// </summary> |
| | 284 | | /// <param name='operations'> |
| | 285 | | /// The operations group for this extension method. |
| | 286 | | /// </param> |
| | 287 | | /// <param name='nextPageLink'> |
| | 288 | | /// The NextLink from the previous successful call to List operation. |
| | 289 | | /// </param> |
| | 290 | | /// <param name='certificateListNextOptions'> |
| | 291 | | /// Additional parameters for the operation |
| | 292 | | /// </param> |
| | 293 | | public static IPage<Certificate> ListNext(this ICertificateOperations operations, string nextPageLink, Certi |
| | 294 | | { |
| 0 | 295 | | return operations.ListNextAsync(nextPageLink, certificateListNextOptions).GetAwaiter().GetResult(); |
| | 296 | | } |
| | 297 | |
|
| | 298 | | /// <summary> |
| | 299 | | /// Lists all of the Certificates that have been added to the specified |
| | 300 | | /// Account. |
| | 301 | | /// </summary> |
| | 302 | | /// <param name='operations'> |
| | 303 | | /// The operations group for this extension method. |
| | 304 | | /// </param> |
| | 305 | | /// <param name='nextPageLink'> |
| | 306 | | /// The NextLink from the previous successful call to List operation. |
| | 307 | | /// </param> |
| | 308 | | /// <param name='certificateListNextOptions'> |
| | 309 | | /// Additional parameters for the operation |
| | 310 | | /// </param> |
| | 311 | | /// <param name='cancellationToken'> |
| | 312 | | /// The cancellation token. |
| | 313 | | /// </param> |
| | 314 | | public static async Task<IPage<Certificate>> ListNextAsync(this ICertificateOperations operations, string ne |
| | 315 | | { |
| 0 | 316 | | using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, certificateListNextOpt |
| | 317 | | { |
| 0 | 318 | | return _result.Body; |
| | 319 | | } |
| 0 | 320 | | } |
| | 321 | |
|
| | 322 | | } |
| | 323 | | } |