| | 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.Resources.Models; |
| | 16 | |
|
| | 17 | | namespace Azure.ResourceManager.Resources |
| | 18 | | { |
| | 19 | | internal partial class DeploymentRestOperations |
| | 20 | | { |
| | 21 | | private string subscriptionId; |
| | 22 | | private Uri endpoint; |
| | 23 | | private ClientDiagnostics _clientDiagnostics; |
| | 24 | | private HttpPipeline _pipeline; |
| | 25 | |
|
| | 26 | | /// <summary> Initializes a new instance of DeploymentRestOperations. </summary> |
| | 27 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 28 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 29 | | /// <param name="subscriptionId"> The ID of the target subscription. </param> |
| | 30 | | /// <param name="endpoint"> server parameter. </param> |
| | 31 | | /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception |
| 272 | 32 | | public DeploymentRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionI |
| | 33 | | { |
| 272 | 34 | | if (subscriptionId == null) |
| | 35 | | { |
| 0 | 36 | | throw new ArgumentNullException(nameof(subscriptionId)); |
| | 37 | | } |
| 272 | 38 | | endpoint ??= new Uri("https://management.azure.com"); |
| | 39 | |
|
| 272 | 40 | | this.subscriptionId = subscriptionId; |
| 272 | 41 | | this.endpoint = endpoint; |
| 272 | 42 | | _clientDiagnostics = clientDiagnostics; |
| 272 | 43 | | _pipeline = pipeline; |
| 272 | 44 | | } |
| | 45 | |
|
| | 46 | | internal Core.HttpMessage CreateGetAtScopeRequest(string scope, string deploymentName, string operationId) |
| | 47 | | { |
| 0 | 48 | | var message = _pipeline.CreateMessage(); |
| 0 | 49 | | var request = message.Request; |
| 0 | 50 | | request.Method = RequestMethod.Get; |
| 0 | 51 | | var uri = new RawRequestUriBuilder(); |
| 0 | 52 | | uri.Reset(endpoint); |
| 0 | 53 | | uri.AppendPath("/", false); |
| 0 | 54 | | uri.AppendPath(scope, false); |
| 0 | 55 | | uri.AppendPath("/providers/Microsoft.Resources/deployments/", false); |
| 0 | 56 | | uri.AppendPath(deploymentName, true); |
| 0 | 57 | | uri.AppendPath("/operations/", false); |
| 0 | 58 | | uri.AppendPath(operationId, true); |
| 0 | 59 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 0 | 60 | | request.Uri = uri; |
| 0 | 61 | | return message; |
| | 62 | | } |
| | 63 | |
|
| | 64 | | /// <summary> Gets a deployments operation. </summary> |
| | 65 | | /// <param name="scope"> The resource scope. </param> |
| | 66 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 67 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 68 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 69 | | public async Task<Response<DeploymentOperation>> GetAtScopeAsync(string scope, string deploymentName, string ope |
| | 70 | | { |
| 0 | 71 | | if (scope == null) |
| | 72 | | { |
| 0 | 73 | | throw new ArgumentNullException(nameof(scope)); |
| | 74 | | } |
| 0 | 75 | | if (deploymentName == null) |
| | 76 | | { |
| 0 | 77 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 78 | | } |
| 0 | 79 | | if (operationId == null) |
| | 80 | | { |
| 0 | 81 | | throw new ArgumentNullException(nameof(operationId)); |
| | 82 | | } |
| | 83 | |
|
| 0 | 84 | | using var message = CreateGetAtScopeRequest(scope, deploymentName, operationId); |
| 0 | 85 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 86 | | switch (message.Response.Status) |
| | 87 | | { |
| | 88 | | case 200: |
| | 89 | | { |
| 0 | 90 | | DeploymentOperation value = default; |
| 0 | 91 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 92 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 93 | | { |
| 0 | 94 | | value = null; |
| | 95 | | } |
| | 96 | | else |
| | 97 | | { |
| 0 | 98 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 99 | | } |
| 0 | 100 | | return Response.FromValue(value, message.Response); |
| | 101 | | } |
| | 102 | | default: |
| 0 | 103 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 104 | | } |
| 0 | 105 | | } |
| | 106 | |
|
| | 107 | | /// <summary> Gets a deployments operation. </summary> |
| | 108 | | /// <param name="scope"> The resource scope. </param> |
| | 109 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 110 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 111 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 112 | | public Response<DeploymentOperation> GetAtScope(string scope, string deploymentName, string operationId, Cancell |
| | 113 | | { |
| 0 | 114 | | if (scope == null) |
| | 115 | | { |
| 0 | 116 | | throw new ArgumentNullException(nameof(scope)); |
| | 117 | | } |
| 0 | 118 | | if (deploymentName == null) |
| | 119 | | { |
| 0 | 120 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 121 | | } |
| 0 | 122 | | if (operationId == null) |
| | 123 | | { |
| 0 | 124 | | throw new ArgumentNullException(nameof(operationId)); |
| | 125 | | } |
| | 126 | |
|
| 0 | 127 | | using var message = CreateGetAtScopeRequest(scope, deploymentName, operationId); |
| 0 | 128 | | _pipeline.Send(message, cancellationToken); |
| 0 | 129 | | switch (message.Response.Status) |
| | 130 | | { |
| | 131 | | case 200: |
| | 132 | | { |
| 0 | 133 | | DeploymentOperation value = default; |
| 0 | 134 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 135 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 136 | | { |
| 0 | 137 | | value = null; |
| | 138 | | } |
| | 139 | | else |
| | 140 | | { |
| 0 | 141 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 142 | | } |
| 0 | 143 | | return Response.FromValue(value, message.Response); |
| | 144 | | } |
| | 145 | | default: |
| 0 | 146 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 147 | | } |
| 0 | 148 | | } |
| | 149 | |
|
| | 150 | | internal Core.HttpMessage CreateListAtScopeRequest(string scope, string deploymentName, int? top) |
| | 151 | | { |
| 12 | 152 | | var message = _pipeline.CreateMessage(); |
| 12 | 153 | | var request = message.Request; |
| 12 | 154 | | request.Method = RequestMethod.Get; |
| 12 | 155 | | var uri = new RawRequestUriBuilder(); |
| 12 | 156 | | uri.Reset(endpoint); |
| 12 | 157 | | uri.AppendPath("/", false); |
| 12 | 158 | | uri.AppendPath(scope, false); |
| 12 | 159 | | uri.AppendPath("/providers/Microsoft.Resources/deployments/", false); |
| 12 | 160 | | uri.AppendPath(deploymentName, true); |
| 12 | 161 | | uri.AppendPath("/operations", false); |
| 12 | 162 | | if (top != null) |
| | 163 | | { |
| 0 | 164 | | uri.AppendQuery("$top", top.Value, true); |
| | 165 | | } |
| 12 | 166 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 12 | 167 | | request.Uri = uri; |
| 12 | 168 | | return message; |
| | 169 | | } |
| | 170 | |
|
| | 171 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 172 | | /// <param name="scope"> The resource scope. </param> |
| | 173 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 174 | | /// <param name="top"> The number of results to return. </param> |
| | 175 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 176 | | public async Task<Response<DeploymentOperationsListResult>> ListAtScopeAsync(string scope, string deploymentName |
| | 177 | | { |
| 6 | 178 | | if (scope == null) |
| | 179 | | { |
| 0 | 180 | | throw new ArgumentNullException(nameof(scope)); |
| | 181 | | } |
| 6 | 182 | | if (deploymentName == null) |
| | 183 | | { |
| 0 | 184 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 185 | | } |
| | 186 | |
|
| 6 | 187 | | using var message = CreateListAtScopeRequest(scope, deploymentName, top); |
| 6 | 188 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 6 | 189 | | switch (message.Response.Status) |
| | 190 | | { |
| | 191 | | case 200: |
| | 192 | | { |
| 6 | 193 | | DeploymentOperationsListResult value = default; |
| 6 | 194 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 6 | 195 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 196 | | { |
| 0 | 197 | | value = null; |
| | 198 | | } |
| | 199 | | else |
| | 200 | | { |
| 6 | 201 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 202 | | } |
| 6 | 203 | | return Response.FromValue(value, message.Response); |
| | 204 | | } |
| | 205 | | default: |
| 0 | 206 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 207 | | } |
| 6 | 208 | | } |
| | 209 | |
|
| | 210 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 211 | | /// <param name="scope"> The resource scope. </param> |
| | 212 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 213 | | /// <param name="top"> The number of results to return. </param> |
| | 214 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 215 | | public Response<DeploymentOperationsListResult> ListAtScope(string scope, string deploymentName, int? top = null |
| | 216 | | { |
| 6 | 217 | | if (scope == null) |
| | 218 | | { |
| 0 | 219 | | throw new ArgumentNullException(nameof(scope)); |
| | 220 | | } |
| 6 | 221 | | if (deploymentName == null) |
| | 222 | | { |
| 0 | 223 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 224 | | } |
| | 225 | |
|
| 6 | 226 | | using var message = CreateListAtScopeRequest(scope, deploymentName, top); |
| 6 | 227 | | _pipeline.Send(message, cancellationToken); |
| 6 | 228 | | switch (message.Response.Status) |
| | 229 | | { |
| | 230 | | case 200: |
| | 231 | | { |
| 6 | 232 | | DeploymentOperationsListResult value = default; |
| 6 | 233 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 6 | 234 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 235 | | { |
| 0 | 236 | | value = null; |
| | 237 | | } |
| | 238 | | else |
| | 239 | | { |
| 6 | 240 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 241 | | } |
| 6 | 242 | | return Response.FromValue(value, message.Response); |
| | 243 | | } |
| | 244 | | default: |
| 0 | 245 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 246 | | } |
| 6 | 247 | | } |
| | 248 | |
|
| | 249 | | internal Core.HttpMessage CreateGetAtTenantScopeRequest(string deploymentName, string operationId) |
| | 250 | | { |
| 0 | 251 | | var message = _pipeline.CreateMessage(); |
| 0 | 252 | | var request = message.Request; |
| 0 | 253 | | request.Method = RequestMethod.Get; |
| 0 | 254 | | var uri = new RawRequestUriBuilder(); |
| 0 | 255 | | uri.Reset(endpoint); |
| 0 | 256 | | uri.AppendPath("/providers/Microsoft.Resources/deployments/", false); |
| 0 | 257 | | uri.AppendPath(deploymentName, true); |
| 0 | 258 | | uri.AppendPath("/operations/", false); |
| 0 | 259 | | uri.AppendPath(operationId, true); |
| 0 | 260 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 0 | 261 | | request.Uri = uri; |
| 0 | 262 | | return message; |
| | 263 | | } |
| | 264 | |
|
| | 265 | | /// <summary> Gets a deployments operation. </summary> |
| | 266 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 267 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 268 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 269 | | public async Task<Response<DeploymentOperation>> GetAtTenantScopeAsync(string deploymentName, string operationId |
| | 270 | | { |
| 0 | 271 | | if (deploymentName == null) |
| | 272 | | { |
| 0 | 273 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 274 | | } |
| 0 | 275 | | if (operationId == null) |
| | 276 | | { |
| 0 | 277 | | throw new ArgumentNullException(nameof(operationId)); |
| | 278 | | } |
| | 279 | |
|
| 0 | 280 | | using var message = CreateGetAtTenantScopeRequest(deploymentName, operationId); |
| 0 | 281 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 282 | | switch (message.Response.Status) |
| | 283 | | { |
| | 284 | | case 200: |
| | 285 | | { |
| 0 | 286 | | DeploymentOperation value = default; |
| 0 | 287 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 288 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 289 | | { |
| 0 | 290 | | value = null; |
| | 291 | | } |
| | 292 | | else |
| | 293 | | { |
| 0 | 294 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 295 | | } |
| 0 | 296 | | return Response.FromValue(value, message.Response); |
| | 297 | | } |
| | 298 | | default: |
| 0 | 299 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 300 | | } |
| 0 | 301 | | } |
| | 302 | |
|
| | 303 | | /// <summary> Gets a deployments operation. </summary> |
| | 304 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 305 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 306 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 307 | | public Response<DeploymentOperation> GetAtTenantScope(string deploymentName, string operationId, CancellationTok |
| | 308 | | { |
| 0 | 309 | | if (deploymentName == null) |
| | 310 | | { |
| 0 | 311 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 312 | | } |
| 0 | 313 | | if (operationId == null) |
| | 314 | | { |
| 0 | 315 | | throw new ArgumentNullException(nameof(operationId)); |
| | 316 | | } |
| | 317 | |
|
| 0 | 318 | | using var message = CreateGetAtTenantScopeRequest(deploymentName, operationId); |
| 0 | 319 | | _pipeline.Send(message, cancellationToken); |
| 0 | 320 | | switch (message.Response.Status) |
| | 321 | | { |
| | 322 | | case 200: |
| | 323 | | { |
| 0 | 324 | | DeploymentOperation value = default; |
| 0 | 325 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 326 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 327 | | { |
| 0 | 328 | | value = null; |
| | 329 | | } |
| | 330 | | else |
| | 331 | | { |
| 0 | 332 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 333 | | } |
| 0 | 334 | | return Response.FromValue(value, message.Response); |
| | 335 | | } |
| | 336 | | default: |
| 0 | 337 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 338 | | } |
| 0 | 339 | | } |
| | 340 | |
|
| | 341 | | internal Core.HttpMessage CreateListAtTenantScopeRequest(string deploymentName, int? top) |
| | 342 | | { |
| 0 | 343 | | var message = _pipeline.CreateMessage(); |
| 0 | 344 | | var request = message.Request; |
| 0 | 345 | | request.Method = RequestMethod.Get; |
| 0 | 346 | | var uri = new RawRequestUriBuilder(); |
| 0 | 347 | | uri.Reset(endpoint); |
| 0 | 348 | | uri.AppendPath("/providers/Microsoft.Resources/deployments/", false); |
| 0 | 349 | | uri.AppendPath(deploymentName, true); |
| 0 | 350 | | uri.AppendPath("/operations", false); |
| 0 | 351 | | if (top != null) |
| | 352 | | { |
| 0 | 353 | | uri.AppendQuery("$top", top.Value, true); |
| | 354 | | } |
| 0 | 355 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 0 | 356 | | request.Uri = uri; |
| 0 | 357 | | return message; |
| | 358 | | } |
| | 359 | |
|
| | 360 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 361 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 362 | | /// <param name="top"> The number of results to return. </param> |
| | 363 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 364 | | public async Task<Response<DeploymentOperationsListResult>> ListAtTenantScopeAsync(string deploymentName, int? t |
| | 365 | | { |
| 0 | 366 | | if (deploymentName == null) |
| | 367 | | { |
| 0 | 368 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 369 | | } |
| | 370 | |
|
| 0 | 371 | | using var message = CreateListAtTenantScopeRequest(deploymentName, top); |
| 0 | 372 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 373 | | switch (message.Response.Status) |
| | 374 | | { |
| | 375 | | case 200: |
| | 376 | | { |
| 0 | 377 | | DeploymentOperationsListResult value = default; |
| 0 | 378 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 379 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 380 | | { |
| 0 | 381 | | value = null; |
| | 382 | | } |
| | 383 | | else |
| | 384 | | { |
| 0 | 385 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 386 | | } |
| 0 | 387 | | return Response.FromValue(value, message.Response); |
| | 388 | | } |
| | 389 | | default: |
| 0 | 390 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 391 | | } |
| 0 | 392 | | } |
| | 393 | |
|
| | 394 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 395 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 396 | | /// <param name="top"> The number of results to return. </param> |
| | 397 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 398 | | public Response<DeploymentOperationsListResult> ListAtTenantScope(string deploymentName, int? top = null, Cancel |
| | 399 | | { |
| 0 | 400 | | if (deploymentName == null) |
| | 401 | | { |
| 0 | 402 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 403 | | } |
| | 404 | |
|
| 0 | 405 | | using var message = CreateListAtTenantScopeRequest(deploymentName, top); |
| 0 | 406 | | _pipeline.Send(message, cancellationToken); |
| 0 | 407 | | switch (message.Response.Status) |
| | 408 | | { |
| | 409 | | case 200: |
| | 410 | | { |
| 0 | 411 | | DeploymentOperationsListResult value = default; |
| 0 | 412 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 413 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 414 | | { |
| 0 | 415 | | value = null; |
| | 416 | | } |
| | 417 | | else |
| | 418 | | { |
| 0 | 419 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 420 | | } |
| 0 | 421 | | return Response.FromValue(value, message.Response); |
| | 422 | | } |
| | 423 | | default: |
| 0 | 424 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 425 | | } |
| 0 | 426 | | } |
| | 427 | |
|
| | 428 | | internal Core.HttpMessage CreateGetAtManagementGroupScopeRequest(string groupId, string deploymentName, string o |
| | 429 | | { |
| 0 | 430 | | var message = _pipeline.CreateMessage(); |
| 0 | 431 | | var request = message.Request; |
| 0 | 432 | | request.Method = RequestMethod.Get; |
| 0 | 433 | | var uri = new RawRequestUriBuilder(); |
| 0 | 434 | | uri.Reset(endpoint); |
| 0 | 435 | | uri.AppendPath("/providers/Microsoft.Management/managementGroups/", false); |
| 0 | 436 | | uri.AppendPath(groupId, true); |
| 0 | 437 | | uri.AppendPath("/providers/Microsoft.Resources/deployments/", false); |
| 0 | 438 | | uri.AppendPath(deploymentName, true); |
| 0 | 439 | | uri.AppendPath("/operations/", false); |
| 0 | 440 | | uri.AppendPath(operationId, true); |
| 0 | 441 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 0 | 442 | | request.Uri = uri; |
| 0 | 443 | | return message; |
| | 444 | | } |
| | 445 | |
|
| | 446 | | /// <summary> Gets a deployments operation. </summary> |
| | 447 | | /// <param name="groupId"> The management group ID. </param> |
| | 448 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 449 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 450 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 451 | | public async Task<Response<DeploymentOperation>> GetAtManagementGroupScopeAsync(string groupId, string deploymen |
| | 452 | | { |
| 0 | 453 | | if (groupId == null) |
| | 454 | | { |
| 0 | 455 | | throw new ArgumentNullException(nameof(groupId)); |
| | 456 | | } |
| 0 | 457 | | if (deploymentName == null) |
| | 458 | | { |
| 0 | 459 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 460 | | } |
| 0 | 461 | | if (operationId == null) |
| | 462 | | { |
| 0 | 463 | | throw new ArgumentNullException(nameof(operationId)); |
| | 464 | | } |
| | 465 | |
|
| 0 | 466 | | using var message = CreateGetAtManagementGroupScopeRequest(groupId, deploymentName, operationId); |
| 0 | 467 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 468 | | switch (message.Response.Status) |
| | 469 | | { |
| | 470 | | case 200: |
| | 471 | | { |
| 0 | 472 | | DeploymentOperation value = default; |
| 0 | 473 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 474 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 475 | | { |
| 0 | 476 | | value = null; |
| | 477 | | } |
| | 478 | | else |
| | 479 | | { |
| 0 | 480 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 481 | | } |
| 0 | 482 | | return Response.FromValue(value, message.Response); |
| | 483 | | } |
| | 484 | | default: |
| 0 | 485 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 486 | | } |
| 0 | 487 | | } |
| | 488 | |
|
| | 489 | | /// <summary> Gets a deployments operation. </summary> |
| | 490 | | /// <param name="groupId"> The management group ID. </param> |
| | 491 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 492 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 493 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 494 | | public Response<DeploymentOperation> GetAtManagementGroupScope(string groupId, string deploymentName, string ope |
| | 495 | | { |
| 0 | 496 | | if (groupId == null) |
| | 497 | | { |
| 0 | 498 | | throw new ArgumentNullException(nameof(groupId)); |
| | 499 | | } |
| 0 | 500 | | if (deploymentName == null) |
| | 501 | | { |
| 0 | 502 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 503 | | } |
| 0 | 504 | | if (operationId == null) |
| | 505 | | { |
| 0 | 506 | | throw new ArgumentNullException(nameof(operationId)); |
| | 507 | | } |
| | 508 | |
|
| 0 | 509 | | using var message = CreateGetAtManagementGroupScopeRequest(groupId, deploymentName, operationId); |
| 0 | 510 | | _pipeline.Send(message, cancellationToken); |
| 0 | 511 | | switch (message.Response.Status) |
| | 512 | | { |
| | 513 | | case 200: |
| | 514 | | { |
| 0 | 515 | | DeploymentOperation value = default; |
| 0 | 516 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 517 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 518 | | { |
| 0 | 519 | | value = null; |
| | 520 | | } |
| | 521 | | else |
| | 522 | | { |
| 0 | 523 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 524 | | } |
| 0 | 525 | | return Response.FromValue(value, message.Response); |
| | 526 | | } |
| | 527 | | default: |
| 0 | 528 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 529 | | } |
| 0 | 530 | | } |
| | 531 | |
|
| | 532 | | internal Core.HttpMessage CreateListAtManagementGroupScopeRequest(string groupId, string deploymentName, int? to |
| | 533 | | { |
| 0 | 534 | | var message = _pipeline.CreateMessage(); |
| 0 | 535 | | var request = message.Request; |
| 0 | 536 | | request.Method = RequestMethod.Get; |
| 0 | 537 | | var uri = new RawRequestUriBuilder(); |
| 0 | 538 | | uri.Reset(endpoint); |
| 0 | 539 | | uri.AppendPath("/providers/Microsoft.Management/managementGroups/", false); |
| 0 | 540 | | uri.AppendPath(groupId, true); |
| 0 | 541 | | uri.AppendPath("/providers/Microsoft.Resources/deployments/", false); |
| 0 | 542 | | uri.AppendPath(deploymentName, true); |
| 0 | 543 | | uri.AppendPath("/operations", false); |
| 0 | 544 | | if (top != null) |
| | 545 | | { |
| 0 | 546 | | uri.AppendQuery("$top", top.Value, true); |
| | 547 | | } |
| 0 | 548 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 0 | 549 | | request.Uri = uri; |
| 0 | 550 | | return message; |
| | 551 | | } |
| | 552 | |
|
| | 553 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 554 | | /// <param name="groupId"> The management group ID. </param> |
| | 555 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 556 | | /// <param name="top"> The number of results to return. </param> |
| | 557 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 558 | | public async Task<Response<DeploymentOperationsListResult>> ListAtManagementGroupScopeAsync(string groupId, stri |
| | 559 | | { |
| 0 | 560 | | if (groupId == null) |
| | 561 | | { |
| 0 | 562 | | throw new ArgumentNullException(nameof(groupId)); |
| | 563 | | } |
| 0 | 564 | | if (deploymentName == null) |
| | 565 | | { |
| 0 | 566 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 567 | | } |
| | 568 | |
|
| 0 | 569 | | using var message = CreateListAtManagementGroupScopeRequest(groupId, deploymentName, top); |
| 0 | 570 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 571 | | switch (message.Response.Status) |
| | 572 | | { |
| | 573 | | case 200: |
| | 574 | | { |
| 0 | 575 | | DeploymentOperationsListResult value = default; |
| 0 | 576 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 577 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 578 | | { |
| 0 | 579 | | value = null; |
| | 580 | | } |
| | 581 | | else |
| | 582 | | { |
| 0 | 583 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 584 | | } |
| 0 | 585 | | return Response.FromValue(value, message.Response); |
| | 586 | | } |
| | 587 | | default: |
| 0 | 588 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 589 | | } |
| 0 | 590 | | } |
| | 591 | |
|
| | 592 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 593 | | /// <param name="groupId"> The management group ID. </param> |
| | 594 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 595 | | /// <param name="top"> The number of results to return. </param> |
| | 596 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 597 | | public Response<DeploymentOperationsListResult> ListAtManagementGroupScope(string groupId, string deploymentName |
| | 598 | | { |
| 0 | 599 | | if (groupId == null) |
| | 600 | | { |
| 0 | 601 | | throw new ArgumentNullException(nameof(groupId)); |
| | 602 | | } |
| 0 | 603 | | if (deploymentName == null) |
| | 604 | | { |
| 0 | 605 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 606 | | } |
| | 607 | |
|
| 0 | 608 | | using var message = CreateListAtManagementGroupScopeRequest(groupId, deploymentName, top); |
| 0 | 609 | | _pipeline.Send(message, cancellationToken); |
| 0 | 610 | | switch (message.Response.Status) |
| | 611 | | { |
| | 612 | | case 200: |
| | 613 | | { |
| 0 | 614 | | DeploymentOperationsListResult value = default; |
| 0 | 615 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 616 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 617 | | { |
| 0 | 618 | | value = null; |
| | 619 | | } |
| | 620 | | else |
| | 621 | | { |
| 0 | 622 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 623 | | } |
| 0 | 624 | | return Response.FromValue(value, message.Response); |
| | 625 | | } |
| | 626 | | default: |
| 0 | 627 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 628 | | } |
| 0 | 629 | | } |
| | 630 | |
|
| | 631 | | internal Core.HttpMessage CreateGetAtSubscriptionScopeRequest(string deploymentName, string operationId) |
| | 632 | | { |
| 0 | 633 | | var message = _pipeline.CreateMessage(); |
| 0 | 634 | | var request = message.Request; |
| 0 | 635 | | request.Method = RequestMethod.Get; |
| 0 | 636 | | var uri = new RawRequestUriBuilder(); |
| 0 | 637 | | uri.Reset(endpoint); |
| 0 | 638 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 639 | | uri.AppendPath(subscriptionId, true); |
| 0 | 640 | | uri.AppendPath("/providers/Microsoft.Resources/deployments/", false); |
| 0 | 641 | | uri.AppendPath(deploymentName, true); |
| 0 | 642 | | uri.AppendPath("/operations/", false); |
| 0 | 643 | | uri.AppendPath(operationId, true); |
| 0 | 644 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 0 | 645 | | request.Uri = uri; |
| 0 | 646 | | return message; |
| | 647 | | } |
| | 648 | |
|
| | 649 | | /// <summary> Gets a deployments operation. </summary> |
| | 650 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 651 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 652 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 653 | | public async Task<Response<DeploymentOperation>> GetAtSubscriptionScopeAsync(string deploymentName, string opera |
| | 654 | | { |
| 0 | 655 | | if (deploymentName == null) |
| | 656 | | { |
| 0 | 657 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 658 | | } |
| 0 | 659 | | if (operationId == null) |
| | 660 | | { |
| 0 | 661 | | throw new ArgumentNullException(nameof(operationId)); |
| | 662 | | } |
| | 663 | |
|
| 0 | 664 | | using var message = CreateGetAtSubscriptionScopeRequest(deploymentName, operationId); |
| 0 | 665 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 666 | | switch (message.Response.Status) |
| | 667 | | { |
| | 668 | | case 200: |
| | 669 | | { |
| 0 | 670 | | DeploymentOperation value = default; |
| 0 | 671 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 672 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 673 | | { |
| 0 | 674 | | value = null; |
| | 675 | | } |
| | 676 | | else |
| | 677 | | { |
| 0 | 678 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 679 | | } |
| 0 | 680 | | return Response.FromValue(value, message.Response); |
| | 681 | | } |
| | 682 | | default: |
| 0 | 683 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 684 | | } |
| 0 | 685 | | } |
| | 686 | |
|
| | 687 | | /// <summary> Gets a deployments operation. </summary> |
| | 688 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 689 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 690 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 691 | | public Response<DeploymentOperation> GetAtSubscriptionScope(string deploymentName, string operationId, Cancellat |
| | 692 | | { |
| 0 | 693 | | if (deploymentName == null) |
| | 694 | | { |
| 0 | 695 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 696 | | } |
| 0 | 697 | | if (operationId == null) |
| | 698 | | { |
| 0 | 699 | | throw new ArgumentNullException(nameof(operationId)); |
| | 700 | | } |
| | 701 | |
|
| 0 | 702 | | using var message = CreateGetAtSubscriptionScopeRequest(deploymentName, operationId); |
| 0 | 703 | | _pipeline.Send(message, cancellationToken); |
| 0 | 704 | | switch (message.Response.Status) |
| | 705 | | { |
| | 706 | | case 200: |
| | 707 | | { |
| 0 | 708 | | DeploymentOperation value = default; |
| 0 | 709 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 710 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 711 | | { |
| 0 | 712 | | value = null; |
| | 713 | | } |
| | 714 | | else |
| | 715 | | { |
| 0 | 716 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 717 | | } |
| 0 | 718 | | return Response.FromValue(value, message.Response); |
| | 719 | | } |
| | 720 | | default: |
| 0 | 721 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 722 | | } |
| 0 | 723 | | } |
| | 724 | |
|
| | 725 | | internal Core.HttpMessage CreateListAtSubscriptionScopeRequest(string deploymentName, int? top) |
| | 726 | | { |
| 0 | 727 | | var message = _pipeline.CreateMessage(); |
| 0 | 728 | | var request = message.Request; |
| 0 | 729 | | request.Method = RequestMethod.Get; |
| 0 | 730 | | var uri = new RawRequestUriBuilder(); |
| 0 | 731 | | uri.Reset(endpoint); |
| 0 | 732 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 733 | | uri.AppendPath(subscriptionId, true); |
| 0 | 734 | | uri.AppendPath("/providers/Microsoft.Resources/deployments/", false); |
| 0 | 735 | | uri.AppendPath(deploymentName, true); |
| 0 | 736 | | uri.AppendPath("/operations", false); |
| 0 | 737 | | if (top != null) |
| | 738 | | { |
| 0 | 739 | | uri.AppendQuery("$top", top.Value, true); |
| | 740 | | } |
| 0 | 741 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 0 | 742 | | request.Uri = uri; |
| 0 | 743 | | return message; |
| | 744 | | } |
| | 745 | |
|
| | 746 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 747 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 748 | | /// <param name="top"> The number of results to return. </param> |
| | 749 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 750 | | public async Task<Response<DeploymentOperationsListResult>> ListAtSubscriptionScopeAsync(string deploymentName, |
| | 751 | | { |
| 0 | 752 | | if (deploymentName == null) |
| | 753 | | { |
| 0 | 754 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 755 | | } |
| | 756 | |
|
| 0 | 757 | | using var message = CreateListAtSubscriptionScopeRequest(deploymentName, top); |
| 0 | 758 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 759 | | switch (message.Response.Status) |
| | 760 | | { |
| | 761 | | case 200: |
| | 762 | | { |
| 0 | 763 | | DeploymentOperationsListResult value = default; |
| 0 | 764 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 765 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 766 | | { |
| 0 | 767 | | value = null; |
| | 768 | | } |
| | 769 | | else |
| | 770 | | { |
| 0 | 771 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 772 | | } |
| 0 | 773 | | return Response.FromValue(value, message.Response); |
| | 774 | | } |
| | 775 | | default: |
| 0 | 776 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 777 | | } |
| 0 | 778 | | } |
| | 779 | |
|
| | 780 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 781 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 782 | | /// <param name="top"> The number of results to return. </param> |
| | 783 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 784 | | public Response<DeploymentOperationsListResult> ListAtSubscriptionScope(string deploymentName, int? top = null, |
| | 785 | | { |
| 0 | 786 | | if (deploymentName == null) |
| | 787 | | { |
| 0 | 788 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 789 | | } |
| | 790 | |
|
| 0 | 791 | | using var message = CreateListAtSubscriptionScopeRequest(deploymentName, top); |
| 0 | 792 | | _pipeline.Send(message, cancellationToken); |
| 0 | 793 | | switch (message.Response.Status) |
| | 794 | | { |
| | 795 | | case 200: |
| | 796 | | { |
| 0 | 797 | | DeploymentOperationsListResult value = default; |
| 0 | 798 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 799 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 800 | | { |
| 0 | 801 | | value = null; |
| | 802 | | } |
| | 803 | | else |
| | 804 | | { |
| 0 | 805 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 806 | | } |
| 0 | 807 | | return Response.FromValue(value, message.Response); |
| | 808 | | } |
| | 809 | | default: |
| 0 | 810 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 811 | | } |
| 0 | 812 | | } |
| | 813 | |
|
| | 814 | | internal Core.HttpMessage CreateGetRequest(string resourceGroupName, string deploymentName, string operationId) |
| | 815 | | { |
| 4 | 816 | | var message = _pipeline.CreateMessage(); |
| 4 | 817 | | var request = message.Request; |
| 4 | 818 | | request.Method = RequestMethod.Get; |
| 4 | 819 | | var uri = new RawRequestUriBuilder(); |
| 4 | 820 | | uri.Reset(endpoint); |
| 4 | 821 | | uri.AppendPath("/subscriptions/", false); |
| 4 | 822 | | uri.AppendPath(subscriptionId, true); |
| 4 | 823 | | uri.AppendPath("/resourcegroups/", false); |
| 4 | 824 | | uri.AppendPath(resourceGroupName, true); |
| 4 | 825 | | uri.AppendPath("/deployments/", false); |
| 4 | 826 | | uri.AppendPath(deploymentName, true); |
| 4 | 827 | | uri.AppendPath("/operations/", false); |
| 4 | 828 | | uri.AppendPath(operationId, true); |
| 4 | 829 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 4 | 830 | | request.Uri = uri; |
| 4 | 831 | | return message; |
| | 832 | | } |
| | 833 | |
|
| | 834 | | /// <summary> Gets a deployments operation. </summary> |
| | 835 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 836 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 837 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 838 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 839 | | public async Task<Response<DeploymentOperation>> GetAsync(string resourceGroupName, string deploymentName, strin |
| | 840 | | { |
| 2 | 841 | | if (resourceGroupName == null) |
| | 842 | | { |
| 0 | 843 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 844 | | } |
| 2 | 845 | | if (deploymentName == null) |
| | 846 | | { |
| 0 | 847 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 848 | | } |
| 2 | 849 | | if (operationId == null) |
| | 850 | | { |
| 0 | 851 | | throw new ArgumentNullException(nameof(operationId)); |
| | 852 | | } |
| | 853 | |
|
| 2 | 854 | | using var message = CreateGetRequest(resourceGroupName, deploymentName, operationId); |
| 2 | 855 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 856 | | switch (message.Response.Status) |
| | 857 | | { |
| | 858 | | case 200: |
| | 859 | | { |
| 2 | 860 | | DeploymentOperation value = default; |
| 2 | 861 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 2 | 862 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 863 | | { |
| 0 | 864 | | value = null; |
| | 865 | | } |
| | 866 | | else |
| | 867 | | { |
| 2 | 868 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 869 | | } |
| 2 | 870 | | return Response.FromValue(value, message.Response); |
| | 871 | | } |
| | 872 | | default: |
| 0 | 873 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 874 | | } |
| 2 | 875 | | } |
| | 876 | |
|
| | 877 | | /// <summary> Gets a deployments operation. </summary> |
| | 878 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 879 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 880 | | /// <param name="operationId"> The ID of the operation to get. </param> |
| | 881 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 882 | | public Response<DeploymentOperation> Get(string resourceGroupName, string deploymentName, string operationId, Ca |
| | 883 | | { |
| 2 | 884 | | if (resourceGroupName == null) |
| | 885 | | { |
| 0 | 886 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 887 | | } |
| 2 | 888 | | if (deploymentName == null) |
| | 889 | | { |
| 0 | 890 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 891 | | } |
| 2 | 892 | | if (operationId == null) |
| | 893 | | { |
| 0 | 894 | | throw new ArgumentNullException(nameof(operationId)); |
| | 895 | | } |
| | 896 | |
|
| 2 | 897 | | using var message = CreateGetRequest(resourceGroupName, deploymentName, operationId); |
| 2 | 898 | | _pipeline.Send(message, cancellationToken); |
| 2 | 899 | | switch (message.Response.Status) |
| | 900 | | { |
| | 901 | | case 200: |
| | 902 | | { |
| 2 | 903 | | DeploymentOperation value = default; |
| 2 | 904 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 2 | 905 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 906 | | { |
| 0 | 907 | | value = null; |
| | 908 | | } |
| | 909 | | else |
| | 910 | | { |
| 2 | 911 | | value = DeploymentOperation.DeserializeDeploymentOperation(document.RootElement); |
| | 912 | | } |
| 2 | 913 | | return Response.FromValue(value, message.Response); |
| | 914 | | } |
| | 915 | | default: |
| 0 | 916 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 917 | | } |
| 2 | 918 | | } |
| | 919 | |
|
| | 920 | | internal Core.HttpMessage CreateListRequest(string resourceGroupName, string deploymentName, int? top) |
| | 921 | | { |
| 16 | 922 | | var message = _pipeline.CreateMessage(); |
| 16 | 923 | | var request = message.Request; |
| 16 | 924 | | request.Method = RequestMethod.Get; |
| 16 | 925 | | var uri = new RawRequestUriBuilder(); |
| 16 | 926 | | uri.Reset(endpoint); |
| 16 | 927 | | uri.AppendPath("/subscriptions/", false); |
| 16 | 928 | | uri.AppendPath(subscriptionId, true); |
| 16 | 929 | | uri.AppendPath("/resourcegroups/", false); |
| 16 | 930 | | uri.AppendPath(resourceGroupName, true); |
| 16 | 931 | | uri.AppendPath("/deployments/", false); |
| 16 | 932 | | uri.AppendPath(deploymentName, true); |
| 16 | 933 | | uri.AppendPath("/operations", false); |
| 16 | 934 | | if (top != null) |
| | 935 | | { |
| 0 | 936 | | uri.AppendQuery("$top", top.Value, true); |
| | 937 | | } |
| 16 | 938 | | uri.AppendQuery("api-version", "2019-10-01", true); |
| 16 | 939 | | request.Uri = uri; |
| 16 | 940 | | return message; |
| | 941 | | } |
| | 942 | |
|
| | 943 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 944 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 945 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 946 | | /// <param name="top"> The number of results to return. </param> |
| | 947 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 948 | | public async Task<Response<DeploymentOperationsListResult>> ListAsync(string resourceGroupName, string deploymen |
| | 949 | | { |
| 8 | 950 | | if (resourceGroupName == null) |
| | 951 | | { |
| 0 | 952 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 953 | | } |
| 8 | 954 | | if (deploymentName == null) |
| | 955 | | { |
| 0 | 956 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 957 | | } |
| | 958 | |
|
| 8 | 959 | | using var message = CreateListRequest(resourceGroupName, deploymentName, top); |
| 8 | 960 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 8 | 961 | | switch (message.Response.Status) |
| | 962 | | { |
| | 963 | | case 200: |
| | 964 | | { |
| 8 | 965 | | DeploymentOperationsListResult value = default; |
| 8 | 966 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 8 | 967 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 968 | | { |
| 0 | 969 | | value = null; |
| | 970 | | } |
| | 971 | | else |
| | 972 | | { |
| 8 | 973 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 974 | | } |
| 8 | 975 | | return Response.FromValue(value, message.Response); |
| | 976 | | } |
| | 977 | | default: |
| 0 | 978 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 979 | | } |
| 8 | 980 | | } |
| | 981 | |
|
| | 982 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 983 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 984 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 985 | | /// <param name="top"> The number of results to return. </param> |
| | 986 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 987 | | public Response<DeploymentOperationsListResult> List(string resourceGroupName, string deploymentName, int? top = |
| | 988 | | { |
| 8 | 989 | | if (resourceGroupName == null) |
| | 990 | | { |
| 0 | 991 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 992 | | } |
| 8 | 993 | | if (deploymentName == null) |
| | 994 | | { |
| 0 | 995 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 996 | | } |
| | 997 | |
|
| 8 | 998 | | using var message = CreateListRequest(resourceGroupName, deploymentName, top); |
| 8 | 999 | | _pipeline.Send(message, cancellationToken); |
| 8 | 1000 | | switch (message.Response.Status) |
| | 1001 | | { |
| | 1002 | | case 200: |
| | 1003 | | { |
| 8 | 1004 | | DeploymentOperationsListResult value = default; |
| 8 | 1005 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 8 | 1006 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1007 | | { |
| 0 | 1008 | | value = null; |
| | 1009 | | } |
| | 1010 | | else |
| | 1011 | | { |
| 8 | 1012 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1013 | | } |
| 8 | 1014 | | return Response.FromValue(value, message.Response); |
| | 1015 | | } |
| | 1016 | | default: |
| 0 | 1017 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1018 | | } |
| 8 | 1019 | | } |
| | 1020 | |
|
| | 1021 | | internal Core.HttpMessage CreateListAtScopeNextPageRequest(string nextLink, string scope, string deploymentName, |
| | 1022 | | { |
| 0 | 1023 | | var message = _pipeline.CreateMessage(); |
| 0 | 1024 | | var request = message.Request; |
| 0 | 1025 | | request.Method = RequestMethod.Get; |
| 0 | 1026 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1027 | | uri.Reset(endpoint); |
| 0 | 1028 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1029 | | request.Uri = uri; |
| 0 | 1030 | | return message; |
| | 1031 | | } |
| | 1032 | |
|
| | 1033 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1034 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1035 | | /// <param name="scope"> The resource scope. </param> |
| | 1036 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1037 | | /// <param name="top"> The number of results to return. </param> |
| | 1038 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1039 | | public async Task<Response<DeploymentOperationsListResult>> ListAtScopeNextPageAsync(string nextLink, string sco |
| | 1040 | | { |
| 0 | 1041 | | if (nextLink == null) |
| | 1042 | | { |
| 0 | 1043 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1044 | | } |
| 0 | 1045 | | if (scope == null) |
| | 1046 | | { |
| 0 | 1047 | | throw new ArgumentNullException(nameof(scope)); |
| | 1048 | | } |
| 0 | 1049 | | if (deploymentName == null) |
| | 1050 | | { |
| 0 | 1051 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1052 | | } |
| | 1053 | |
|
| 0 | 1054 | | using var message = CreateListAtScopeNextPageRequest(nextLink, scope, deploymentName, top); |
| 0 | 1055 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1056 | | switch (message.Response.Status) |
| | 1057 | | { |
| | 1058 | | case 200: |
| | 1059 | | { |
| 0 | 1060 | | DeploymentOperationsListResult value = default; |
| 0 | 1061 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1062 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1063 | | { |
| 0 | 1064 | | value = null; |
| | 1065 | | } |
| | 1066 | | else |
| | 1067 | | { |
| 0 | 1068 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1069 | | } |
| 0 | 1070 | | return Response.FromValue(value, message.Response); |
| | 1071 | | } |
| | 1072 | | default: |
| 0 | 1073 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1074 | | } |
| 0 | 1075 | | } |
| | 1076 | |
|
| | 1077 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1078 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1079 | | /// <param name="scope"> The resource scope. </param> |
| | 1080 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1081 | | /// <param name="top"> The number of results to return. </param> |
| | 1082 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1083 | | public Response<DeploymentOperationsListResult> ListAtScopeNextPage(string nextLink, string scope, string deploy |
| | 1084 | | { |
| 0 | 1085 | | if (nextLink == null) |
| | 1086 | | { |
| 0 | 1087 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1088 | | } |
| 0 | 1089 | | if (scope == null) |
| | 1090 | | { |
| 0 | 1091 | | throw new ArgumentNullException(nameof(scope)); |
| | 1092 | | } |
| 0 | 1093 | | if (deploymentName == null) |
| | 1094 | | { |
| 0 | 1095 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1096 | | } |
| | 1097 | |
|
| 0 | 1098 | | using var message = CreateListAtScopeNextPageRequest(nextLink, scope, deploymentName, top); |
| 0 | 1099 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1100 | | switch (message.Response.Status) |
| | 1101 | | { |
| | 1102 | | case 200: |
| | 1103 | | { |
| 0 | 1104 | | DeploymentOperationsListResult value = default; |
| 0 | 1105 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1106 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1107 | | { |
| 0 | 1108 | | value = null; |
| | 1109 | | } |
| | 1110 | | else |
| | 1111 | | { |
| 0 | 1112 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1113 | | } |
| 0 | 1114 | | return Response.FromValue(value, message.Response); |
| | 1115 | | } |
| | 1116 | | default: |
| 0 | 1117 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1118 | | } |
| 0 | 1119 | | } |
| | 1120 | |
|
| | 1121 | | internal Core.HttpMessage CreateListAtTenantScopeNextPageRequest(string nextLink, string deploymentName, int? to |
| | 1122 | | { |
| 0 | 1123 | | var message = _pipeline.CreateMessage(); |
| 0 | 1124 | | var request = message.Request; |
| 0 | 1125 | | request.Method = RequestMethod.Get; |
| 0 | 1126 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1127 | | uri.Reset(endpoint); |
| 0 | 1128 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1129 | | request.Uri = uri; |
| 0 | 1130 | | return message; |
| | 1131 | | } |
| | 1132 | |
|
| | 1133 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1134 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1135 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1136 | | /// <param name="top"> The number of results to return. </param> |
| | 1137 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1138 | | public async Task<Response<DeploymentOperationsListResult>> ListAtTenantScopeNextPageAsync(string nextLink, stri |
| | 1139 | | { |
| 0 | 1140 | | if (nextLink == null) |
| | 1141 | | { |
| 0 | 1142 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1143 | | } |
| 0 | 1144 | | if (deploymentName == null) |
| | 1145 | | { |
| 0 | 1146 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1147 | | } |
| | 1148 | |
|
| 0 | 1149 | | using var message = CreateListAtTenantScopeNextPageRequest(nextLink, deploymentName, top); |
| 0 | 1150 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1151 | | switch (message.Response.Status) |
| | 1152 | | { |
| | 1153 | | case 200: |
| | 1154 | | { |
| 0 | 1155 | | DeploymentOperationsListResult value = default; |
| 0 | 1156 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1157 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1158 | | { |
| 0 | 1159 | | value = null; |
| | 1160 | | } |
| | 1161 | | else |
| | 1162 | | { |
| 0 | 1163 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1164 | | } |
| 0 | 1165 | | return Response.FromValue(value, message.Response); |
| | 1166 | | } |
| | 1167 | | default: |
| 0 | 1168 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1169 | | } |
| 0 | 1170 | | } |
| | 1171 | |
|
| | 1172 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1173 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1174 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1175 | | /// <param name="top"> The number of results to return. </param> |
| | 1176 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1177 | | public Response<DeploymentOperationsListResult> ListAtTenantScopeNextPage(string nextLink, string deploymentName |
| | 1178 | | { |
| 0 | 1179 | | if (nextLink == null) |
| | 1180 | | { |
| 0 | 1181 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1182 | | } |
| 0 | 1183 | | if (deploymentName == null) |
| | 1184 | | { |
| 0 | 1185 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1186 | | } |
| | 1187 | |
|
| 0 | 1188 | | using var message = CreateListAtTenantScopeNextPageRequest(nextLink, deploymentName, top); |
| 0 | 1189 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1190 | | switch (message.Response.Status) |
| | 1191 | | { |
| | 1192 | | case 200: |
| | 1193 | | { |
| 0 | 1194 | | DeploymentOperationsListResult value = default; |
| 0 | 1195 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1196 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1197 | | { |
| 0 | 1198 | | value = null; |
| | 1199 | | } |
| | 1200 | | else |
| | 1201 | | { |
| 0 | 1202 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1203 | | } |
| 0 | 1204 | | return Response.FromValue(value, message.Response); |
| | 1205 | | } |
| | 1206 | | default: |
| 0 | 1207 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1208 | | } |
| 0 | 1209 | | } |
| | 1210 | |
|
| | 1211 | | internal Core.HttpMessage CreateListAtManagementGroupScopeNextPageRequest(string nextLink, string groupId, strin |
| | 1212 | | { |
| 0 | 1213 | | var message = _pipeline.CreateMessage(); |
| 0 | 1214 | | var request = message.Request; |
| 0 | 1215 | | request.Method = RequestMethod.Get; |
| 0 | 1216 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1217 | | uri.Reset(endpoint); |
| 0 | 1218 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1219 | | request.Uri = uri; |
| 0 | 1220 | | return message; |
| | 1221 | | } |
| | 1222 | |
|
| | 1223 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1224 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1225 | | /// <param name="groupId"> The management group ID. </param> |
| | 1226 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1227 | | /// <param name="top"> The number of results to return. </param> |
| | 1228 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1229 | | public async Task<Response<DeploymentOperationsListResult>> ListAtManagementGroupScopeNextPageAsync(string nextL |
| | 1230 | | { |
| 0 | 1231 | | if (nextLink == null) |
| | 1232 | | { |
| 0 | 1233 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1234 | | } |
| 0 | 1235 | | if (groupId == null) |
| | 1236 | | { |
| 0 | 1237 | | throw new ArgumentNullException(nameof(groupId)); |
| | 1238 | | } |
| 0 | 1239 | | if (deploymentName == null) |
| | 1240 | | { |
| 0 | 1241 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1242 | | } |
| | 1243 | |
|
| 0 | 1244 | | using var message = CreateListAtManagementGroupScopeNextPageRequest(nextLink, groupId, deploymentName, top); |
| 0 | 1245 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1246 | | switch (message.Response.Status) |
| | 1247 | | { |
| | 1248 | | case 200: |
| | 1249 | | { |
| 0 | 1250 | | DeploymentOperationsListResult value = default; |
| 0 | 1251 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1252 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1253 | | { |
| 0 | 1254 | | value = null; |
| | 1255 | | } |
| | 1256 | | else |
| | 1257 | | { |
| 0 | 1258 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1259 | | } |
| 0 | 1260 | | return Response.FromValue(value, message.Response); |
| | 1261 | | } |
| | 1262 | | default: |
| 0 | 1263 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1264 | | } |
| 0 | 1265 | | } |
| | 1266 | |
|
| | 1267 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1268 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1269 | | /// <param name="groupId"> The management group ID. </param> |
| | 1270 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1271 | | /// <param name="top"> The number of results to return. </param> |
| | 1272 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1273 | | public Response<DeploymentOperationsListResult> ListAtManagementGroupScopeNextPage(string nextLink, string group |
| | 1274 | | { |
| 0 | 1275 | | if (nextLink == null) |
| | 1276 | | { |
| 0 | 1277 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1278 | | } |
| 0 | 1279 | | if (groupId == null) |
| | 1280 | | { |
| 0 | 1281 | | throw new ArgumentNullException(nameof(groupId)); |
| | 1282 | | } |
| 0 | 1283 | | if (deploymentName == null) |
| | 1284 | | { |
| 0 | 1285 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1286 | | } |
| | 1287 | |
|
| 0 | 1288 | | using var message = CreateListAtManagementGroupScopeNextPageRequest(nextLink, groupId, deploymentName, top); |
| 0 | 1289 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1290 | | switch (message.Response.Status) |
| | 1291 | | { |
| | 1292 | | case 200: |
| | 1293 | | { |
| 0 | 1294 | | DeploymentOperationsListResult value = default; |
| 0 | 1295 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1296 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1297 | | { |
| 0 | 1298 | | value = null; |
| | 1299 | | } |
| | 1300 | | else |
| | 1301 | | { |
| 0 | 1302 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1303 | | } |
| 0 | 1304 | | return Response.FromValue(value, message.Response); |
| | 1305 | | } |
| | 1306 | | default: |
| 0 | 1307 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1308 | | } |
| 0 | 1309 | | } |
| | 1310 | |
|
| | 1311 | | internal Core.HttpMessage CreateListAtSubscriptionScopeNextPageRequest(string nextLink, string deploymentName, i |
| | 1312 | | { |
| 0 | 1313 | | var message = _pipeline.CreateMessage(); |
| 0 | 1314 | | var request = message.Request; |
| 0 | 1315 | | request.Method = RequestMethod.Get; |
| 0 | 1316 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1317 | | uri.Reset(endpoint); |
| 0 | 1318 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1319 | | request.Uri = uri; |
| 0 | 1320 | | return message; |
| | 1321 | | } |
| | 1322 | |
|
| | 1323 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1324 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1325 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1326 | | /// <param name="top"> The number of results to return. </param> |
| | 1327 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1328 | | public async Task<Response<DeploymentOperationsListResult>> ListAtSubscriptionScopeNextPageAsync(string nextLink |
| | 1329 | | { |
| 0 | 1330 | | if (nextLink == null) |
| | 1331 | | { |
| 0 | 1332 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1333 | | } |
| 0 | 1334 | | if (deploymentName == null) |
| | 1335 | | { |
| 0 | 1336 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1337 | | } |
| | 1338 | |
|
| 0 | 1339 | | using var message = CreateListAtSubscriptionScopeNextPageRequest(nextLink, deploymentName, top); |
| 0 | 1340 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1341 | | switch (message.Response.Status) |
| | 1342 | | { |
| | 1343 | | case 200: |
| | 1344 | | { |
| 0 | 1345 | | DeploymentOperationsListResult value = default; |
| 0 | 1346 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1347 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1348 | | { |
| 0 | 1349 | | value = null; |
| | 1350 | | } |
| | 1351 | | else |
| | 1352 | | { |
| 0 | 1353 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1354 | | } |
| 0 | 1355 | | return Response.FromValue(value, message.Response); |
| | 1356 | | } |
| | 1357 | | default: |
| 0 | 1358 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1359 | | } |
| 0 | 1360 | | } |
| | 1361 | |
|
| | 1362 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1363 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1364 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1365 | | /// <param name="top"> The number of results to return. </param> |
| | 1366 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1367 | | public Response<DeploymentOperationsListResult> ListAtSubscriptionScopeNextPage(string nextLink, string deployme |
| | 1368 | | { |
| 0 | 1369 | | if (nextLink == null) |
| | 1370 | | { |
| 0 | 1371 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1372 | | } |
| 0 | 1373 | | if (deploymentName == null) |
| | 1374 | | { |
| 0 | 1375 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1376 | | } |
| | 1377 | |
|
| 0 | 1378 | | using var message = CreateListAtSubscriptionScopeNextPageRequest(nextLink, deploymentName, top); |
| 0 | 1379 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1380 | | switch (message.Response.Status) |
| | 1381 | | { |
| | 1382 | | case 200: |
| | 1383 | | { |
| 0 | 1384 | | DeploymentOperationsListResult value = default; |
| 0 | 1385 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1386 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1387 | | { |
| 0 | 1388 | | value = null; |
| | 1389 | | } |
| | 1390 | | else |
| | 1391 | | { |
| 0 | 1392 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1393 | | } |
| 0 | 1394 | | return Response.FromValue(value, message.Response); |
| | 1395 | | } |
| | 1396 | | default: |
| 0 | 1397 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1398 | | } |
| 0 | 1399 | | } |
| | 1400 | |
|
| | 1401 | | internal Core.HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string deployment |
| | 1402 | | { |
| 0 | 1403 | | var message = _pipeline.CreateMessage(); |
| 0 | 1404 | | var request = message.Request; |
| 0 | 1405 | | request.Method = RequestMethod.Get; |
| 0 | 1406 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1407 | | uri.Reset(endpoint); |
| 0 | 1408 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1409 | | request.Uri = uri; |
| 0 | 1410 | | return message; |
| | 1411 | | } |
| | 1412 | |
|
| | 1413 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1414 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1415 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 1416 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1417 | | /// <param name="top"> The number of results to return. </param> |
| | 1418 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1419 | | public async Task<Response<DeploymentOperationsListResult>> ListNextPageAsync(string nextLink, string resourceGr |
| | 1420 | | { |
| 0 | 1421 | | if (nextLink == null) |
| | 1422 | | { |
| 0 | 1423 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1424 | | } |
| 0 | 1425 | | if (resourceGroupName == null) |
| | 1426 | | { |
| 0 | 1427 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1428 | | } |
| 0 | 1429 | | if (deploymentName == null) |
| | 1430 | | { |
| 0 | 1431 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1432 | | } |
| | 1433 | |
|
| 0 | 1434 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName, deploymentName, top); |
| 0 | 1435 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1436 | | switch (message.Response.Status) |
| | 1437 | | { |
| | 1438 | | case 200: |
| | 1439 | | { |
| 0 | 1440 | | DeploymentOperationsListResult value = default; |
| 0 | 1441 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1442 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1443 | | { |
| 0 | 1444 | | value = null; |
| | 1445 | | } |
| | 1446 | | else |
| | 1447 | | { |
| 0 | 1448 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1449 | | } |
| 0 | 1450 | | return Response.FromValue(value, message.Response); |
| | 1451 | | } |
| | 1452 | | default: |
| 0 | 1453 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1454 | | } |
| 0 | 1455 | | } |
| | 1456 | |
|
| | 1457 | | /// <summary> Gets all deployments operations for a deployment. </summary> |
| | 1458 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1459 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 1460 | | /// <param name="deploymentName"> The name of the deployment. </param> |
| | 1461 | | /// <param name="top"> The number of results to return. </param> |
| | 1462 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1463 | | public Response<DeploymentOperationsListResult> ListNextPage(string nextLink, string resourceGroupName, string d |
| | 1464 | | { |
| 0 | 1465 | | if (nextLink == null) |
| | 1466 | | { |
| 0 | 1467 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1468 | | } |
| 0 | 1469 | | if (resourceGroupName == null) |
| | 1470 | | { |
| 0 | 1471 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1472 | | } |
| 0 | 1473 | | if (deploymentName == null) |
| | 1474 | | { |
| 0 | 1475 | | throw new ArgumentNullException(nameof(deploymentName)); |
| | 1476 | | } |
| | 1477 | |
|
| 0 | 1478 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName, deploymentName, top); |
| 0 | 1479 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1480 | | switch (message.Response.Status) |
| | 1481 | | { |
| | 1482 | | case 200: |
| | 1483 | | { |
| 0 | 1484 | | DeploymentOperationsListResult value = default; |
| 0 | 1485 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1486 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1487 | | { |
| 0 | 1488 | | value = null; |
| | 1489 | | } |
| | 1490 | | else |
| | 1491 | | { |
| 0 | 1492 | | value = DeploymentOperationsListResult.DeserializeDeploymentOperationsListResult(document.Ro |
| | 1493 | | } |
| 0 | 1494 | | return Response.FromValue(value, message.Response); |
| | 1495 | | } |
| | 1496 | | default: |
| 0 | 1497 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1498 | | } |
| 0 | 1499 | | } |
| | 1500 | | } |
| | 1501 | | } |