| | 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 BlobServices service client. </summary> |
| | 19 | | public partial class BlobServicesOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 52 | 23 | | internal BlobServicesRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of BlobServicesOperations for mocking. </summary> |
| 240 | 25 | | protected BlobServicesOperations() |
| | 26 | | { |
| 240 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of BlobServicesOperations. </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 BlobServicesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionI |
| | 35 | | { |
| 240 | 36 | | RestClient = new BlobServicesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersio |
| 240 | 37 | | _clientDiagnostics = clientDiagnostics; |
| 240 | 38 | | _pipeline = pipeline; |
| 240 | 39 | | } |
| | 40 | |
|
| | 41 | | /// <summary> Sets the properties of a storage account’s Blob service, including properties for Storage Analytic |
| | 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="parameters"> The properties of a storage account’s Blob service, including properties for Stora |
| | 45 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 46 | | public virtual async Task<Response<BlobServiceProperties>> SetServicePropertiesAsync(string resourceGroupName, s |
| | 47 | | { |
| 8 | 48 | | using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.SetServiceProperties"); |
| 8 | 49 | | scope.Start(); |
| | 50 | | try |
| | 51 | | { |
| 8 | 52 | | return await RestClient.SetServicePropertiesAsync(resourceGroupName, accountName, parameters, cancellati |
| | 53 | | } |
| 0 | 54 | | catch (Exception e) |
| | 55 | | { |
| 0 | 56 | | scope.Failed(e); |
| 0 | 57 | | throw; |
| | 58 | | } |
| 8 | 59 | | } |
| | 60 | |
|
| | 61 | | /// <summary> Sets the properties of a storage account’s Blob service, including properties for Storage Analytic |
| | 62 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 63 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 64 | | /// <param name="parameters"> The properties of a storage account’s Blob service, including properties for Stora |
| | 65 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 66 | | public virtual Response<BlobServiceProperties> SetServiceProperties(string resourceGroupName, string accountName |
| | 67 | | { |
| 8 | 68 | | using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.SetServiceProperties"); |
| 8 | 69 | | scope.Start(); |
| | 70 | | try |
| | 71 | | { |
| 8 | 72 | | return RestClient.SetServiceProperties(resourceGroupName, accountName, parameters, cancellationToken); |
| | 73 | | } |
| 0 | 74 | | catch (Exception e) |
| | 75 | | { |
| 0 | 76 | | scope.Failed(e); |
| 0 | 77 | | throw; |
| | 78 | | } |
| 8 | 79 | | } |
| | 80 | |
|
| | 81 | | /// <summary> Gets the properties of a storage account’s Blob service, including properties for Storage Analytic |
| | 82 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 83 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 84 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 85 | | public virtual async Task<Response<BlobServiceProperties>> GetServicePropertiesAsync(string resourceGroupName, s |
| | 86 | | { |
| 16 | 87 | | using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.GetServiceProperties"); |
| 16 | 88 | | scope.Start(); |
| | 89 | | try |
| | 90 | | { |
| 16 | 91 | | return await RestClient.GetServicePropertiesAsync(resourceGroupName, accountName, cancellationToken).Con |
| | 92 | | } |
| 0 | 93 | | catch (Exception e) |
| | 94 | | { |
| 0 | 95 | | scope.Failed(e); |
| 0 | 96 | | throw; |
| | 97 | | } |
| 16 | 98 | | } |
| | 99 | |
|
| | 100 | | /// <summary> Gets the properties of a storage account’s Blob service, including properties for Storage Analytic |
| | 101 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 102 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 103 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 104 | | public virtual Response<BlobServiceProperties> GetServiceProperties(string resourceGroupName, string accountName |
| | 105 | | { |
| 16 | 106 | | using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.GetServiceProperties"); |
| 16 | 107 | | scope.Start(); |
| | 108 | | try |
| | 109 | | { |
| 16 | 110 | | return RestClient.GetServiceProperties(resourceGroupName, accountName, cancellationToken); |
| | 111 | | } |
| 0 | 112 | | catch (Exception e) |
| | 113 | | { |
| 0 | 114 | | scope.Failed(e); |
| 0 | 115 | | throw; |
| | 116 | | } |
| 16 | 117 | | } |
| | 118 | |
|
| | 119 | | /// <summary> List blob services of storage account. It returns a collection of one object named default. </summ |
| | 120 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 121 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 122 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 123 | | public virtual AsyncPageable<BlobServiceProperties> ListAsync(string resourceGroupName, string accountName, Canc |
| | 124 | | { |
| 2 | 125 | | if (resourceGroupName == null) |
| | 126 | | { |
| 0 | 127 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 128 | | } |
| 2 | 129 | | if (accountName == null) |
| | 130 | | { |
| 0 | 131 | | throw new ArgumentNullException(nameof(accountName)); |
| | 132 | | } |
| | 133 | |
|
| | 134 | | async Task<Page<BlobServiceProperties>> FirstPageFunc(int? pageSizeHint) |
| | 135 | | { |
| 2 | 136 | | using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.List"); |
| 2 | 137 | | scope.Start(); |
| | 138 | | try |
| | 139 | | { |
| 2 | 140 | | var response = await RestClient.ListAsync(resourceGroupName, accountName, cancellationToken).Configu |
| 2 | 141 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | 142 | | } |
| 0 | 143 | | catch (Exception e) |
| | 144 | | { |
| 0 | 145 | | scope.Failed(e); |
| 0 | 146 | | throw; |
| | 147 | | } |
| 2 | 148 | | } |
| 2 | 149 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); |
| | 150 | | } |
| | 151 | |
|
| | 152 | | /// <summary> List blob services of storage account. It returns a collection of one object named default. </summ |
| | 153 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 154 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 155 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 156 | | public virtual Pageable<BlobServiceProperties> List(string resourceGroupName, string accountName, CancellationTo |
| | 157 | | { |
| 2 | 158 | | if (resourceGroupName == null) |
| | 159 | | { |
| 0 | 160 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 161 | | } |
| 2 | 162 | | if (accountName == null) |
| | 163 | | { |
| 0 | 164 | | throw new ArgumentNullException(nameof(accountName)); |
| | 165 | | } |
| | 166 | |
|
| | 167 | | Page<BlobServiceProperties> FirstPageFunc(int? pageSizeHint) |
| | 168 | | { |
| 2 | 169 | | using var scope = _clientDiagnostics.CreateScope("BlobServicesOperations.List"); |
| 2 | 170 | | scope.Start(); |
| | 171 | | try |
| | 172 | | { |
| 2 | 173 | | var response = RestClient.List(resourceGroupName, accountName, cancellationToken); |
| 2 | 174 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | 175 | | } |
| 0 | 176 | | catch (Exception e) |
| | 177 | | { |
| 0 | 178 | | scope.Failed(e); |
| 0 | 179 | | throw; |
| | 180 | | } |
| 2 | 181 | | } |
| 2 | 182 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, null); |
| | 183 | | } |
| | 184 | | } |
| | 185 | | } |