| | 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 DeploymentScriptsRestOperations |
| | 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 DeploymentScriptsRestOperations. </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 |
| 256 | 32 | | public DeploymentScriptsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscr |
| | 33 | | { |
| 256 | 34 | | if (subscriptionId == null) |
| | 35 | | { |
| 0 | 36 | | throw new ArgumentNullException(nameof(subscriptionId)); |
| | 37 | | } |
| 256 | 38 | | endpoint ??= new Uri("https://management.azure.com"); |
| | 39 | |
|
| 256 | 40 | | this.subscriptionId = subscriptionId; |
| 256 | 41 | | this.endpoint = endpoint; |
| 256 | 42 | | _clientDiagnostics = clientDiagnostics; |
| 256 | 43 | | _pipeline = pipeline; |
| 256 | 44 | | } |
| | 45 | |
|
| | 46 | | internal Core.HttpMessage CreateCreateRequest(string resourceGroupName, string scriptName, DeploymentScript depl |
| | 47 | | { |
| 24 | 48 | | var message = _pipeline.CreateMessage(); |
| 24 | 49 | | var request = message.Request; |
| 24 | 50 | | request.Method = RequestMethod.Put; |
| 24 | 51 | | var uri = new RawRequestUriBuilder(); |
| 24 | 52 | | uri.Reset(endpoint); |
| 24 | 53 | | uri.AppendPath("/subscriptions/", false); |
| 24 | 54 | | uri.AppendPath(subscriptionId, true); |
| 24 | 55 | | uri.AppendPath("/resourcegroups/", false); |
| 24 | 56 | | uri.AppendPath(resourceGroupName, true); |
| 24 | 57 | | uri.AppendPath("/providers/Microsoft.Resources/deploymentScripts/", false); |
| 24 | 58 | | uri.AppendPath(scriptName, true); |
| 24 | 59 | | uri.AppendQuery("api-version", "2019-10-01-preview", true); |
| 24 | 60 | | request.Uri = uri; |
| 24 | 61 | | request.Headers.Add("Content-Type", "application/json"); |
| 24 | 62 | | var content = new Utf8JsonRequestContent(); |
| 24 | 63 | | content.JsonWriter.WriteObjectValue(deploymentScript); |
| 24 | 64 | | request.Content = content; |
| 24 | 65 | | return message; |
| | 66 | | } |
| | 67 | |
|
| | 68 | | /// <summary> Creates a deployment script. </summary> |
| | 69 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 70 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 71 | | /// <param name="deploymentScript"> Deployment script supplied to the operation. </param> |
| | 72 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 73 | | public async Task<Response> CreateAsync(string resourceGroupName, string scriptName, DeploymentScript deployment |
| | 74 | | { |
| 6 | 75 | | if (resourceGroupName == null) |
| | 76 | | { |
| 0 | 77 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 78 | | } |
| 6 | 79 | | if (scriptName == null) |
| | 80 | | { |
| 0 | 81 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 82 | | } |
| 6 | 83 | | if (deploymentScript == null) |
| | 84 | | { |
| 0 | 85 | | throw new ArgumentNullException(nameof(deploymentScript)); |
| | 86 | | } |
| | 87 | |
|
| 6 | 88 | | using var message = CreateCreateRequest(resourceGroupName, scriptName, deploymentScript); |
| 6 | 89 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 6 | 90 | | switch (message.Response.Status) |
| | 91 | | { |
| | 92 | | case 200: |
| | 93 | | case 201: |
| 6 | 94 | | return message.Response; |
| | 95 | | default: |
| 0 | 96 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 97 | | } |
| 6 | 98 | | } |
| | 99 | |
|
| | 100 | | /// <summary> Creates a deployment script. </summary> |
| | 101 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 102 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 103 | | /// <param name="deploymentScript"> Deployment script supplied to the operation. </param> |
| | 104 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 105 | | public Response Create(string resourceGroupName, string scriptName, DeploymentScript deploymentScript, Cancellat |
| | 106 | | { |
| 6 | 107 | | if (resourceGroupName == null) |
| | 108 | | { |
| 0 | 109 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 110 | | } |
| 6 | 111 | | if (scriptName == null) |
| | 112 | | { |
| 0 | 113 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 114 | | } |
| 6 | 115 | | if (deploymentScript == null) |
| | 116 | | { |
| 0 | 117 | | throw new ArgumentNullException(nameof(deploymentScript)); |
| | 118 | | } |
| | 119 | |
|
| 6 | 120 | | using var message = CreateCreateRequest(resourceGroupName, scriptName, deploymentScript); |
| 6 | 121 | | _pipeline.Send(message, cancellationToken); |
| 6 | 122 | | switch (message.Response.Status) |
| | 123 | | { |
| | 124 | | case 200: |
| | 125 | | case 201: |
| 6 | 126 | | return message.Response; |
| | 127 | | default: |
| 0 | 128 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 129 | | } |
| 6 | 130 | | } |
| | 131 | |
|
| | 132 | | internal Core.HttpMessage CreateUpdateRequest(string resourceGroupName, string scriptName, DeploymentScriptUpdat |
| | 133 | | { |
| 0 | 134 | | var message = _pipeline.CreateMessage(); |
| 0 | 135 | | var request = message.Request; |
| 0 | 136 | | request.Method = RequestMethod.Patch; |
| 0 | 137 | | var uri = new RawRequestUriBuilder(); |
| 0 | 138 | | uri.Reset(endpoint); |
| 0 | 139 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 140 | | uri.AppendPath(subscriptionId, true); |
| 0 | 141 | | uri.AppendPath("/resourcegroups/", false); |
| 0 | 142 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 143 | | uri.AppendPath("/providers/Microsoft.Resources/deploymentScripts/", false); |
| 0 | 144 | | uri.AppendPath(scriptName, true); |
| 0 | 145 | | uri.AppendQuery("api-version", "2019-10-01-preview", true); |
| 0 | 146 | | request.Uri = uri; |
| 0 | 147 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 148 | | if (deploymentScript != null) |
| | 149 | | { |
| 0 | 150 | | var content = new Utf8JsonRequestContent(); |
| 0 | 151 | | content.JsonWriter.WriteObjectValue(deploymentScript); |
| 0 | 152 | | request.Content = content; |
| | 153 | | } |
| 0 | 154 | | return message; |
| | 155 | | } |
| | 156 | |
|
| | 157 | | /// <summary> Updates deployment script tags with specified values. </summary> |
| | 158 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 159 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 160 | | /// <param name="deploymentScript"> Deployment script resource with the tags to be updated. </param> |
| | 161 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 162 | | public async Task<Response<DeploymentScript>> UpdateAsync(string resourceGroupName, string scriptName, Deploymen |
| | 163 | | { |
| 0 | 164 | | if (resourceGroupName == null) |
| | 165 | | { |
| 0 | 166 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 167 | | } |
| 0 | 168 | | if (scriptName == null) |
| | 169 | | { |
| 0 | 170 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 171 | | } |
| | 172 | |
|
| 0 | 173 | | using var message = CreateUpdateRequest(resourceGroupName, scriptName, deploymentScript); |
| 0 | 174 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 175 | | switch (message.Response.Status) |
| | 176 | | { |
| | 177 | | case 200: |
| | 178 | | { |
| 0 | 179 | | DeploymentScript value = default; |
| 0 | 180 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 181 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 182 | | { |
| 0 | 183 | | value = null; |
| | 184 | | } |
| | 185 | | else |
| | 186 | | { |
| 0 | 187 | | value = DeploymentScript.DeserializeDeploymentScript(document.RootElement); |
| | 188 | | } |
| 0 | 189 | | return Response.FromValue(value, message.Response); |
| | 190 | | } |
| | 191 | | default: |
| 0 | 192 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 193 | | } |
| 0 | 194 | | } |
| | 195 | |
|
| | 196 | | /// <summary> Updates deployment script tags with specified values. </summary> |
| | 197 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 198 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 199 | | /// <param name="deploymentScript"> Deployment script resource with the tags to be updated. </param> |
| | 200 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 201 | | public Response<DeploymentScript> Update(string resourceGroupName, string scriptName, DeploymentScriptUpdatePara |
| | 202 | | { |
| 0 | 203 | | if (resourceGroupName == null) |
| | 204 | | { |
| 0 | 205 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 206 | | } |
| 0 | 207 | | if (scriptName == null) |
| | 208 | | { |
| 0 | 209 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 210 | | } |
| | 211 | |
|
| 0 | 212 | | using var message = CreateUpdateRequest(resourceGroupName, scriptName, deploymentScript); |
| 0 | 213 | | _pipeline.Send(message, cancellationToken); |
| 0 | 214 | | switch (message.Response.Status) |
| | 215 | | { |
| | 216 | | case 200: |
| | 217 | | { |
| 0 | 218 | | DeploymentScript value = default; |
| 0 | 219 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 220 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 221 | | { |
| 0 | 222 | | value = null; |
| | 223 | | } |
| | 224 | | else |
| | 225 | | { |
| 0 | 226 | | value = DeploymentScript.DeserializeDeploymentScript(document.RootElement); |
| | 227 | | } |
| 0 | 228 | | return Response.FromValue(value, message.Response); |
| | 229 | | } |
| | 230 | | default: |
| 0 | 231 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 232 | | } |
| 0 | 233 | | } |
| | 234 | |
|
| | 235 | | internal Core.HttpMessage CreateGetRequest(string resourceGroupName, string scriptName) |
| | 236 | | { |
| 46 | 237 | | var message = _pipeline.CreateMessage(); |
| 46 | 238 | | var request = message.Request; |
| 46 | 239 | | request.Method = RequestMethod.Get; |
| 46 | 240 | | var uri = new RawRequestUriBuilder(); |
| 46 | 241 | | uri.Reset(endpoint); |
| 46 | 242 | | uri.AppendPath("/subscriptions/", false); |
| 46 | 243 | | uri.AppendPath(subscriptionId, true); |
| 46 | 244 | | uri.AppendPath("/resourcegroups/", false); |
| 46 | 245 | | uri.AppendPath(resourceGroupName, true); |
| 46 | 246 | | uri.AppendPath("/providers/Microsoft.Resources/deploymentScripts/", false); |
| 46 | 247 | | uri.AppendPath(scriptName, true); |
| 46 | 248 | | uri.AppendQuery("api-version", "2019-10-01-preview", true); |
| 46 | 249 | | request.Uri = uri; |
| 46 | 250 | | return message; |
| | 251 | | } |
| | 252 | |
|
| | 253 | | /// <summary> Gets a deployment script with a given name. </summary> |
| | 254 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 255 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 256 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 257 | | public async Task<Response<DeploymentScript>> GetAsync(string resourceGroupName, string scriptName, Cancellation |
| | 258 | | { |
| 24 | 259 | | if (resourceGroupName == null) |
| | 260 | | { |
| 0 | 261 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 262 | | } |
| 24 | 263 | | if (scriptName == null) |
| | 264 | | { |
| 0 | 265 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 266 | | } |
| | 267 | |
|
| 24 | 268 | | using var message = CreateGetRequest(resourceGroupName, scriptName); |
| 24 | 269 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 24 | 270 | | switch (message.Response.Status) |
| | 271 | | { |
| | 272 | | case 200: |
| | 273 | | { |
| 24 | 274 | | DeploymentScript value = default; |
| 24 | 275 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 24 | 276 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 277 | | { |
| 0 | 278 | | value = null; |
| | 279 | | } |
| | 280 | | else |
| | 281 | | { |
| 24 | 282 | | value = DeploymentScript.DeserializeDeploymentScript(document.RootElement); |
| | 283 | | } |
| 24 | 284 | | return Response.FromValue(value, message.Response); |
| | 285 | | } |
| | 286 | | default: |
| 0 | 287 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 288 | | } |
| 24 | 289 | | } |
| | 290 | |
|
| | 291 | | /// <summary> Gets a deployment script with a given name. </summary> |
| | 292 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 293 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 294 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 295 | | public Response<DeploymentScript> Get(string resourceGroupName, string scriptName, CancellationToken cancellatio |
| | 296 | | { |
| 22 | 297 | | if (resourceGroupName == null) |
| | 298 | | { |
| 0 | 299 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 300 | | } |
| 22 | 301 | | if (scriptName == null) |
| | 302 | | { |
| 0 | 303 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 304 | | } |
| | 305 | |
|
| 22 | 306 | | using var message = CreateGetRequest(resourceGroupName, scriptName); |
| 22 | 307 | | _pipeline.Send(message, cancellationToken); |
| 22 | 308 | | switch (message.Response.Status) |
| | 309 | | { |
| | 310 | | case 200: |
| | 311 | | { |
| 22 | 312 | | DeploymentScript value = default; |
| 22 | 313 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 22 | 314 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 315 | | { |
| 0 | 316 | | value = null; |
| | 317 | | } |
| | 318 | | else |
| | 319 | | { |
| 22 | 320 | | value = DeploymentScript.DeserializeDeploymentScript(document.RootElement); |
| | 321 | | } |
| 22 | 322 | | return Response.FromValue(value, message.Response); |
| | 323 | | } |
| | 324 | | default: |
| 0 | 325 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 326 | | } |
| 22 | 327 | | } |
| | 328 | |
|
| | 329 | | internal Core.HttpMessage CreateDeleteRequest(string resourceGroupName, string scriptName) |
| | 330 | | { |
| 12 | 331 | | var message = _pipeline.CreateMessage(); |
| 12 | 332 | | var request = message.Request; |
| 12 | 333 | | request.Method = RequestMethod.Delete; |
| 12 | 334 | | var uri = new RawRequestUriBuilder(); |
| 12 | 335 | | uri.Reset(endpoint); |
| 12 | 336 | | uri.AppendPath("/subscriptions/", false); |
| 12 | 337 | | uri.AppendPath(subscriptionId, true); |
| 12 | 338 | | uri.AppendPath("/resourcegroups/", false); |
| 12 | 339 | | uri.AppendPath(resourceGroupName, true); |
| 12 | 340 | | uri.AppendPath("/providers/Microsoft.Resources/deploymentScripts/", false); |
| 12 | 341 | | uri.AppendPath(scriptName, true); |
| 12 | 342 | | uri.AppendQuery("api-version", "2019-10-01-preview", true); |
| 12 | 343 | | request.Uri = uri; |
| 12 | 344 | | return message; |
| | 345 | | } |
| | 346 | |
|
| | 347 | | /// <summary> Deletes a deployment script. When operation completes, status code 200 returned without content. < |
| | 348 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 349 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 350 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 351 | | public async Task<Response> DeleteAsync(string resourceGroupName, string scriptName, CancellationToken cancellat |
| | 352 | | { |
| 6 | 353 | | if (resourceGroupName == null) |
| | 354 | | { |
| 0 | 355 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 356 | | } |
| 6 | 357 | | if (scriptName == null) |
| | 358 | | { |
| 0 | 359 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 360 | | } |
| | 361 | |
|
| 6 | 362 | | using var message = CreateDeleteRequest(resourceGroupName, scriptName); |
| 6 | 363 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 6 | 364 | | switch (message.Response.Status) |
| | 365 | | { |
| | 366 | | case 200: |
| | 367 | | case 204: |
| 6 | 368 | | return message.Response; |
| | 369 | | default: |
| 0 | 370 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 371 | | } |
| 6 | 372 | | } |
| | 373 | |
|
| | 374 | | /// <summary> Deletes a deployment script. When operation completes, status code 200 returned without content. < |
| | 375 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 376 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 377 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 378 | | public Response Delete(string resourceGroupName, string scriptName, CancellationToken cancellationToken = defaul |
| | 379 | | { |
| 6 | 380 | | if (resourceGroupName == null) |
| | 381 | | { |
| 0 | 382 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 383 | | } |
| 6 | 384 | | if (scriptName == null) |
| | 385 | | { |
| 0 | 386 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 387 | | } |
| | 388 | |
|
| 6 | 389 | | using var message = CreateDeleteRequest(resourceGroupName, scriptName); |
| 6 | 390 | | _pipeline.Send(message, cancellationToken); |
| 6 | 391 | | switch (message.Response.Status) |
| | 392 | | { |
| | 393 | | case 200: |
| | 394 | | case 204: |
| 6 | 395 | | return message.Response; |
| | 396 | | default: |
| 0 | 397 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 398 | | } |
| 6 | 399 | | } |
| | 400 | |
|
| | 401 | | internal Core.HttpMessage CreateListBySubscriptionRequest() |
| | 402 | | { |
| 8 | 403 | | var message = _pipeline.CreateMessage(); |
| 8 | 404 | | var request = message.Request; |
| 8 | 405 | | request.Method = RequestMethod.Get; |
| 8 | 406 | | var uri = new RawRequestUriBuilder(); |
| 8 | 407 | | uri.Reset(endpoint); |
| 8 | 408 | | uri.AppendPath("/subscriptions/", false); |
| 8 | 409 | | uri.AppendPath(subscriptionId, true); |
| 8 | 410 | | uri.AppendPath("/providers/Microsoft.Resources/deploymentScripts", false); |
| 8 | 411 | | uri.AppendQuery("api-version", "2019-10-01-preview", true); |
| 8 | 412 | | request.Uri = uri; |
| 8 | 413 | | return message; |
| | 414 | | } |
| | 415 | |
|
| | 416 | | /// <summary> Lists all deployment scripts for a given subscription. </summary> |
| | 417 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 418 | | public async Task<Response<DeploymentScriptListResult>> ListBySubscriptionAsync(CancellationToken cancellationTo |
| | 419 | | { |
| 4 | 420 | | using var message = CreateListBySubscriptionRequest(); |
| 4 | 421 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 4 | 422 | | switch (message.Response.Status) |
| | 423 | | { |
| | 424 | | case 200: |
| | 425 | | { |
| 4 | 426 | | DeploymentScriptListResult value = default; |
| 4 | 427 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 4 | 428 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 429 | | { |
| 0 | 430 | | value = null; |
| | 431 | | } |
| | 432 | | else |
| | 433 | | { |
| 4 | 434 | | value = DeploymentScriptListResult.DeserializeDeploymentScriptListResult(document.RootElemen |
| | 435 | | } |
| 4 | 436 | | return Response.FromValue(value, message.Response); |
| | 437 | | } |
| | 438 | | default: |
| 0 | 439 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 440 | | } |
| 4 | 441 | | } |
| | 442 | |
|
| | 443 | | /// <summary> Lists all deployment scripts for a given subscription. </summary> |
| | 444 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 445 | | public Response<DeploymentScriptListResult> ListBySubscription(CancellationToken cancellationToken = default) |
| | 446 | | { |
| 4 | 447 | | using var message = CreateListBySubscriptionRequest(); |
| 4 | 448 | | _pipeline.Send(message, cancellationToken); |
| 4 | 449 | | switch (message.Response.Status) |
| | 450 | | { |
| | 451 | | case 200: |
| | 452 | | { |
| 4 | 453 | | DeploymentScriptListResult value = default; |
| 4 | 454 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 4 | 455 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 456 | | { |
| 0 | 457 | | value = null; |
| | 458 | | } |
| | 459 | | else |
| | 460 | | { |
| 4 | 461 | | value = DeploymentScriptListResult.DeserializeDeploymentScriptListResult(document.RootElemen |
| | 462 | | } |
| 4 | 463 | | return Response.FromValue(value, message.Response); |
| | 464 | | } |
| | 465 | | default: |
| 0 | 466 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 467 | | } |
| 4 | 468 | | } |
| | 469 | |
|
| | 470 | | internal Core.HttpMessage CreateGetLogsRequest(string resourceGroupName, string scriptName) |
| | 471 | | { |
| 0 | 472 | | var message = _pipeline.CreateMessage(); |
| 0 | 473 | | var request = message.Request; |
| 0 | 474 | | request.Method = RequestMethod.Get; |
| 0 | 475 | | var uri = new RawRequestUriBuilder(); |
| 0 | 476 | | uri.Reset(endpoint); |
| 0 | 477 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 478 | | uri.AppendPath(subscriptionId, true); |
| 0 | 479 | | uri.AppendPath("/resourcegroups/", false); |
| 0 | 480 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 481 | | uri.AppendPath("/providers/Microsoft.Resources/deploymentScripts/", false); |
| 0 | 482 | | uri.AppendPath(scriptName, true); |
| 0 | 483 | | uri.AppendPath("/logs", false); |
| 0 | 484 | | uri.AppendQuery("api-version", "2019-10-01-preview", true); |
| 0 | 485 | | request.Uri = uri; |
| 0 | 486 | | return message; |
| | 487 | | } |
| | 488 | |
|
| | 489 | | /// <summary> Gets deployment script logs for a given deployment script name. </summary> |
| | 490 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 491 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 492 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 493 | | public async Task<Response<ScriptLogsList>> GetLogsAsync(string resourceGroupName, string scriptName, Cancellati |
| | 494 | | { |
| 0 | 495 | | if (resourceGroupName == null) |
| | 496 | | { |
| 0 | 497 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 498 | | } |
| 0 | 499 | | if (scriptName == null) |
| | 500 | | { |
| 0 | 501 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 502 | | } |
| | 503 | |
|
| 0 | 504 | | using var message = CreateGetLogsRequest(resourceGroupName, scriptName); |
| 0 | 505 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 506 | | switch (message.Response.Status) |
| | 507 | | { |
| | 508 | | case 200: |
| | 509 | | { |
| 0 | 510 | | ScriptLogsList value = default; |
| 0 | 511 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 512 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 513 | | { |
| 0 | 514 | | value = null; |
| | 515 | | } |
| | 516 | | else |
| | 517 | | { |
| 0 | 518 | | value = ScriptLogsList.DeserializeScriptLogsList(document.RootElement); |
| | 519 | | } |
| 0 | 520 | | return Response.FromValue(value, message.Response); |
| | 521 | | } |
| | 522 | | default: |
| 0 | 523 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 524 | | } |
| 0 | 525 | | } |
| | 526 | |
|
| | 527 | | /// <summary> Gets deployment script logs for a given deployment script name. </summary> |
| | 528 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 529 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 530 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 531 | | public Response<ScriptLogsList> GetLogs(string resourceGroupName, string scriptName, CancellationToken cancellat |
| | 532 | | { |
| 0 | 533 | | if (resourceGroupName == null) |
| | 534 | | { |
| 0 | 535 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 536 | | } |
| 0 | 537 | | if (scriptName == null) |
| | 538 | | { |
| 0 | 539 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 540 | | } |
| | 541 | |
|
| 0 | 542 | | using var message = CreateGetLogsRequest(resourceGroupName, scriptName); |
| 0 | 543 | | _pipeline.Send(message, cancellationToken); |
| 0 | 544 | | switch (message.Response.Status) |
| | 545 | | { |
| | 546 | | case 200: |
| | 547 | | { |
| 0 | 548 | | ScriptLogsList value = default; |
| 0 | 549 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 550 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 551 | | { |
| 0 | 552 | | value = null; |
| | 553 | | } |
| | 554 | | else |
| | 555 | | { |
| 0 | 556 | | value = ScriptLogsList.DeserializeScriptLogsList(document.RootElement); |
| | 557 | | } |
| 0 | 558 | | return Response.FromValue(value, message.Response); |
| | 559 | | } |
| | 560 | | default: |
| 0 | 561 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 562 | | } |
| 0 | 563 | | } |
| | 564 | |
|
| | 565 | | internal Core.HttpMessage CreateGetLogsDefaultRequest(string resourceGroupName, string scriptName, int? tail) |
| | 566 | | { |
| 4 | 567 | | var message = _pipeline.CreateMessage(); |
| 4 | 568 | | var request = message.Request; |
| 4 | 569 | | request.Method = RequestMethod.Get; |
| 4 | 570 | | var uri = new RawRequestUriBuilder(); |
| 4 | 571 | | uri.Reset(endpoint); |
| 4 | 572 | | uri.AppendPath("/subscriptions/", false); |
| 4 | 573 | | uri.AppendPath(subscriptionId, true); |
| 4 | 574 | | uri.AppendPath("/resourcegroups/", false); |
| 4 | 575 | | uri.AppendPath(resourceGroupName, true); |
| 4 | 576 | | uri.AppendPath("/providers/Microsoft.Resources/deploymentScripts/", false); |
| 4 | 577 | | uri.AppendPath(scriptName, true); |
| 4 | 578 | | uri.AppendPath("/logs/default", false); |
| 4 | 579 | | uri.AppendQuery("api-version", "2019-10-01-preview", true); |
| 4 | 580 | | if (tail != null) |
| | 581 | | { |
| 0 | 582 | | uri.AppendQuery("tail", tail.Value, true); |
| | 583 | | } |
| 4 | 584 | | request.Uri = uri; |
| 4 | 585 | | return message; |
| | 586 | | } |
| | 587 | |
|
| | 588 | | /// <summary> Gets deployment script logs for a given deployment script name. </summary> |
| | 589 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 590 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 591 | | /// <param name="tail"> The number of lines to show from the tail of the deployment script log. Valid value is a |
| | 592 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 593 | | public async Task<Response<ScriptLog>> GetLogsDefaultAsync(string resourceGroupName, string scriptName, int? tai |
| | 594 | | { |
| 2 | 595 | | if (resourceGroupName == null) |
| | 596 | | { |
| 0 | 597 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 598 | | } |
| 2 | 599 | | if (scriptName == null) |
| | 600 | | { |
| 0 | 601 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 602 | | } |
| | 603 | |
|
| 2 | 604 | | using var message = CreateGetLogsDefaultRequest(resourceGroupName, scriptName, tail); |
| 2 | 605 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 606 | | switch (message.Response.Status) |
| | 607 | | { |
| | 608 | | case 200: |
| | 609 | | { |
| 2 | 610 | | ScriptLog value = default; |
| 2 | 611 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 2 | 612 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 613 | | { |
| 0 | 614 | | value = null; |
| | 615 | | } |
| | 616 | | else |
| | 617 | | { |
| 2 | 618 | | value = ScriptLog.DeserializeScriptLog(document.RootElement); |
| | 619 | | } |
| 2 | 620 | | return Response.FromValue(value, message.Response); |
| | 621 | | } |
| | 622 | | default: |
| 0 | 623 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 624 | | } |
| 2 | 625 | | } |
| | 626 | |
|
| | 627 | | /// <summary> Gets deployment script logs for a given deployment script name. </summary> |
| | 628 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 629 | | /// <param name="scriptName"> Name of the deployment script. </param> |
| | 630 | | /// <param name="tail"> The number of lines to show from the tail of the deployment script log. Valid value is a |
| | 631 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 632 | | public Response<ScriptLog> GetLogsDefault(string resourceGroupName, string scriptName, int? tail = null, Cancell |
| | 633 | | { |
| 2 | 634 | | if (resourceGroupName == null) |
| | 635 | | { |
| 0 | 636 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 637 | | } |
| 2 | 638 | | if (scriptName == null) |
| | 639 | | { |
| 0 | 640 | | throw new ArgumentNullException(nameof(scriptName)); |
| | 641 | | } |
| | 642 | |
|
| 2 | 643 | | using var message = CreateGetLogsDefaultRequest(resourceGroupName, scriptName, tail); |
| 2 | 644 | | _pipeline.Send(message, cancellationToken); |
| 2 | 645 | | switch (message.Response.Status) |
| | 646 | | { |
| | 647 | | case 200: |
| | 648 | | { |
| 2 | 649 | | ScriptLog value = default; |
| 2 | 650 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 2 | 651 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 652 | | { |
| 0 | 653 | | value = null; |
| | 654 | | } |
| | 655 | | else |
| | 656 | | { |
| 2 | 657 | | value = ScriptLog.DeserializeScriptLog(document.RootElement); |
| | 658 | | } |
| 2 | 659 | | return Response.FromValue(value, message.Response); |
| | 660 | | } |
| | 661 | | default: |
| 0 | 662 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 663 | | } |
| 2 | 664 | | } |
| | 665 | |
|
| | 666 | | internal Core.HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) |
| | 667 | | { |
| 16 | 668 | | var message = _pipeline.CreateMessage(); |
| 16 | 669 | | var request = message.Request; |
| 16 | 670 | | request.Method = RequestMethod.Get; |
| 16 | 671 | | var uri = new RawRequestUriBuilder(); |
| 16 | 672 | | uri.Reset(endpoint); |
| 16 | 673 | | uri.AppendPath("/subscriptions/", false); |
| 16 | 674 | | uri.AppendPath(subscriptionId, true); |
| 16 | 675 | | uri.AppendPath("/resourcegroups/", false); |
| 16 | 676 | | uri.AppendPath(resourceGroupName, true); |
| 16 | 677 | | uri.AppendPath("/providers/Microsoft.Resources/deploymentScripts", false); |
| 16 | 678 | | uri.AppendQuery("api-version", "2019-10-01-preview", true); |
| 16 | 679 | | request.Uri = uri; |
| 16 | 680 | | return message; |
| | 681 | | } |
| | 682 | |
|
| | 683 | | /// <summary> Lists deployments scripts. </summary> |
| | 684 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 685 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 686 | | public async Task<Response<DeploymentScriptListResult>> ListByResourceGroupAsync(string resourceGroupName, Cance |
| | 687 | | { |
| 8 | 688 | | if (resourceGroupName == null) |
| | 689 | | { |
| 0 | 690 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 691 | | } |
| | 692 | |
|
| 8 | 693 | | using var message = CreateListByResourceGroupRequest(resourceGroupName); |
| 8 | 694 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 8 | 695 | | switch (message.Response.Status) |
| | 696 | | { |
| | 697 | | case 200: |
| | 698 | | { |
| 8 | 699 | | DeploymentScriptListResult value = default; |
| 8 | 700 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 8 | 701 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 702 | | { |
| 0 | 703 | | value = null; |
| | 704 | | } |
| | 705 | | else |
| | 706 | | { |
| 8 | 707 | | value = DeploymentScriptListResult.DeserializeDeploymentScriptListResult(document.RootElemen |
| | 708 | | } |
| 8 | 709 | | return Response.FromValue(value, message.Response); |
| | 710 | | } |
| | 711 | | default: |
| 0 | 712 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 713 | | } |
| 8 | 714 | | } |
| | 715 | |
|
| | 716 | | /// <summary> Lists deployments scripts. </summary> |
| | 717 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 718 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 719 | | public Response<DeploymentScriptListResult> ListByResourceGroup(string resourceGroupName, CancellationToken canc |
| | 720 | | { |
| 8 | 721 | | if (resourceGroupName == null) |
| | 722 | | { |
| 0 | 723 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 724 | | } |
| | 725 | |
|
| 8 | 726 | | using var message = CreateListByResourceGroupRequest(resourceGroupName); |
| 8 | 727 | | _pipeline.Send(message, cancellationToken); |
| 8 | 728 | | switch (message.Response.Status) |
| | 729 | | { |
| | 730 | | case 200: |
| | 731 | | { |
| 8 | 732 | | DeploymentScriptListResult value = default; |
| 8 | 733 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 8 | 734 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 735 | | { |
| 0 | 736 | | value = null; |
| | 737 | | } |
| | 738 | | else |
| | 739 | | { |
| 8 | 740 | | value = DeploymentScriptListResult.DeserializeDeploymentScriptListResult(document.RootElemen |
| | 741 | | } |
| 8 | 742 | | return Response.FromValue(value, message.Response); |
| | 743 | | } |
| | 744 | | default: |
| 0 | 745 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 746 | | } |
| 8 | 747 | | } |
| | 748 | |
|
| | 749 | | internal Core.HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink) |
| | 750 | | { |
| 0 | 751 | | var message = _pipeline.CreateMessage(); |
| 0 | 752 | | var request = message.Request; |
| 0 | 753 | | request.Method = RequestMethod.Get; |
| 0 | 754 | | var uri = new RawRequestUriBuilder(); |
| 0 | 755 | | uri.Reset(endpoint); |
| 0 | 756 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 757 | | request.Uri = uri; |
| 0 | 758 | | return message; |
| | 759 | | } |
| | 760 | |
|
| | 761 | | /// <summary> Lists all deployment scripts for a given subscription. </summary> |
| | 762 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 763 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 764 | | public async Task<Response<DeploymentScriptListResult>> ListBySubscriptionNextPageAsync(string nextLink, Cancell |
| | 765 | | { |
| 0 | 766 | | if (nextLink == null) |
| | 767 | | { |
| 0 | 768 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 769 | | } |
| | 770 | |
|
| 0 | 771 | | using var message = CreateListBySubscriptionNextPageRequest(nextLink); |
| 0 | 772 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 773 | | switch (message.Response.Status) |
| | 774 | | { |
| | 775 | | case 200: |
| | 776 | | { |
| 0 | 777 | | DeploymentScriptListResult value = default; |
| 0 | 778 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 779 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 780 | | { |
| 0 | 781 | | value = null; |
| | 782 | | } |
| | 783 | | else |
| | 784 | | { |
| 0 | 785 | | value = DeploymentScriptListResult.DeserializeDeploymentScriptListResult(document.RootElemen |
| | 786 | | } |
| 0 | 787 | | return Response.FromValue(value, message.Response); |
| | 788 | | } |
| | 789 | | default: |
| 0 | 790 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 791 | | } |
| 0 | 792 | | } |
| | 793 | |
|
| | 794 | | /// <summary> Lists all deployment scripts for a given subscription. </summary> |
| | 795 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 796 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 797 | | public Response<DeploymentScriptListResult> ListBySubscriptionNextPage(string nextLink, CancellationToken cancel |
| | 798 | | { |
| 0 | 799 | | if (nextLink == null) |
| | 800 | | { |
| 0 | 801 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 802 | | } |
| | 803 | |
|
| 0 | 804 | | using var message = CreateListBySubscriptionNextPageRequest(nextLink); |
| 0 | 805 | | _pipeline.Send(message, cancellationToken); |
| 0 | 806 | | switch (message.Response.Status) |
| | 807 | | { |
| | 808 | | case 200: |
| | 809 | | { |
| 0 | 810 | | DeploymentScriptListResult value = default; |
| 0 | 811 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 812 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 813 | | { |
| 0 | 814 | | value = null; |
| | 815 | | } |
| | 816 | | else |
| | 817 | | { |
| 0 | 818 | | value = DeploymentScriptListResult.DeserializeDeploymentScriptListResult(document.RootElemen |
| | 819 | | } |
| 0 | 820 | | return Response.FromValue(value, message.Response); |
| | 821 | | } |
| | 822 | | default: |
| 0 | 823 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 824 | | } |
| 0 | 825 | | } |
| | 826 | |
|
| | 827 | | internal Core.HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) |
| | 828 | | { |
| 0 | 829 | | var message = _pipeline.CreateMessage(); |
| 0 | 830 | | var request = message.Request; |
| 0 | 831 | | request.Method = RequestMethod.Get; |
| 0 | 832 | | var uri = new RawRequestUriBuilder(); |
| 0 | 833 | | uri.Reset(endpoint); |
| 0 | 834 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 835 | | request.Uri = uri; |
| 0 | 836 | | return message; |
| | 837 | | } |
| | 838 | |
|
| | 839 | | /// <summary> Lists deployments scripts. </summary> |
| | 840 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 841 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 842 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 843 | | public async Task<Response<DeploymentScriptListResult>> ListByResourceGroupNextPageAsync(string nextLink, string |
| | 844 | | { |
| 0 | 845 | | if (nextLink == null) |
| | 846 | | { |
| 0 | 847 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 848 | | } |
| 0 | 849 | | if (resourceGroupName == null) |
| | 850 | | { |
| 0 | 851 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 852 | | } |
| | 853 | |
|
| 0 | 854 | | using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); |
| 0 | 855 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 856 | | switch (message.Response.Status) |
| | 857 | | { |
| | 858 | | case 200: |
| | 859 | | { |
| 0 | 860 | | DeploymentScriptListResult value = default; |
| 0 | 861 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 862 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 863 | | { |
| 0 | 864 | | value = null; |
| | 865 | | } |
| | 866 | | else |
| | 867 | | { |
| 0 | 868 | | value = DeploymentScriptListResult.DeserializeDeploymentScriptListResult(document.RootElemen |
| | 869 | | } |
| 0 | 870 | | return Response.FromValue(value, message.Response); |
| | 871 | | } |
| | 872 | | default: |
| 0 | 873 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 874 | | } |
| 0 | 875 | | } |
| | 876 | |
|
| | 877 | | /// <summary> Lists deployments scripts. </summary> |
| | 878 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 879 | | /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param> |
| | 880 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 881 | | public Response<DeploymentScriptListResult> ListByResourceGroupNextPage(string nextLink, string resourceGroupNam |
| | 882 | | { |
| 0 | 883 | | if (nextLink == null) |
| | 884 | | { |
| 0 | 885 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 886 | | } |
| 0 | 887 | | if (resourceGroupName == null) |
| | 888 | | { |
| 0 | 889 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 890 | | } |
| | 891 | |
|
| 0 | 892 | | using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); |
| 0 | 893 | | _pipeline.Send(message, cancellationToken); |
| 0 | 894 | | switch (message.Response.Status) |
| | 895 | | { |
| | 896 | | case 200: |
| | 897 | | { |
| 0 | 898 | | DeploymentScriptListResult value = default; |
| 0 | 899 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 900 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 901 | | { |
| 0 | 902 | | value = null; |
| | 903 | | } |
| | 904 | | else |
| | 905 | | { |
| 0 | 906 | | value = DeploymentScriptListResult.DeserializeDeploymentScriptListResult(document.RootElemen |
| | 907 | | } |
| 0 | 908 | | return Response.FromValue(value, message.Response); |
| | 909 | | } |
| | 910 | | default: |
| 0 | 911 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 912 | | } |
| 0 | 913 | | } |
| | 914 | | } |
| | 915 | | } |