| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Threading; |
| | 10 | | using System.Threading.Tasks; |
| | 11 | | using Azure; |
| | 12 | | using Azure.Core; |
| | 13 | | using Azure.Core.Pipeline; |
| | 14 | | using Azure.ResourceManager.Storage.Models; |
| | 15 | |
|
| | 16 | | namespace Azure.ResourceManager.Storage |
| | 17 | | { |
| | 18 | | /// <summary> The BlobContainers service client. </summary> |
| | 19 | | public partial class BlobContainersOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 208 | 23 | | internal BlobContainersRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of BlobContainersOperations for mocking. </summary> |
| 240 | 25 | | protected BlobContainersOperations() |
| | 26 | | { |
| 240 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of BlobContainersOperations. </summary> |
| | 29 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 30 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 31 | | /// <param name="subscriptionId"> The ID of the target subscription. </param> |
| | 32 | | /// <param name="endpoint"> server parameter. </param> |
| | 33 | | /// <param name="apiVersion"> Api Version. </param> |
| 240 | 34 | | internal BlobContainersOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptio |
| | 35 | | { |
| 240 | 36 | | RestClient = new BlobContainersRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVers |
| 240 | 37 | | _clientDiagnostics = clientDiagnostics; |
| 240 | 38 | | _pipeline = pipeline; |
| 240 | 39 | | } |
| | 40 | |
|
| | 41 | | /// <summary> Creates a new container under the specified account as described by request body. The container re |
| | 42 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 43 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 44 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 45 | | /// <param name="blobContainer"> Properties of the blob container to create. </param> |
| | 46 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 47 | | public virtual async Task<Response<BlobContainer>> CreateAsync(string resourceGroupName, string accountName, str |
| | 48 | | { |
| 34 | 49 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Create"); |
| 34 | 50 | | scope.Start(); |
| | 51 | | try |
| | 52 | | { |
| 34 | 53 | | return await RestClient.CreateAsync(resourceGroupName, accountName, containerName, blobContainer, cancel |
| | 54 | | } |
| 0 | 55 | | catch (Exception e) |
| | 56 | | { |
| 0 | 57 | | scope.Failed(e); |
| 0 | 58 | | throw; |
| | 59 | | } |
| 34 | 60 | | } |
| | 61 | |
|
| | 62 | | /// <summary> Creates a new container under the specified account as described by request body. The container re |
| | 63 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 64 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 65 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 66 | | /// <param name="blobContainer"> Properties of the blob container to create. </param> |
| | 67 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 68 | | public virtual Response<BlobContainer> Create(string resourceGroupName, string accountName, string containerName |
| | 69 | | { |
| 34 | 70 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Create"); |
| 34 | 71 | | scope.Start(); |
| | 72 | | try |
| | 73 | | { |
| 34 | 74 | | return RestClient.Create(resourceGroupName, accountName, containerName, blobContainer, cancellationToken |
| | 75 | | } |
| 0 | 76 | | catch (Exception e) |
| | 77 | | { |
| 0 | 78 | | scope.Failed(e); |
| 0 | 79 | | throw; |
| | 80 | | } |
| 34 | 81 | | } |
| | 82 | |
|
| | 83 | | /// <summary> Updates container properties as specified in request body. Properties not mentioned in the request |
| | 84 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 85 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 86 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 87 | | /// <param name="blobContainer"> Properties to update for the blob container. </param> |
| | 88 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 89 | | public virtual async Task<Response<BlobContainer>> UpdateAsync(string resourceGroupName, string accountName, str |
| | 90 | | { |
| 6 | 91 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Update"); |
| 6 | 92 | | scope.Start(); |
| | 93 | | try |
| | 94 | | { |
| 6 | 95 | | return await RestClient.UpdateAsync(resourceGroupName, accountName, containerName, blobContainer, cancel |
| | 96 | | } |
| 0 | 97 | | catch (Exception e) |
| | 98 | | { |
| 0 | 99 | | scope.Failed(e); |
| 0 | 100 | | throw; |
| | 101 | | } |
| 6 | 102 | | } |
| | 103 | |
|
| | 104 | | /// <summary> Updates container properties as specified in request body. Properties not mentioned in the request |
| | 105 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 106 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 107 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 108 | | /// <param name="blobContainer"> Properties to update for the blob container. </param> |
| | 109 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 110 | | public virtual Response<BlobContainer> Update(string resourceGroupName, string accountName, string containerName |
| | 111 | | { |
| 6 | 112 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Update"); |
| 6 | 113 | | scope.Start(); |
| | 114 | | try |
| | 115 | | { |
| 6 | 116 | | return RestClient.Update(resourceGroupName, accountName, containerName, blobContainer, cancellationToken |
| | 117 | | } |
| 0 | 118 | | catch (Exception e) |
| | 119 | | { |
| 0 | 120 | | scope.Failed(e); |
| 0 | 121 | | throw; |
| | 122 | | } |
| 6 | 123 | | } |
| | 124 | |
|
| | 125 | | /// <summary> Gets properties of a specified container. </summary> |
| | 126 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 127 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 128 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 129 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 130 | | public virtual async Task<Response<BlobContainer>> GetAsync(string resourceGroupName, string accountName, string |
| | 131 | | { |
| 6 | 132 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Get"); |
| 6 | 133 | | scope.Start(); |
| | 134 | | try |
| | 135 | | { |
| 6 | 136 | | return await RestClient.GetAsync(resourceGroupName, accountName, containerName, cancellationToken).Confi |
| | 137 | | } |
| 0 | 138 | | catch (Exception e) |
| | 139 | | { |
| 0 | 140 | | scope.Failed(e); |
| 0 | 141 | | throw; |
| | 142 | | } |
| 6 | 143 | | } |
| | 144 | |
|
| | 145 | | /// <summary> Gets properties of a specified container. </summary> |
| | 146 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 147 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 148 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 149 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 150 | | public virtual Response<BlobContainer> Get(string resourceGroupName, string accountName, string containerName, C |
| | 151 | | { |
| 6 | 152 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Get"); |
| 6 | 153 | | scope.Start(); |
| | 154 | | try |
| | 155 | | { |
| 6 | 156 | | return RestClient.Get(resourceGroupName, accountName, containerName, cancellationToken); |
| | 157 | | } |
| 0 | 158 | | catch (Exception e) |
| | 159 | | { |
| 0 | 160 | | scope.Failed(e); |
| 0 | 161 | | throw; |
| | 162 | | } |
| 6 | 163 | | } |
| | 164 | |
|
| | 165 | | /// <summary> Deletes specified container under its account. </summary> |
| | 166 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 167 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 168 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 169 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 170 | | public virtual async Task<Response> DeleteAsync(string resourceGroupName, string accountName, string containerNa |
| | 171 | | { |
| 10 | 172 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Delete"); |
| 10 | 173 | | scope.Start(); |
| | 174 | | try |
| | 175 | | { |
| 10 | 176 | | return await RestClient.DeleteAsync(resourceGroupName, accountName, containerName, cancellationToken).Co |
| | 177 | | } |
| 0 | 178 | | catch (Exception e) |
| | 179 | | { |
| 0 | 180 | | scope.Failed(e); |
| 0 | 181 | | throw; |
| | 182 | | } |
| 10 | 183 | | } |
| | 184 | |
|
| | 185 | | /// <summary> Deletes specified container under its account. </summary> |
| | 186 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 187 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 188 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 189 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 190 | | public virtual Response Delete(string resourceGroupName, string accountName, string containerName, CancellationT |
| | 191 | | { |
| 10 | 192 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Delete"); |
| 10 | 193 | | scope.Start(); |
| | 194 | | try |
| | 195 | | { |
| 10 | 196 | | return RestClient.Delete(resourceGroupName, accountName, containerName, cancellationToken); |
| | 197 | | } |
| 0 | 198 | | catch (Exception e) |
| | 199 | | { |
| 0 | 200 | | scope.Failed(e); |
| 0 | 201 | | throw; |
| | 202 | | } |
| 10 | 203 | | } |
| | 204 | |
|
| | 205 | | /// <summary> Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follow |
| | 206 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 207 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 208 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 209 | | /// <param name="legalHold"> The LegalHold property that will be set to a blob container. </param> |
| | 210 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 211 | | public virtual async Task<Response<LegalHold>> SetLegalHoldAsync(string resourceGroupName, string accountName, s |
| | 212 | | { |
| 4 | 213 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.SetLegalHold"); |
| 4 | 214 | | scope.Start(); |
| | 215 | | try |
| | 216 | | { |
| 4 | 217 | | return await RestClient.SetLegalHoldAsync(resourceGroupName, accountName, containerName, legalHold, canc |
| | 218 | | } |
| 0 | 219 | | catch (Exception e) |
| | 220 | | { |
| 0 | 221 | | scope.Failed(e); |
| 0 | 222 | | throw; |
| | 223 | | } |
| 4 | 224 | | } |
| | 225 | |
|
| | 226 | | /// <summary> Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follow |
| | 227 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 228 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 229 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 230 | | /// <param name="legalHold"> The LegalHold property that will be set to a blob container. </param> |
| | 231 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 232 | | public virtual Response<LegalHold> SetLegalHold(string resourceGroupName, string accountName, string containerNa |
| | 233 | | { |
| 4 | 234 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.SetLegalHold"); |
| 4 | 235 | | scope.Start(); |
| | 236 | | try |
| | 237 | | { |
| 4 | 238 | | return RestClient.SetLegalHold(resourceGroupName, accountName, containerName, legalHold, cancellationTok |
| | 239 | | } |
| 0 | 240 | | catch (Exception e) |
| | 241 | | { |
| 0 | 242 | | scope.Failed(e); |
| 0 | 243 | | throw; |
| | 244 | | } |
| 4 | 245 | | } |
| | 246 | |
|
| | 247 | | /// <summary> Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. |
| | 248 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 249 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 250 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 251 | | /// <param name="legalHold"> The LegalHold property that will be clear from a blob container. </param> |
| | 252 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 253 | | public virtual async Task<Response<LegalHold>> ClearLegalHoldAsync(string resourceGroupName, string accountName, |
| | 254 | | { |
| 4 | 255 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.ClearLegalHold"); |
| 4 | 256 | | scope.Start(); |
| | 257 | | try |
| | 258 | | { |
| 4 | 259 | | return await RestClient.ClearLegalHoldAsync(resourceGroupName, accountName, containerName, legalHold, ca |
| | 260 | | } |
| 0 | 261 | | catch (Exception e) |
| | 262 | | { |
| 0 | 263 | | scope.Failed(e); |
| 0 | 264 | | throw; |
| | 265 | | } |
| 4 | 266 | | } |
| | 267 | |
|
| | 268 | | /// <summary> Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. |
| | 269 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 270 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 271 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 272 | | /// <param name="legalHold"> The LegalHold property that will be clear from a blob container. </param> |
| | 273 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 274 | | public virtual Response<LegalHold> ClearLegalHold(string resourceGroupName, string accountName, string container |
| | 275 | | { |
| 4 | 276 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.ClearLegalHold"); |
| 4 | 277 | | scope.Start(); |
| | 278 | | try |
| | 279 | | { |
| 4 | 280 | | return RestClient.ClearLegalHold(resourceGroupName, accountName, containerName, legalHold, cancellationT |
| | 281 | | } |
| 0 | 282 | | catch (Exception e) |
| | 283 | | { |
| 0 | 284 | | scope.Failed(e); |
| 0 | 285 | | throw; |
| | 286 | | } |
| 4 | 287 | | } |
| | 288 | |
|
| | 289 | | /// <summary> Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not r |
| | 290 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 291 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 292 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 293 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 294 | | /// <param name="parameters"> The ImmutabilityPolicy Properties that will be created or updated to a blob contai |
| | 295 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 296 | | public virtual async Task<Response<ImmutabilityPolicy>> CreateOrUpdateImmutabilityPolicyAsync(string resourceGro |
| | 297 | | { |
| 16 | 298 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.CreateOrUpdateImmutabilityPolicy" |
| 16 | 299 | | scope.Start(); |
| | 300 | | try |
| | 301 | | { |
| 16 | 302 | | return await RestClient.CreateOrUpdateImmutabilityPolicyAsync(resourceGroupName, accountName, containerN |
| | 303 | | } |
| 0 | 304 | | catch (Exception e) |
| | 305 | | { |
| 0 | 306 | | scope.Failed(e); |
| 0 | 307 | | throw; |
| | 308 | | } |
| 16 | 309 | | } |
| | 310 | |
|
| | 311 | | /// <summary> Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not r |
| | 312 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 313 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 314 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 315 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 316 | | /// <param name="parameters"> The ImmutabilityPolicy Properties that will be created or updated to a blob contai |
| | 317 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 318 | | public virtual Response<ImmutabilityPolicy> CreateOrUpdateImmutabilityPolicy(string resourceGroupName, string ac |
| | 319 | | { |
| 16 | 320 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.CreateOrUpdateImmutabilityPolicy" |
| 16 | 321 | | scope.Start(); |
| | 322 | | try |
| | 323 | | { |
| 16 | 324 | | return RestClient.CreateOrUpdateImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatc |
| | 325 | | } |
| 0 | 326 | | catch (Exception e) |
| | 327 | | { |
| 0 | 328 | | scope.Failed(e); |
| 0 | 329 | | throw; |
| | 330 | | } |
| 16 | 331 | | } |
| | 332 | |
|
| | 333 | | /// <summary> Gets the existing immutability policy along with the corresponding ETag in response headers and bo |
| | 334 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 335 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 336 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 337 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 338 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 339 | | public virtual async Task<Response<ImmutabilityPolicy>> GetImmutabilityPolicyAsync(string resourceGroupName, str |
| | 340 | | { |
| 4 | 341 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.GetImmutabilityPolicy"); |
| 4 | 342 | | scope.Start(); |
| | 343 | | try |
| | 344 | | { |
| 4 | 345 | | return await RestClient.GetImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatc |
| | 346 | | } |
| 0 | 347 | | catch (Exception e) |
| | 348 | | { |
| 0 | 349 | | scope.Failed(e); |
| 0 | 350 | | throw; |
| | 351 | | } |
| 4 | 352 | | } |
| | 353 | |
|
| | 354 | | /// <summary> Gets the existing immutability policy along with the corresponding ETag in response headers and bo |
| | 355 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 356 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 357 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 358 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 359 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 360 | | public virtual Response<ImmutabilityPolicy> GetImmutabilityPolicy(string resourceGroupName, string accountName, |
| | 361 | | { |
| 4 | 362 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.GetImmutabilityPolicy"); |
| 4 | 363 | | scope.Start(); |
| | 364 | | try |
| | 365 | | { |
| 4 | 366 | | return RestClient.GetImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch, cancella |
| | 367 | | } |
| 0 | 368 | | catch (Exception e) |
| | 369 | | { |
| 0 | 370 | | scope.Failed(e); |
| 0 | 371 | | throw; |
| | 372 | | } |
| 4 | 373 | | } |
| | 374 | |
|
| | 375 | | /// <summary> Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreation |
| | 376 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 377 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 378 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 379 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 380 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 381 | | public virtual async Task<Response<ImmutabilityPolicy>> DeleteImmutabilityPolicyAsync(string resourceGroupName, |
| | 382 | | { |
| 2 | 383 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.DeleteImmutabilityPolicy"); |
| 2 | 384 | | scope.Start(); |
| | 385 | | try |
| | 386 | | { |
| 2 | 387 | | return await RestClient.DeleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifM |
| | 388 | | } |
| 0 | 389 | | catch (Exception e) |
| | 390 | | { |
| 0 | 391 | | scope.Failed(e); |
| 0 | 392 | | throw; |
| | 393 | | } |
| 2 | 394 | | } |
| | 395 | |
|
| | 396 | | /// <summary> Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreation |
| | 397 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 398 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 399 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 400 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 401 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 402 | | public virtual Response<ImmutabilityPolicy> DeleteImmutabilityPolicy(string resourceGroupName, string accountNam |
| | 403 | | { |
| 2 | 404 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.DeleteImmutabilityPolicy"); |
| 2 | 405 | | scope.Start(); |
| | 406 | | try |
| | 407 | | { |
| 2 | 408 | | return RestClient.DeleteImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch, cance |
| | 409 | | } |
| 0 | 410 | | catch (Exception e) |
| | 411 | | { |
| 0 | 412 | | scope.Failed(e); |
| 0 | 413 | | throw; |
| | 414 | | } |
| 2 | 415 | | } |
| | 416 | |
|
| | 417 | | /// <summary> Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendI |
| | 418 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 419 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 420 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 421 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 422 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 423 | | public virtual async Task<Response<ImmutabilityPolicy>> LockImmutabilityPolicyAsync(string resourceGroupName, st |
| | 424 | | { |
| 6 | 425 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.LockImmutabilityPolicy"); |
| 6 | 426 | | scope.Start(); |
| | 427 | | try |
| | 428 | | { |
| 6 | 429 | | return await RestClient.LockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMat |
| | 430 | | } |
| 0 | 431 | | catch (Exception e) |
| | 432 | | { |
| 0 | 433 | | scope.Failed(e); |
| 0 | 434 | | throw; |
| | 435 | | } |
| 6 | 436 | | } |
| | 437 | |
|
| | 438 | | /// <summary> Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendI |
| | 439 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 440 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 441 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 442 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 443 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 444 | | public virtual Response<ImmutabilityPolicy> LockImmutabilityPolicy(string resourceGroupName, string accountName, |
| | 445 | | { |
| 6 | 446 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.LockImmutabilityPolicy"); |
| 6 | 447 | | scope.Start(); |
| | 448 | | try |
| | 449 | | { |
| 6 | 450 | | return RestClient.LockImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch, cancell |
| | 451 | | } |
| 0 | 452 | | catch (Exception e) |
| | 453 | | { |
| 0 | 454 | | scope.Failed(e); |
| 0 | 455 | | throw; |
| | 456 | | } |
| 6 | 457 | | } |
| | 458 | |
|
| | 459 | | /// <summary> Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action |
| | 460 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 461 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 462 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 463 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 464 | | /// <param name="parameters"> The ImmutabilityPolicy Properties that will be extended for a blob container. </pa |
| | 465 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 466 | | public virtual async Task<Response<ImmutabilityPolicy>> ExtendImmutabilityPolicyAsync(string resourceGroupName, |
| | 467 | | { |
| 4 | 468 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.ExtendImmutabilityPolicy"); |
| 4 | 469 | | scope.Start(); |
| | 470 | | try |
| | 471 | | { |
| 4 | 472 | | return await RestClient.ExtendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifM |
| | 473 | | } |
| 0 | 474 | | catch (Exception e) |
| | 475 | | { |
| 0 | 476 | | scope.Failed(e); |
| 0 | 477 | | throw; |
| | 478 | | } |
| 4 | 479 | | } |
| | 480 | |
|
| | 481 | | /// <summary> Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action |
| | 482 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 483 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 484 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 485 | | /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo |
| | 486 | | /// <param name="parameters"> The ImmutabilityPolicy Properties that will be extended for a blob container. </pa |
| | 487 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 488 | | public virtual Response<ImmutabilityPolicy> ExtendImmutabilityPolicy(string resourceGroupName, string accountNam |
| | 489 | | { |
| 4 | 490 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.ExtendImmutabilityPolicy"); |
| 4 | 491 | | scope.Start(); |
| | 492 | | try |
| | 493 | | { |
| 4 | 494 | | return RestClient.ExtendImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch, param |
| | 495 | | } |
| 0 | 496 | | catch (Exception e) |
| | 497 | | { |
| 0 | 498 | | scope.Failed(e); |
| 0 | 499 | | throw; |
| | 500 | | } |
| 4 | 501 | | } |
| | 502 | |
|
| | 503 | | /// <summary> The Lease Container operation establishes and manages a lock on a container for delete operations. |
| | 504 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 505 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 506 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 507 | | /// <param name="parameters"> Lease Container request body. </param> |
| | 508 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 509 | | public virtual async Task<Response<LeaseContainerResponse>> LeaseAsync(string resourceGroupName, string accountN |
| | 510 | | { |
| 0 | 511 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Lease"); |
| 0 | 512 | | scope.Start(); |
| | 513 | | try |
| | 514 | | { |
| 0 | 515 | | return await RestClient.LeaseAsync(resourceGroupName, accountName, containerName, parameters, cancellati |
| | 516 | | } |
| 0 | 517 | | catch (Exception e) |
| | 518 | | { |
| 0 | 519 | | scope.Failed(e); |
| 0 | 520 | | throw; |
| | 521 | | } |
| 0 | 522 | | } |
| | 523 | |
|
| | 524 | | /// <summary> The Lease Container operation establishes and manages a lock on a container for delete operations. |
| | 525 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 526 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 527 | | /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta |
| | 528 | | /// <param name="parameters"> Lease Container request body. </param> |
| | 529 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 530 | | public virtual Response<LeaseContainerResponse> Lease(string resourceGroupName, string accountName, string conta |
| | 531 | | { |
| 0 | 532 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.Lease"); |
| 0 | 533 | | scope.Start(); |
| | 534 | | try |
| | 535 | | { |
| 0 | 536 | | return RestClient.Lease(resourceGroupName, accountName, containerName, parameters, cancellationToken); |
| | 537 | | } |
| 0 | 538 | | catch (Exception e) |
| | 539 | | { |
| 0 | 540 | | scope.Failed(e); |
| 0 | 541 | | throw; |
| | 542 | | } |
| 0 | 543 | | } |
| | 544 | |
|
| | 545 | | /// <summary> Lists all containers and does not support a prefix like data plane. Also SRP today does not return |
| | 546 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 547 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 548 | | /// <param name="maxpagesize"> Optional. Specified maximum number of containers that can be included in the list |
| | 549 | | /// <param name="filter"> Optional. When specified, only container names starting with the filter will be listed |
| | 550 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 551 | | public virtual AsyncPageable<ListContainerItem> ListAsync(string resourceGroupName, string accountName, string m |
| | 552 | | { |
| 6 | 553 | | if (resourceGroupName == null) |
| | 554 | | { |
| 0 | 555 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 556 | | } |
| 6 | 557 | | if (accountName == null) |
| | 558 | | { |
| 0 | 559 | | throw new ArgumentNullException(nameof(accountName)); |
| | 560 | | } |
| | 561 | |
|
| | 562 | | async Task<Page<ListContainerItem>> FirstPageFunc(int? pageSizeHint) |
| | 563 | | { |
| 6 | 564 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.List"); |
| 6 | 565 | | scope.Start(); |
| | 566 | | try |
| | 567 | | { |
| 6 | 568 | | var response = await RestClient.ListAsync(resourceGroupName, accountName, maxpagesize, filter, cance |
| 6 | 569 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 570 | | } |
| 0 | 571 | | catch (Exception e) |
| | 572 | | { |
| 0 | 573 | | scope.Failed(e); |
| 0 | 574 | | throw; |
| | 575 | | } |
| 6 | 576 | | } |
| | 577 | | async Task<Page<ListContainerItem>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 578 | | { |
| 2 | 579 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.List"); |
| 2 | 580 | | scope.Start(); |
| | 581 | | try |
| | 582 | | { |
| 2 | 583 | | var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, accountName, maxpages |
| 2 | 584 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 585 | | } |
| 0 | 586 | | catch (Exception e) |
| | 587 | | { |
| 0 | 588 | | scope.Failed(e); |
| 0 | 589 | | throw; |
| | 590 | | } |
| 2 | 591 | | } |
| 6 | 592 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 593 | | } |
| | 594 | |
|
| | 595 | | /// <summary> Lists all containers and does not support a prefix like data plane. Also SRP today does not return |
| | 596 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 597 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 598 | | /// <param name="maxpagesize"> Optional. Specified maximum number of containers that can be included in the list |
| | 599 | | /// <param name="filter"> Optional. When specified, only container names starting with the filter will be listed |
| | 600 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 601 | | public virtual Pageable<ListContainerItem> List(string resourceGroupName, string accountName, string maxpagesize |
| | 602 | | { |
| 6 | 603 | | if (resourceGroupName == null) |
| | 604 | | { |
| 0 | 605 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 606 | | } |
| 6 | 607 | | if (accountName == null) |
| | 608 | | { |
| 0 | 609 | | throw new ArgumentNullException(nameof(accountName)); |
| | 610 | | } |
| | 611 | |
|
| | 612 | | Page<ListContainerItem> FirstPageFunc(int? pageSizeHint) |
| | 613 | | { |
| 6 | 614 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.List"); |
| 6 | 615 | | scope.Start(); |
| | 616 | | try |
| | 617 | | { |
| 6 | 618 | | var response = RestClient.List(resourceGroupName, accountName, maxpagesize, filter, cancellationToke |
| 6 | 619 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 620 | | } |
| 0 | 621 | | catch (Exception e) |
| | 622 | | { |
| 0 | 623 | | scope.Failed(e); |
| 0 | 624 | | throw; |
| | 625 | | } |
| 6 | 626 | | } |
| | 627 | | Page<ListContainerItem> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 628 | | { |
| 2 | 629 | | using var scope = _clientDiagnostics.CreateScope("BlobContainersOperations.List"); |
| 2 | 630 | | scope.Start(); |
| | 631 | | try |
| | 632 | | { |
| 2 | 633 | | var response = RestClient.ListNextPage(nextLink, resourceGroupName, accountName, maxpagesize, filter |
| 2 | 634 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 635 | | } |
| 0 | 636 | | catch (Exception e) |
| | 637 | | { |
| 0 | 638 | | scope.Failed(e); |
| 0 | 639 | | throw; |
| | 640 | | } |
| 2 | 641 | | } |
| 6 | 642 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 643 | | } |
| | 644 | | } |
| | 645 | | } |