| | 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.Text.Json; |
| | 10 | | using System.Threading; |
| | 11 | | using System.Threading.Tasks; |
| | 12 | | using Azure; |
| | 13 | | using Azure.Core; |
| | 14 | | using Azure.Core.Pipeline; |
| | 15 | | using Azure.ResourceManager.Storage.Models; |
| | 16 | |
|
| | 17 | | namespace Azure.ResourceManager.Storage |
| | 18 | | { |
| | 19 | | internal partial class ObjectReplicationPoliciesRestOperations |
| | 20 | | { |
| | 21 | | private string subscriptionId; |
| | 22 | | private Uri endpoint; |
| | 23 | | private string apiVersion; |
| | 24 | | private ClientDiagnostics _clientDiagnostics; |
| | 25 | | private HttpPipeline _pipeline; |
| | 26 | |
|
| | 27 | | /// <summary> Initializes a new instance of ObjectReplicationPoliciesRestOperations. </summary> |
| | 28 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 29 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 30 | | /// <param name="subscriptionId"> The ID of the target subscription. </param> |
| | 31 | | /// <param name="endpoint"> server parameter. </param> |
| | 32 | | /// <param name="apiVersion"> Api Version. </param> |
| | 33 | | /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception |
| 240 | 34 | | public ObjectReplicationPoliciesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, strin |
| | 35 | | { |
| 240 | 36 | | if (subscriptionId == null) |
| | 37 | | { |
| 0 | 38 | | throw new ArgumentNullException(nameof(subscriptionId)); |
| | 39 | | } |
| 240 | 40 | | endpoint ??= new Uri("https://management.azure.com"); |
| 240 | 41 | | if (apiVersion == null) |
| | 42 | | { |
| 0 | 43 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | 44 | | } |
| | 45 | |
|
| 240 | 46 | | this.subscriptionId = subscriptionId; |
| 240 | 47 | | this.endpoint = endpoint; |
| 240 | 48 | | this.apiVersion = apiVersion; |
| 240 | 49 | | _clientDiagnostics = clientDiagnostics; |
| 240 | 50 | | _pipeline = pipeline; |
| 240 | 51 | | } |
| | 52 | |
|
| | 53 | | internal HttpMessage CreateListRequest(string resourceGroupName, string accountName) |
| | 54 | | { |
| 8 | 55 | | var message = _pipeline.CreateMessage(); |
| 8 | 56 | | var request = message.Request; |
| 8 | 57 | | request.Method = RequestMethod.Get; |
| 8 | 58 | | var uri = new RawRequestUriBuilder(); |
| 8 | 59 | | uri.Reset(endpoint); |
| 8 | 60 | | uri.AppendPath("/subscriptions/", false); |
| 8 | 61 | | uri.AppendPath(subscriptionId, true); |
| 8 | 62 | | uri.AppendPath("/resourceGroups/", false); |
| 8 | 63 | | uri.AppendPath(resourceGroupName, true); |
| 8 | 64 | | uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false); |
| 8 | 65 | | uri.AppendPath(accountName, true); |
| 8 | 66 | | uri.AppendPath("/objectReplicationPolicies", false); |
| 8 | 67 | | uri.AppendQuery("api-version", apiVersion, true); |
| 8 | 68 | | request.Uri = uri; |
| 8 | 69 | | return message; |
| | 70 | | } |
| | 71 | |
|
| | 72 | | /// <summary> List the object replication policies associated with the storage account. </summary> |
| | 73 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 74 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 75 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 76 | | public async Task<Response<ObjectReplicationPolicies>> ListAsync(string resourceGroupName, string accountName, C |
| | 77 | | { |
| 4 | 78 | | if (resourceGroupName == null) |
| | 79 | | { |
| 0 | 80 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 81 | | } |
| 4 | 82 | | if (accountName == null) |
| | 83 | | { |
| 0 | 84 | | throw new ArgumentNullException(nameof(accountName)); |
| | 85 | | } |
| | 86 | |
|
| 4 | 87 | | using var message = CreateListRequest(resourceGroupName, accountName); |
| 4 | 88 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 4 | 89 | | switch (message.Response.Status) |
| | 90 | | { |
| | 91 | | case 200: |
| | 92 | | { |
| 4 | 93 | | ObjectReplicationPolicies value = default; |
| 4 | 94 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 4 | 95 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 96 | | { |
| 0 | 97 | | value = null; |
| | 98 | | } |
| | 99 | | else |
| | 100 | | { |
| 4 | 101 | | value = ObjectReplicationPolicies.DeserializeObjectReplicationPolicies(document.RootElement) |
| | 102 | | } |
| 4 | 103 | | return Response.FromValue(value, message.Response); |
| | 104 | | } |
| | 105 | | default: |
| 0 | 106 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 107 | | } |
| 4 | 108 | | } |
| | 109 | |
|
| | 110 | | /// <summary> List the object replication policies associated with the storage account. </summary> |
| | 111 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 112 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 113 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 114 | | public Response<ObjectReplicationPolicies> List(string resourceGroupName, string accountName, CancellationToken |
| | 115 | | { |
| 4 | 116 | | if (resourceGroupName == null) |
| | 117 | | { |
| 0 | 118 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 119 | | } |
| 4 | 120 | | if (accountName == null) |
| | 121 | | { |
| 0 | 122 | | throw new ArgumentNullException(nameof(accountName)); |
| | 123 | | } |
| | 124 | |
|
| 4 | 125 | | using var message = CreateListRequest(resourceGroupName, accountName); |
| 4 | 126 | | _pipeline.Send(message, cancellationToken); |
| 4 | 127 | | switch (message.Response.Status) |
| | 128 | | { |
| | 129 | | case 200: |
| | 130 | | { |
| 4 | 131 | | ObjectReplicationPolicies value = default; |
| 4 | 132 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 4 | 133 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 134 | | { |
| 0 | 135 | | value = null; |
| | 136 | | } |
| | 137 | | else |
| | 138 | | { |
| 4 | 139 | | value = ObjectReplicationPolicies.DeserializeObjectReplicationPolicies(document.RootElement) |
| | 140 | | } |
| 4 | 141 | | return Response.FromValue(value, message.Response); |
| | 142 | | } |
| | 143 | | default: |
| 0 | 144 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 145 | | } |
| 4 | 146 | | } |
| | 147 | |
|
| | 148 | | internal HttpMessage CreateGetRequest(string resourceGroupName, string accountName, string objectReplicationPoli |
| | 149 | | { |
| 8 | 150 | | var message = _pipeline.CreateMessage(); |
| 8 | 151 | | var request = message.Request; |
| 8 | 152 | | request.Method = RequestMethod.Get; |
| 8 | 153 | | var uri = new RawRequestUriBuilder(); |
| 8 | 154 | | uri.Reset(endpoint); |
| 8 | 155 | | uri.AppendPath("/subscriptions/", false); |
| 8 | 156 | | uri.AppendPath(subscriptionId, true); |
| 8 | 157 | | uri.AppendPath("/resourceGroups/", false); |
| 8 | 158 | | uri.AppendPath(resourceGroupName, true); |
| 8 | 159 | | uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false); |
| 8 | 160 | | uri.AppendPath(accountName, true); |
| 8 | 161 | | uri.AppendPath("/objectReplicationPolicies/", false); |
| 8 | 162 | | uri.AppendPath(objectReplicationPolicyId, true); |
| 8 | 163 | | uri.AppendQuery("api-version", apiVersion, true); |
| 8 | 164 | | request.Uri = uri; |
| 8 | 165 | | return message; |
| | 166 | | } |
| | 167 | |
|
| | 168 | | /// <summary> Get the object replication policy of the storage account by policy ID. </summary> |
| | 169 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 170 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 171 | | /// <param name="objectReplicationPolicyId"> The ID of object replication policy or 'default' if the p |
| | 172 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 173 | | public async Task<Response<ObjectReplicationPolicy>> GetAsync(string resourceGroupName, string accountName, stri |
| | 174 | | { |
| 4 | 175 | | if (resourceGroupName == null) |
| | 176 | | { |
| 0 | 177 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 178 | | } |
| 4 | 179 | | if (accountName == null) |
| | 180 | | { |
| 0 | 181 | | throw new ArgumentNullException(nameof(accountName)); |
| | 182 | | } |
| 4 | 183 | | if (objectReplicationPolicyId == null) |
| | 184 | | { |
| 0 | 185 | | throw new ArgumentNullException(nameof(objectReplicationPolicyId)); |
| | 186 | | } |
| | 187 | |
|
| 4 | 188 | | using var message = CreateGetRequest(resourceGroupName, accountName, objectReplicationPolicyId); |
| 4 | 189 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 4 | 190 | | switch (message.Response.Status) |
| | 191 | | { |
| | 192 | | case 200: |
| | 193 | | { |
| 4 | 194 | | ObjectReplicationPolicy value = default; |
| 4 | 195 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 4 | 196 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 197 | | { |
| 0 | 198 | | value = null; |
| | 199 | | } |
| | 200 | | else |
| | 201 | | { |
| 4 | 202 | | value = ObjectReplicationPolicy.DeserializeObjectReplicationPolicy(document.RootElement); |
| | 203 | | } |
| 4 | 204 | | return Response.FromValue(value, message.Response); |
| | 205 | | } |
| | 206 | | default: |
| 0 | 207 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 208 | | } |
| 4 | 209 | | } |
| | 210 | |
|
| | 211 | | /// <summary> Get the object replication policy of the storage account by policy ID. </summary> |
| | 212 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 213 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 214 | | /// <param name="objectReplicationPolicyId"> The ID of object replication policy or 'default' if the p |
| | 215 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 216 | | public Response<ObjectReplicationPolicy> Get(string resourceGroupName, string accountName, string objectReplicat |
| | 217 | | { |
| 4 | 218 | | if (resourceGroupName == null) |
| | 219 | | { |
| 0 | 220 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 221 | | } |
| 4 | 222 | | if (accountName == null) |
| | 223 | | { |
| 0 | 224 | | throw new ArgumentNullException(nameof(accountName)); |
| | 225 | | } |
| 4 | 226 | | if (objectReplicationPolicyId == null) |
| | 227 | | { |
| 0 | 228 | | throw new ArgumentNullException(nameof(objectReplicationPolicyId)); |
| | 229 | | } |
| | 230 | |
|
| 4 | 231 | | using var message = CreateGetRequest(resourceGroupName, accountName, objectReplicationPolicyId); |
| 4 | 232 | | _pipeline.Send(message, cancellationToken); |
| 4 | 233 | | switch (message.Response.Status) |
| | 234 | | { |
| | 235 | | case 200: |
| | 236 | | { |
| 4 | 237 | | ObjectReplicationPolicy value = default; |
| 4 | 238 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 4 | 239 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 240 | | { |
| 0 | 241 | | value = null; |
| | 242 | | } |
| | 243 | | else |
| | 244 | | { |
| 4 | 245 | | value = ObjectReplicationPolicy.DeserializeObjectReplicationPolicy(document.RootElement); |
| | 246 | | } |
| 4 | 247 | | return Response.FromValue(value, message.Response); |
| | 248 | | } |
| | 249 | | default: |
| 0 | 250 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 251 | | } |
| 4 | 252 | | } |
| | 253 | |
|
| | 254 | | internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string accountName, string objectRepl |
| | 255 | | { |
| 8 | 256 | | var message = _pipeline.CreateMessage(); |
| 8 | 257 | | var request = message.Request; |
| 8 | 258 | | request.Method = RequestMethod.Put; |
| 8 | 259 | | var uri = new RawRequestUriBuilder(); |
| 8 | 260 | | uri.Reset(endpoint); |
| 8 | 261 | | uri.AppendPath("/subscriptions/", false); |
| 8 | 262 | | uri.AppendPath(subscriptionId, true); |
| 8 | 263 | | uri.AppendPath("/resourceGroups/", false); |
| 8 | 264 | | uri.AppendPath(resourceGroupName, true); |
| 8 | 265 | | uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false); |
| 8 | 266 | | uri.AppendPath(accountName, true); |
| 8 | 267 | | uri.AppendPath("/objectReplicationPolicies/", false); |
| 8 | 268 | | uri.AppendPath(objectReplicationPolicyId, true); |
| 8 | 269 | | uri.AppendQuery("api-version", apiVersion, true); |
| 8 | 270 | | request.Uri = uri; |
| 8 | 271 | | request.Headers.Add("Content-Type", "application/json"); |
| 8 | 272 | | var content = new Utf8JsonRequestContent(); |
| 8 | 273 | | content.JsonWriter.WriteObjectValue(properties); |
| 8 | 274 | | request.Content = content; |
| 8 | 275 | | return message; |
| | 276 | | } |
| | 277 | |
|
| | 278 | | /// <summary> Create or update the object replication policy of the storage account. </summary> |
| | 279 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 280 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 281 | | /// <param name="objectReplicationPolicyId"> The ID of object replication policy or 'default' if the p |
| | 282 | | /// <param name="properties"> The object replication policy set to a storage account. A unique policy ID will be |
| | 283 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 284 | | public async Task<Response<ObjectReplicationPolicy>> CreateOrUpdateAsync(string resourceGroupName, string accoun |
| | 285 | | { |
| 4 | 286 | | if (resourceGroupName == null) |
| | 287 | | { |
| 0 | 288 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 289 | | } |
| 4 | 290 | | if (accountName == null) |
| | 291 | | { |
| 0 | 292 | | throw new ArgumentNullException(nameof(accountName)); |
| | 293 | | } |
| 4 | 294 | | if (objectReplicationPolicyId == null) |
| | 295 | | { |
| 0 | 296 | | throw new ArgumentNullException(nameof(objectReplicationPolicyId)); |
| | 297 | | } |
| 4 | 298 | | if (properties == null) |
| | 299 | | { |
| 0 | 300 | | throw new ArgumentNullException(nameof(properties)); |
| | 301 | | } |
| | 302 | |
|
| 4 | 303 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, accountName, objectReplicationPolicyId, p |
| 4 | 304 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 4 | 305 | | switch (message.Response.Status) |
| | 306 | | { |
| | 307 | | case 200: |
| | 308 | | { |
| 4 | 309 | | ObjectReplicationPolicy value = default; |
| 4 | 310 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 4 | 311 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 312 | | { |
| 0 | 313 | | value = null; |
| | 314 | | } |
| | 315 | | else |
| | 316 | | { |
| 4 | 317 | | value = ObjectReplicationPolicy.DeserializeObjectReplicationPolicy(document.RootElement); |
| | 318 | | } |
| 4 | 319 | | return Response.FromValue(value, message.Response); |
| | 320 | | } |
| | 321 | | default: |
| 0 | 322 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 323 | | } |
| 4 | 324 | | } |
| | 325 | |
|
| | 326 | | /// <summary> Create or update the object replication policy of the storage account. </summary> |
| | 327 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 328 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 329 | | /// <param name="objectReplicationPolicyId"> The ID of object replication policy or 'default' if the p |
| | 330 | | /// <param name="properties"> The object replication policy set to a storage account. A unique policy ID will be |
| | 331 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 332 | | public Response<ObjectReplicationPolicy> CreateOrUpdate(string resourceGroupName, string accountName, string obj |
| | 333 | | { |
| 4 | 334 | | if (resourceGroupName == null) |
| | 335 | | { |
| 0 | 336 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 337 | | } |
| 4 | 338 | | if (accountName == null) |
| | 339 | | { |
| 0 | 340 | | throw new ArgumentNullException(nameof(accountName)); |
| | 341 | | } |
| 4 | 342 | | if (objectReplicationPolicyId == null) |
| | 343 | | { |
| 0 | 344 | | throw new ArgumentNullException(nameof(objectReplicationPolicyId)); |
| | 345 | | } |
| 4 | 346 | | if (properties == null) |
| | 347 | | { |
| 0 | 348 | | throw new ArgumentNullException(nameof(properties)); |
| | 349 | | } |
| | 350 | |
|
| 4 | 351 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, accountName, objectReplicationPolicyId, p |
| 4 | 352 | | _pipeline.Send(message, cancellationToken); |
| 4 | 353 | | switch (message.Response.Status) |
| | 354 | | { |
| | 355 | | case 200: |
| | 356 | | { |
| 4 | 357 | | ObjectReplicationPolicy value = default; |
| 4 | 358 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 4 | 359 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 360 | | { |
| 0 | 361 | | value = null; |
| | 362 | | } |
| | 363 | | else |
| | 364 | | { |
| 4 | 365 | | value = ObjectReplicationPolicy.DeserializeObjectReplicationPolicy(document.RootElement); |
| | 366 | | } |
| 4 | 367 | | return Response.FromValue(value, message.Response); |
| | 368 | | } |
| | 369 | | default: |
| 0 | 370 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 371 | | } |
| 4 | 372 | | } |
| | 373 | |
|
| | 374 | | internal HttpMessage CreateDeleteRequest(string resourceGroupName, string accountName, string objectReplicationP |
| | 375 | | { |
| 8 | 376 | | var message = _pipeline.CreateMessage(); |
| 8 | 377 | | var request = message.Request; |
| 8 | 378 | | request.Method = RequestMethod.Delete; |
| 8 | 379 | | var uri = new RawRequestUriBuilder(); |
| 8 | 380 | | uri.Reset(endpoint); |
| 8 | 381 | | uri.AppendPath("/subscriptions/", false); |
| 8 | 382 | | uri.AppendPath(subscriptionId, true); |
| 8 | 383 | | uri.AppendPath("/resourceGroups/", false); |
| 8 | 384 | | uri.AppendPath(resourceGroupName, true); |
| 8 | 385 | | uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false); |
| 8 | 386 | | uri.AppendPath(accountName, true); |
| 8 | 387 | | uri.AppendPath("/objectReplicationPolicies/", false); |
| 8 | 388 | | uri.AppendPath(objectReplicationPolicyId, true); |
| 8 | 389 | | uri.AppendQuery("api-version", apiVersion, true); |
| 8 | 390 | | request.Uri = uri; |
| 8 | 391 | | return message; |
| | 392 | | } |
| | 393 | |
|
| | 394 | | /// <summary> Deletes the object replication policy associated with the specified storage account. </summary> |
| | 395 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 396 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 397 | | /// <param name="objectReplicationPolicyId"> The ID of object replication policy or 'default' if the p |
| | 398 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 399 | | public async Task<Response> DeleteAsync(string resourceGroupName, string accountName, string objectReplicationPo |
| | 400 | | { |
| 4 | 401 | | if (resourceGroupName == null) |
| | 402 | | { |
| 0 | 403 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 404 | | } |
| 4 | 405 | | if (accountName == null) |
| | 406 | | { |
| 0 | 407 | | throw new ArgumentNullException(nameof(accountName)); |
| | 408 | | } |
| 4 | 409 | | if (objectReplicationPolicyId == null) |
| | 410 | | { |
| 0 | 411 | | throw new ArgumentNullException(nameof(objectReplicationPolicyId)); |
| | 412 | | } |
| | 413 | |
|
| 4 | 414 | | using var message = CreateDeleteRequest(resourceGroupName, accountName, objectReplicationPolicyId); |
| 4 | 415 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 4 | 416 | | switch (message.Response.Status) |
| | 417 | | { |
| | 418 | | case 200: |
| | 419 | | case 204: |
| 4 | 420 | | return message.Response; |
| | 421 | | default: |
| 0 | 422 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 423 | | } |
| 4 | 424 | | } |
| | 425 | |
|
| | 426 | | /// <summary> Deletes the object replication policy associated with the specified storage account. </summary> |
| | 427 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 428 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 429 | | /// <param name="objectReplicationPolicyId"> The ID of object replication policy or 'default' if the p |
| | 430 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 431 | | public Response Delete(string resourceGroupName, string accountName, string objectReplicationPolicyId, Cancellat |
| | 432 | | { |
| 4 | 433 | | if (resourceGroupName == null) |
| | 434 | | { |
| 0 | 435 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 436 | | } |
| 4 | 437 | | if (accountName == null) |
| | 438 | | { |
| 0 | 439 | | throw new ArgumentNullException(nameof(accountName)); |
| | 440 | | } |
| 4 | 441 | | if (objectReplicationPolicyId == null) |
| | 442 | | { |
| 0 | 443 | | throw new ArgumentNullException(nameof(objectReplicationPolicyId)); |
| | 444 | | } |
| | 445 | |
|
| 4 | 446 | | using var message = CreateDeleteRequest(resourceGroupName, accountName, objectReplicationPolicyId); |
| 4 | 447 | | _pipeline.Send(message, cancellationToken); |
| 4 | 448 | | switch (message.Response.Status) |
| | 449 | | { |
| | 450 | | case 200: |
| | 451 | | case 204: |
| 4 | 452 | | return message.Response; |
| | 453 | | default: |
| 0 | 454 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 455 | | } |
| 4 | 456 | | } |
| | 457 | | } |
| | 458 | | } |