| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // This file was automatically generated. Do not edit. |
| | 5 | |
|
| | 6 | | #pragma warning disable IDE0016 // Null check can be simplified |
| | 7 | | #pragma warning disable IDE0017 // Variable declaration can be inlined |
| | 8 | | #pragma warning disable IDE0018 // Object initialization can be simplified |
| | 9 | | #pragma warning disable SA1402 // File may only contain a single type |
| | 10 | |
|
| | 11 | | #region Service |
| | 12 | | namespace Azure.Storage.Queues |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Azure Queue Storage |
| | 16 | | /// </summary> |
| | 17 | | internal static partial class QueueRestClient |
| | 18 | | { |
| | 19 | | #region Service operations |
| | 20 | | /// <summary> |
| | 21 | | /// Service operations for Azure Queue Storage |
| | 22 | | /// </summary> |
| | 23 | | public static partial class Service |
| | 24 | | { |
| | 25 | | #region Service.SetPropertiesAsync |
| | 26 | | /// <summary> |
| | 27 | | /// Sets properties for a storage account's Queue service endpoint, including properties for Storage Analyti |
| | 28 | | /// </summary> |
| | 29 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 30 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 31 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 32 | | /// <param name="properties">The StorageService properties.</param> |
| | 33 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 34 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 35 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 36 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 37 | | /// <param name="operationName">Operation name.</param> |
| | 38 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 39 | | /// <returns>Azure.Response</returns> |
| | 40 | | public static async System.Threading.Tasks.ValueTask<Azure.Response> SetPropertiesAsync( |
| | 41 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 42 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 43 | | System.Uri resourceUri, |
| | 44 | | Azure.Storage.Queues.Models.QueueServiceProperties properties, |
| | 45 | | string version, |
| | 46 | | int? timeout = default, |
| | 47 | | string requestId = default, |
| | 48 | | bool async = true, |
| | 49 | | string operationName = "ServiceClient.SetProperties", |
| | 50 | | System.Threading.CancellationToken cancellationToken = default) |
| | 51 | | { |
| | 52 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 53 | | try |
| | 54 | | { |
| | 55 | | _scope.AddAttribute("url", resourceUri); |
| | 56 | | _scope.Start(); |
| | 57 | | using (Azure.Core.HttpMessage _message = SetPropertiesAsync_CreateMessage( |
| | 58 | | pipeline, |
| | 59 | | resourceUri, |
| | 60 | | properties, |
| | 61 | | version, |
| | 62 | | timeout, |
| | 63 | | requestId)) |
| | 64 | | { |
| | 65 | | if (async) |
| | 66 | | { |
| | 67 | | // Send the request asynchronously if we're being called via an async path |
| | 68 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 69 | | } |
| | 70 | | else |
| | 71 | | { |
| | 72 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 73 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 74 | | pipeline.Send(_message, cancellationToken); |
| | 75 | | } |
| | 76 | | Azure.Response _response = _message.Response; |
| | 77 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 78 | | return SetPropertiesAsync_CreateResponse(clientDiagnostics, _response); |
| | 79 | | } |
| | 80 | | } |
| | 81 | | catch (System.Exception ex) |
| | 82 | | { |
| | 83 | | _scope.Failed(ex); |
| | 84 | | throw; |
| | 85 | | } |
| | 86 | | finally |
| | 87 | | { |
| | 88 | | _scope.Dispose(); |
| | 89 | | } |
| | 90 | | } |
| | 91 | |
|
| | 92 | | /// <summary> |
| | 93 | | /// Create the Service.SetPropertiesAsync request. |
| | 94 | | /// </summary> |
| | 95 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 96 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 97 | | /// <param name="properties">The StorageService properties.</param> |
| | 98 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 99 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 100 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 101 | | /// <returns>The Service.SetPropertiesAsync Message.</returns> |
| | 102 | | internal static Azure.Core.HttpMessage SetPropertiesAsync_CreateMessage( |
| | 103 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 104 | | System.Uri resourceUri, |
| | 105 | | Azure.Storage.Queues.Models.QueueServiceProperties properties, |
| | 106 | | string version, |
| | 107 | | int? timeout = default, |
| | 108 | | string requestId = default) |
| | 109 | | { |
| | 110 | | // Validation |
| | 111 | | if (resourceUri == null) |
| | 112 | | { |
| | 113 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 114 | | } |
| | 115 | | if (properties == null) |
| | 116 | | { |
| | 117 | | throw new System.ArgumentNullException(nameof(properties)); |
| | 118 | | } |
| | 119 | | if (version == null) |
| | 120 | | { |
| | 121 | | throw new System.ArgumentNullException(nameof(version)); |
| | 122 | | } |
| | 123 | |
|
| | 124 | | // Create the request |
| | 125 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 126 | | Azure.Core.Request _request = _message.Request; |
| | 127 | |
|
| | 128 | | // Set the endpoint |
| | 129 | | _request.Method = Azure.Core.RequestMethod.Put; |
| | 130 | | _request.Uri.Reset(resourceUri); |
| | 131 | | _request.Uri.AppendQuery("restype", "service", escapeValue: false); |
| | 132 | | _request.Uri.AppendQuery("comp", "properties", escapeValue: false); |
| | 133 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 134 | |
|
| | 135 | | // Add request headers |
| | 136 | | _request.Headers.SetValue("x-ms-version", version); |
| | 137 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 138 | |
|
| | 139 | | // Create the body |
| | 140 | | System.Xml.Linq.XElement _body = Azure.Storage.Queues.Models.QueueServiceProperties.ToXml(properties, "S |
| | 141 | | string _text = _body.ToString(System.Xml.Linq.SaveOptions.DisableFormatting); |
| | 142 | | _request.Headers.SetValue("Content-Type", "application/xml"); |
| | 143 | | _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.Invar |
| | 144 | | _request.Content = Azure.Core.RequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text)); |
| | 145 | |
|
| | 146 | | return _message; |
| | 147 | | } |
| | 148 | |
|
| | 149 | | /// <summary> |
| | 150 | | /// Create the Service.SetPropertiesAsync response or throw a failure exception. |
| | 151 | | /// </summary> |
| | 152 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 153 | | /// <param name="response">The raw Response.</param> |
| | 154 | | /// <returns>The Service.SetPropertiesAsync Azure.Response.</returns> |
| | 155 | | internal static Azure.Response SetPropertiesAsync_CreateResponse( |
| | 156 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 157 | | Azure.Response response) |
| | 158 | | { |
| | 159 | | // Process the response |
| | 160 | | switch (response.Status) |
| | 161 | | { |
| | 162 | | case 202: |
| | 163 | | { |
| | 164 | | return response; |
| | 165 | | } |
| | 166 | | default: |
| | 167 | | { |
| | 168 | | // Create the result |
| | 169 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 170 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 171 | |
|
| | 172 | | throw _value.CreateException(clientDiagnostics, response); |
| | 173 | | } |
| | 174 | | } |
| | 175 | | } |
| | 176 | | #endregion Service.SetPropertiesAsync |
| | 177 | |
|
| | 178 | | #region Service.GetPropertiesAsync |
| | 179 | | /// <summary> |
| | 180 | | /// gets the properties of a storage account's Queue service, including properties for Storage Analytics and |
| | 181 | | /// </summary> |
| | 182 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 183 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 184 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 185 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 186 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 187 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 188 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 189 | | /// <param name="operationName">Operation name.</param> |
| | 190 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 191 | | /// <returns>Storage Service Properties.</returns> |
| | 192 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Queues.Models.QueueService |
| | 193 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 194 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 195 | | System.Uri resourceUri, |
| | 196 | | string version, |
| | 197 | | int? timeout = default, |
| | 198 | | string requestId = default, |
| | 199 | | bool async = true, |
| | 200 | | string operationName = "ServiceClient.GetProperties", |
| | 201 | | System.Threading.CancellationToken cancellationToken = default) |
| | 202 | | { |
| | 203 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 204 | | try |
| | 205 | | { |
| | 206 | | _scope.AddAttribute("url", resourceUri); |
| | 207 | | _scope.Start(); |
| | 208 | | using (Azure.Core.HttpMessage _message = GetPropertiesAsync_CreateMessage( |
| | 209 | | pipeline, |
| | 210 | | resourceUri, |
| | 211 | | version, |
| | 212 | | timeout, |
| | 213 | | requestId)) |
| | 214 | | { |
| | 215 | | if (async) |
| | 216 | | { |
| | 217 | | // Send the request asynchronously if we're being called via an async path |
| | 218 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 219 | | } |
| | 220 | | else |
| | 221 | | { |
| | 222 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 223 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 224 | | pipeline.Send(_message, cancellationToken); |
| | 225 | | } |
| | 226 | | Azure.Response _response = _message.Response; |
| | 227 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 228 | | return GetPropertiesAsync_CreateResponse(clientDiagnostics, _response); |
| | 229 | | } |
| | 230 | | } |
| | 231 | | catch (System.Exception ex) |
| | 232 | | { |
| | 233 | | _scope.Failed(ex); |
| | 234 | | throw; |
| | 235 | | } |
| | 236 | | finally |
| | 237 | | { |
| | 238 | | _scope.Dispose(); |
| | 239 | | } |
| | 240 | | } |
| | 241 | |
|
| | 242 | | /// <summary> |
| | 243 | | /// Create the Service.GetPropertiesAsync request. |
| | 244 | | /// </summary> |
| | 245 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 246 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 247 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 248 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 249 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 250 | | /// <returns>The Service.GetPropertiesAsync Message.</returns> |
| | 251 | | internal static Azure.Core.HttpMessage GetPropertiesAsync_CreateMessage( |
| | 252 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 253 | | System.Uri resourceUri, |
| | 254 | | string version, |
| | 255 | | int? timeout = default, |
| | 256 | | string requestId = default) |
| | 257 | | { |
| | 258 | | // Validation |
| | 259 | | if (resourceUri == null) |
| | 260 | | { |
| | 261 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 262 | | } |
| | 263 | | if (version == null) |
| | 264 | | { |
| | 265 | | throw new System.ArgumentNullException(nameof(version)); |
| | 266 | | } |
| | 267 | |
|
| | 268 | | // Create the request |
| | 269 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 270 | | Azure.Core.Request _request = _message.Request; |
| | 271 | |
|
| | 272 | | // Set the endpoint |
| | 273 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 274 | | _request.Uri.Reset(resourceUri); |
| | 275 | | _request.Uri.AppendQuery("restype", "service", escapeValue: false); |
| | 276 | | _request.Uri.AppendQuery("comp", "properties", escapeValue: false); |
| | 277 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 278 | |
|
| | 279 | | // Add request headers |
| | 280 | | _request.Headers.SetValue("x-ms-version", version); |
| | 281 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 282 | |
|
| | 283 | | return _message; |
| | 284 | | } |
| | 285 | |
|
| | 286 | | /// <summary> |
| | 287 | | /// Create the Service.GetPropertiesAsync response or throw a failure exception. |
| | 288 | | /// </summary> |
| | 289 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 290 | | /// <param name="response">The raw Response.</param> |
| | 291 | | /// <returns>The Service.GetPropertiesAsync Azure.Response{Azure.Storage.Queues.Models.QueueServicePropertie |
| | 292 | | internal static Azure.Response<Azure.Storage.Queues.Models.QueueServiceProperties> GetPropertiesAsync_Create |
| | 293 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 294 | | Azure.Response response) |
| | 295 | | { |
| | 296 | | // Process the response |
| | 297 | | switch (response.Status) |
| | 298 | | { |
| | 299 | | case 200: |
| | 300 | | { |
| | 301 | | // Create the result |
| | 302 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 303 | | Azure.Storage.Queues.Models.QueueServiceProperties _value = Azure.Storage.Queues.Models.QueueSer |
| | 304 | |
|
| | 305 | | // Create the response |
| | 306 | | return Response.FromValue(_value, response); |
| | 307 | | } |
| | 308 | | case 304: |
| | 309 | | { |
| | 310 | | return new Azure.NoBodyResponse<Azure.Storage.Queues.Models.QueueServiceProperties>(response); |
| | 311 | | } |
| | 312 | | default: |
| | 313 | | { |
| | 314 | | // Create the result |
| | 315 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 316 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 317 | |
|
| | 318 | | throw _value.CreateException(clientDiagnostics, response); |
| | 319 | | } |
| | 320 | | } |
| | 321 | | } |
| | 322 | | #endregion Service.GetPropertiesAsync |
| | 323 | |
|
| | 324 | | #region Service.GetStatisticsAsync |
| | 325 | | /// <summary> |
| | 326 | | /// Retrieves statistics related to replication for the Queue service. It is only available on the secondary |
| | 327 | | /// </summary> |
| | 328 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 329 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 330 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 331 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 332 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 333 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 334 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 335 | | /// <param name="operationName">Operation name.</param> |
| | 336 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 337 | | /// <returns>Statistics for the storage service.</returns> |
| | 338 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Queues.Models.QueueService |
| | 339 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 340 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 341 | | System.Uri resourceUri, |
| | 342 | | string version, |
| | 343 | | int? timeout = default, |
| | 344 | | string requestId = default, |
| | 345 | | bool async = true, |
| | 346 | | string operationName = "ServiceClient.GetStatistics", |
| | 347 | | System.Threading.CancellationToken cancellationToken = default) |
| | 348 | | { |
| | 349 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 350 | | try |
| | 351 | | { |
| | 352 | | _scope.AddAttribute("url", resourceUri); |
| | 353 | | _scope.Start(); |
| | 354 | | using (Azure.Core.HttpMessage _message = GetStatisticsAsync_CreateMessage( |
| | 355 | | pipeline, |
| | 356 | | resourceUri, |
| | 357 | | version, |
| | 358 | | timeout, |
| | 359 | | requestId)) |
| | 360 | | { |
| | 361 | | if (async) |
| | 362 | | { |
| | 363 | | // Send the request asynchronously if we're being called via an async path |
| | 364 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 365 | | } |
| | 366 | | else |
| | 367 | | { |
| | 368 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 369 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 370 | | pipeline.Send(_message, cancellationToken); |
| | 371 | | } |
| | 372 | | Azure.Response _response = _message.Response; |
| | 373 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 374 | | return GetStatisticsAsync_CreateResponse(clientDiagnostics, _response); |
| | 375 | | } |
| | 376 | | } |
| | 377 | | catch (System.Exception ex) |
| | 378 | | { |
| | 379 | | _scope.Failed(ex); |
| | 380 | | throw; |
| | 381 | | } |
| | 382 | | finally |
| | 383 | | { |
| | 384 | | _scope.Dispose(); |
| | 385 | | } |
| | 386 | | } |
| | 387 | |
|
| | 388 | | /// <summary> |
| | 389 | | /// Create the Service.GetStatisticsAsync request. |
| | 390 | | /// </summary> |
| | 391 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 392 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 393 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 394 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 395 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 396 | | /// <returns>The Service.GetStatisticsAsync Message.</returns> |
| | 397 | | internal static Azure.Core.HttpMessage GetStatisticsAsync_CreateMessage( |
| | 398 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 399 | | System.Uri resourceUri, |
| | 400 | | string version, |
| | 401 | | int? timeout = default, |
| | 402 | | string requestId = default) |
| | 403 | | { |
| | 404 | | // Validation |
| | 405 | | if (resourceUri == null) |
| | 406 | | { |
| | 407 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 408 | | } |
| | 409 | | if (version == null) |
| | 410 | | { |
| | 411 | | throw new System.ArgumentNullException(nameof(version)); |
| | 412 | | } |
| | 413 | |
|
| | 414 | | // Create the request |
| | 415 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 416 | | Azure.Core.Request _request = _message.Request; |
| | 417 | |
|
| | 418 | | // Set the endpoint |
| | 419 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 420 | | _request.Uri.Reset(resourceUri); |
| | 421 | | _request.Uri.AppendQuery("restype", "service", escapeValue: false); |
| | 422 | | _request.Uri.AppendQuery("comp", "stats", escapeValue: false); |
| | 423 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 424 | |
|
| | 425 | | // Add request headers |
| | 426 | | _request.Headers.SetValue("x-ms-version", version); |
| | 427 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 428 | |
|
| | 429 | | return _message; |
| | 430 | | } |
| | 431 | |
|
| | 432 | | /// <summary> |
| | 433 | | /// Create the Service.GetStatisticsAsync response or throw a failure exception. |
| | 434 | | /// </summary> |
| | 435 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 436 | | /// <param name="response">The raw Response.</param> |
| | 437 | | /// <returns>The Service.GetStatisticsAsync Azure.Response{Azure.Storage.Queues.Models.QueueServiceStatistic |
| | 438 | | internal static Azure.Response<Azure.Storage.Queues.Models.QueueServiceStatistics> GetStatisticsAsync_Create |
| | 439 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 440 | | Azure.Response response) |
| | 441 | | { |
| | 442 | | // Process the response |
| | 443 | | switch (response.Status) |
| | 444 | | { |
| | 445 | | case 200: |
| | 446 | | { |
| | 447 | | // Create the result |
| | 448 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 449 | | Azure.Storage.Queues.Models.QueueServiceStatistics _value = Azure.Storage.Queues.Models.QueueSer |
| | 450 | |
|
| | 451 | | // Create the response |
| | 452 | | return Response.FromValue(_value, response); |
| | 453 | | } |
| | 454 | | case 304: |
| | 455 | | { |
| | 456 | | return new Azure.NoBodyResponse<Azure.Storage.Queues.Models.QueueServiceStatistics>(response); |
| | 457 | | } |
| | 458 | | default: |
| | 459 | | { |
| | 460 | | // Create the result |
| | 461 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 462 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 463 | |
|
| | 464 | | throw _value.CreateException(clientDiagnostics, response); |
| | 465 | | } |
| | 466 | | } |
| | 467 | | } |
| | 468 | | #endregion Service.GetStatisticsAsync |
| | 469 | |
|
| | 470 | | #region Service.ListQueuesSegmentAsync |
| | 471 | | /// <summary> |
| | 472 | | /// The List Queues Segment operation returns a list of the queues under the specified account |
| | 473 | | /// </summary> |
| | 474 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 475 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 476 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 477 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 478 | | /// <param name="prefix">Filters the results to return only queues whose name begins with the specified pref |
| | 479 | | /// <param name="marker">A string value that identifies the portion of the list of queues to be returned wit |
| | 480 | | /// <param name="maxresults">Specifies the maximum number of queues to return. If the request does not speci |
| | 481 | | /// <param name="include">Include this parameter to specify that the queues's metadata be returned as part o |
| | 482 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 483 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 484 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 485 | | /// <param name="operationName">Operation name.</param> |
| | 486 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 487 | | /// <returns>The object returned when calling List Queues on a Queue Service.</returns> |
| | 488 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Queues.Models.QueuesSegmen |
| | 489 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 490 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 491 | | System.Uri resourceUri, |
| | 492 | | string version, |
| | 493 | | string prefix = default, |
| | 494 | | string marker = default, |
| | 495 | | int? maxresults = default, |
| | 496 | | System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.ListQueuesIncludeType> include = defa |
| | 497 | | int? timeout = default, |
| | 498 | | string requestId = default, |
| | 499 | | bool async = true, |
| | 500 | | string operationName = "ServiceClient.ListQueuesSegment", |
| | 501 | | System.Threading.CancellationToken cancellationToken = default) |
| | 502 | | { |
| | 503 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 504 | | try |
| | 505 | | { |
| | 506 | | _scope.AddAttribute("url", resourceUri); |
| | 507 | | _scope.Start(); |
| | 508 | | using (Azure.Core.HttpMessage _message = ListQueuesSegmentAsync_CreateMessage( |
| | 509 | | pipeline, |
| | 510 | | resourceUri, |
| | 511 | | version, |
| | 512 | | prefix, |
| | 513 | | marker, |
| | 514 | | maxresults, |
| | 515 | | include, |
| | 516 | | timeout, |
| | 517 | | requestId)) |
| | 518 | | { |
| | 519 | | if (async) |
| | 520 | | { |
| | 521 | | // Send the request asynchronously if we're being called via an async path |
| | 522 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 523 | | } |
| | 524 | | else |
| | 525 | | { |
| | 526 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 527 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 528 | | pipeline.Send(_message, cancellationToken); |
| | 529 | | } |
| | 530 | | Azure.Response _response = _message.Response; |
| | 531 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 532 | | return ListQueuesSegmentAsync_CreateResponse(clientDiagnostics, _response); |
| | 533 | | } |
| | 534 | | } |
| | 535 | | catch (System.Exception ex) |
| | 536 | | { |
| | 537 | | _scope.Failed(ex); |
| | 538 | | throw; |
| | 539 | | } |
| | 540 | | finally |
| | 541 | | { |
| | 542 | | _scope.Dispose(); |
| | 543 | | } |
| | 544 | | } |
| | 545 | |
|
| | 546 | | /// <summary> |
| | 547 | | /// Create the Service.ListQueuesSegmentAsync request. |
| | 548 | | /// </summary> |
| | 549 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 550 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 551 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 552 | | /// <param name="prefix">Filters the results to return only queues whose name begins with the specified pref |
| | 553 | | /// <param name="marker">A string value that identifies the portion of the list of queues to be returned wit |
| | 554 | | /// <param name="maxresults">Specifies the maximum number of queues to return. If the request does not speci |
| | 555 | | /// <param name="include">Include this parameter to specify that the queues's metadata be returned as part o |
| | 556 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 557 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 558 | | /// <returns>The Service.ListQueuesSegmentAsync Message.</returns> |
| | 559 | | internal static Azure.Core.HttpMessage ListQueuesSegmentAsync_CreateMessage( |
| | 560 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 561 | | System.Uri resourceUri, |
| | 562 | | string version, |
| | 563 | | string prefix = default, |
| | 564 | | string marker = default, |
| | 565 | | int? maxresults = default, |
| | 566 | | System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.ListQueuesIncludeType> include = defa |
| | 567 | | int? timeout = default, |
| | 568 | | string requestId = default) |
| | 569 | | { |
| | 570 | | // Validation |
| | 571 | | if (resourceUri == null) |
| | 572 | | { |
| | 573 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 574 | | } |
| | 575 | | if (version == null) |
| | 576 | | { |
| | 577 | | throw new System.ArgumentNullException(nameof(version)); |
| | 578 | | } |
| | 579 | |
|
| | 580 | | // Create the request |
| | 581 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 582 | | Azure.Core.Request _request = _message.Request; |
| | 583 | |
|
| | 584 | | // Set the endpoint |
| | 585 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 586 | | _request.Uri.Reset(resourceUri); |
| | 587 | | _request.Uri.AppendQuery("comp", "list", escapeValue: false); |
| | 588 | | if (prefix != null) { _request.Uri.AppendQuery("prefix", prefix); } |
| | 589 | | if (marker != null) { _request.Uri.AppendQuery("marker", marker); } |
| | 590 | | if (maxresults != null) { _request.Uri.AppendQuery("maxresults", maxresults.Value.ToString(System.Global |
| | 591 | | if (include != null) { _request.Uri.AppendQuery("include", string.Join(",", System.Linq.Enumerable.Selec |
| | 592 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 593 | |
|
| | 594 | | // Add request headers |
| | 595 | | _request.Headers.SetValue("x-ms-version", version); |
| | 596 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 597 | |
|
| | 598 | | return _message; |
| | 599 | | } |
| | 600 | |
|
| | 601 | | /// <summary> |
| | 602 | | /// Create the Service.ListQueuesSegmentAsync response or throw a failure exception. |
| | 603 | | /// </summary> |
| | 604 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 605 | | /// <param name="response">The raw Response.</param> |
| | 606 | | /// <returns>The Service.ListQueuesSegmentAsync Azure.Response{Azure.Storage.Queues.Models.QueuesSegment}.</ |
| | 607 | | internal static Azure.Response<Azure.Storage.Queues.Models.QueuesSegment> ListQueuesSegmentAsync_CreateRespo |
| | 608 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 609 | | Azure.Response response) |
| | 610 | | { |
| | 611 | | // Process the response |
| | 612 | | switch (response.Status) |
| | 613 | | { |
| | 614 | | case 200: |
| | 615 | | { |
| | 616 | | // Create the result |
| | 617 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 618 | | Azure.Storage.Queues.Models.QueuesSegment _value = Azure.Storage.Queues.Models.QueuesSegment.Fro |
| | 619 | |
|
| | 620 | | // Create the response |
| | 621 | | return Response.FromValue(_value, response); |
| | 622 | | } |
| | 623 | | case 304: |
| | 624 | | { |
| | 625 | | return new Azure.NoBodyResponse<Azure.Storage.Queues.Models.QueuesSegment>(response); |
| | 626 | | } |
| | 627 | | default: |
| | 628 | | { |
| | 629 | | // Create the result |
| | 630 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 631 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 632 | |
|
| | 633 | | throw _value.CreateException(clientDiagnostics, response); |
| | 634 | | } |
| | 635 | | } |
| | 636 | | } |
| | 637 | | #endregion Service.ListQueuesSegmentAsync |
| | 638 | | } |
| | 639 | | #endregion Service operations |
| | 640 | |
|
| | 641 | | #region Queue operations |
| | 642 | | /// <summary> |
| | 643 | | /// Queue operations for Azure Queue Storage |
| | 644 | | /// </summary> |
| | 645 | | public static partial class Queue |
| | 646 | | { |
| | 647 | | #region Queue.CreateAsync |
| | 648 | | /// <summary> |
| | 649 | | /// creates a new queue under the given account. |
| | 650 | | /// </summary> |
| | 651 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 652 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 653 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 654 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 655 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 656 | | /// <param name="metadata">Optional. Include this parameter to specify that the queue's metadata be returned |
| | 657 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 658 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 659 | | /// <param name="operationName">Operation name.</param> |
| | 660 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 661 | | /// <returns>Azure.Response</returns> |
| | 662 | | public static async System.Threading.Tasks.ValueTask<Azure.Response> CreateAsync( |
| | 663 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 664 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 665 | | System.Uri resourceUri, |
| | 666 | | string version, |
| | 667 | | int? timeout = default, |
| | 668 | | System.Collections.Generic.IDictionary<string, string> metadata = default, |
| | 669 | | string requestId = default, |
| | 670 | | bool async = true, |
| | 671 | | string operationName = "QueueClient.Create", |
| | 672 | | System.Threading.CancellationToken cancellationToken = default) |
| | 673 | | { |
| | 674 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 675 | | try |
| | 676 | | { |
| | 677 | | _scope.AddAttribute("url", resourceUri); |
| | 678 | | _scope.Start(); |
| | 679 | | using (Azure.Core.HttpMessage _message = CreateAsync_CreateMessage( |
| | 680 | | pipeline, |
| | 681 | | resourceUri, |
| | 682 | | version, |
| | 683 | | timeout, |
| | 684 | | metadata, |
| | 685 | | requestId)) |
| | 686 | | { |
| | 687 | | if (async) |
| | 688 | | { |
| | 689 | | // Send the request asynchronously if we're being called via an async path |
| | 690 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 691 | | } |
| | 692 | | else |
| | 693 | | { |
| | 694 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 695 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 696 | | pipeline.Send(_message, cancellationToken); |
| | 697 | | } |
| | 698 | | Azure.Response _response = _message.Response; |
| | 699 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 700 | | return CreateAsync_CreateResponse(clientDiagnostics, _response); |
| | 701 | | } |
| | 702 | | } |
| | 703 | | catch (System.Exception ex) |
| | 704 | | { |
| | 705 | | _scope.Failed(ex); |
| | 706 | | throw; |
| | 707 | | } |
| | 708 | | finally |
| | 709 | | { |
| | 710 | | _scope.Dispose(); |
| | 711 | | } |
| | 712 | | } |
| | 713 | |
|
| | 714 | | /// <summary> |
| | 715 | | /// Create the Queue.CreateAsync request. |
| | 716 | | /// </summary> |
| | 717 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 718 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 719 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 720 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 721 | | /// <param name="metadata">Optional. Include this parameter to specify that the queue's metadata be returned |
| | 722 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 723 | | /// <returns>The Queue.CreateAsync Message.</returns> |
| | 724 | | internal static Azure.Core.HttpMessage CreateAsync_CreateMessage( |
| | 725 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 726 | | System.Uri resourceUri, |
| | 727 | | string version, |
| | 728 | | int? timeout = default, |
| | 729 | | System.Collections.Generic.IDictionary<string, string> metadata = default, |
| | 730 | | string requestId = default) |
| | 731 | | { |
| | 732 | | // Validation |
| | 733 | | if (resourceUri == null) |
| | 734 | | { |
| | 735 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 736 | | } |
| | 737 | | if (version == null) |
| | 738 | | { |
| | 739 | | throw new System.ArgumentNullException(nameof(version)); |
| | 740 | | } |
| | 741 | |
|
| | 742 | | // Create the request |
| | 743 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 744 | | Azure.Core.Request _request = _message.Request; |
| | 745 | |
|
| | 746 | | // Set the endpoint |
| | 747 | | _request.Method = Azure.Core.RequestMethod.Put; |
| | 748 | | _request.Uri.Reset(resourceUri); |
| | 749 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 750 | |
|
| | 751 | | // Add request headers |
| | 752 | | _request.Headers.SetValue("x-ms-version", version); |
| | 753 | | if (metadata != null) { |
| | 754 | | foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata) |
| | 755 | | { |
| | 756 | | _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); |
| | 757 | | } |
| | 758 | | } |
| | 759 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 760 | |
|
| | 761 | | return _message; |
| | 762 | | } |
| | 763 | |
|
| | 764 | | /// <summary> |
| | 765 | | /// Create the Queue.CreateAsync response or throw a failure exception. |
| | 766 | | /// </summary> |
| | 767 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 768 | | /// <param name="response">The raw Response.</param> |
| | 769 | | /// <returns>The Queue.CreateAsync Azure.Response.</returns> |
| | 770 | | internal static Azure.Response CreateAsync_CreateResponse( |
| | 771 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 772 | | Azure.Response response) |
| | 773 | | { |
| | 774 | | // Process the response |
| | 775 | | switch (response.Status) |
| | 776 | | { |
| | 777 | | case 201: |
| | 778 | | { |
| | 779 | | return response; |
| | 780 | | } |
| | 781 | | case 204: |
| | 782 | | { |
| | 783 | | return response; |
| | 784 | | } |
| | 785 | | default: |
| | 786 | | { |
| | 787 | | // Create the result |
| | 788 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 789 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 790 | |
|
| | 791 | | throw _value.CreateException(clientDiagnostics, response); |
| | 792 | | } |
| | 793 | | } |
| | 794 | | } |
| | 795 | | #endregion Queue.CreateAsync |
| | 796 | |
|
| | 797 | | #region Queue.DeleteAsync |
| | 798 | | /// <summary> |
| | 799 | | /// operation permanently deletes the specified queue |
| | 800 | | /// </summary> |
| | 801 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 802 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 803 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 804 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 805 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 806 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 807 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 808 | | /// <param name="operationName">Operation name.</param> |
| | 809 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 810 | | /// <returns>Azure.Response</returns> |
| | 811 | | public static async System.Threading.Tasks.ValueTask<Azure.Response> DeleteAsync( |
| | 812 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 813 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 814 | | System.Uri resourceUri, |
| | 815 | | string version, |
| | 816 | | int? timeout = default, |
| | 817 | | string requestId = default, |
| | 818 | | bool async = true, |
| | 819 | | string operationName = "QueueClient.Delete", |
| | 820 | | System.Threading.CancellationToken cancellationToken = default) |
| | 821 | | { |
| | 822 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 823 | | try |
| | 824 | | { |
| | 825 | | _scope.AddAttribute("url", resourceUri); |
| | 826 | | _scope.Start(); |
| | 827 | | using (Azure.Core.HttpMessage _message = DeleteAsync_CreateMessage( |
| | 828 | | pipeline, |
| | 829 | | resourceUri, |
| | 830 | | version, |
| | 831 | | timeout, |
| | 832 | | requestId)) |
| | 833 | | { |
| | 834 | | if (async) |
| | 835 | | { |
| | 836 | | // Send the request asynchronously if we're being called via an async path |
| | 837 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 838 | | } |
| | 839 | | else |
| | 840 | | { |
| | 841 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 842 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 843 | | pipeline.Send(_message, cancellationToken); |
| | 844 | | } |
| | 845 | | Azure.Response _response = _message.Response; |
| | 846 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 847 | | return DeleteAsync_CreateResponse(clientDiagnostics, _response); |
| | 848 | | } |
| | 849 | | } |
| | 850 | | catch (System.Exception ex) |
| | 851 | | { |
| | 852 | | _scope.Failed(ex); |
| | 853 | | throw; |
| | 854 | | } |
| | 855 | | finally |
| | 856 | | { |
| | 857 | | _scope.Dispose(); |
| | 858 | | } |
| | 859 | | } |
| | 860 | |
|
| | 861 | | /// <summary> |
| | 862 | | /// Create the Queue.DeleteAsync request. |
| | 863 | | /// </summary> |
| | 864 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 865 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 866 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 867 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 868 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 869 | | /// <returns>The Queue.DeleteAsync Message.</returns> |
| | 870 | | internal static Azure.Core.HttpMessage DeleteAsync_CreateMessage( |
| | 871 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 872 | | System.Uri resourceUri, |
| | 873 | | string version, |
| | 874 | | int? timeout = default, |
| | 875 | | string requestId = default) |
| | 876 | | { |
| | 877 | | // Validation |
| | 878 | | if (resourceUri == null) |
| | 879 | | { |
| | 880 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 881 | | } |
| | 882 | | if (version == null) |
| | 883 | | { |
| | 884 | | throw new System.ArgumentNullException(nameof(version)); |
| | 885 | | } |
| | 886 | |
|
| | 887 | | // Create the request |
| | 888 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 889 | | Azure.Core.Request _request = _message.Request; |
| | 890 | |
|
| | 891 | | // Set the endpoint |
| | 892 | | _request.Method = Azure.Core.RequestMethod.Delete; |
| | 893 | | _request.Uri.Reset(resourceUri); |
| | 894 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 895 | |
|
| | 896 | | // Add request headers |
| | 897 | | _request.Headers.SetValue("x-ms-version", version); |
| | 898 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 899 | |
|
| | 900 | | return _message; |
| | 901 | | } |
| | 902 | |
|
| | 903 | | /// <summary> |
| | 904 | | /// Create the Queue.DeleteAsync response or throw a failure exception. |
| | 905 | | /// </summary> |
| | 906 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 907 | | /// <param name="response">The raw Response.</param> |
| | 908 | | /// <returns>The Queue.DeleteAsync Azure.Response.</returns> |
| | 909 | | internal static Azure.Response DeleteAsync_CreateResponse( |
| | 910 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 911 | | Azure.Response response) |
| | 912 | | { |
| | 913 | | // Process the response |
| | 914 | | switch (response.Status) |
| | 915 | | { |
| | 916 | | case 204: |
| | 917 | | { |
| | 918 | | return response; |
| | 919 | | } |
| | 920 | | default: |
| | 921 | | { |
| | 922 | | // Create the result |
| | 923 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 924 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 925 | |
|
| | 926 | | throw _value.CreateException(clientDiagnostics, response); |
| | 927 | | } |
| | 928 | | } |
| | 929 | | } |
| | 930 | | #endregion Queue.DeleteAsync |
| | 931 | |
|
| | 932 | | #region Queue.GetPropertiesAsync |
| | 933 | | /// <summary> |
| | 934 | | /// Retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with |
| | 935 | | /// </summary> |
| | 936 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 937 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 938 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 939 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 940 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 941 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 942 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 943 | | /// <param name="operationName">Operation name.</param> |
| | 944 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 945 | | /// <returns>Azure.Response{Azure.Storage.Queues.Models.QueueProperties}</returns> |
| | 946 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Queues.Models.QueuePropert |
| | 947 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 948 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 949 | | System.Uri resourceUri, |
| | 950 | | string version, |
| | 951 | | int? timeout = default, |
| | 952 | | string requestId = default, |
| | 953 | | bool async = true, |
| | 954 | | string operationName = "QueueClient.GetProperties", |
| | 955 | | System.Threading.CancellationToken cancellationToken = default) |
| | 956 | | { |
| | 957 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 958 | | try |
| | 959 | | { |
| | 960 | | _scope.AddAttribute("url", resourceUri); |
| | 961 | | _scope.Start(); |
| | 962 | | using (Azure.Core.HttpMessage _message = GetPropertiesAsync_CreateMessage( |
| | 963 | | pipeline, |
| | 964 | | resourceUri, |
| | 965 | | version, |
| | 966 | | timeout, |
| | 967 | | requestId)) |
| | 968 | | { |
| | 969 | | if (async) |
| | 970 | | { |
| | 971 | | // Send the request asynchronously if we're being called via an async path |
| | 972 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 973 | | } |
| | 974 | | else |
| | 975 | | { |
| | 976 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 977 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 978 | | pipeline.Send(_message, cancellationToken); |
| | 979 | | } |
| | 980 | | Azure.Response _response = _message.Response; |
| | 981 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 982 | | return GetPropertiesAsync_CreateResponse(clientDiagnostics, _response); |
| | 983 | | } |
| | 984 | | } |
| | 985 | | catch (System.Exception ex) |
| | 986 | | { |
| | 987 | | _scope.Failed(ex); |
| | 988 | | throw; |
| | 989 | | } |
| | 990 | | finally |
| | 991 | | { |
| | 992 | | _scope.Dispose(); |
| | 993 | | } |
| | 994 | | } |
| | 995 | |
|
| | 996 | | /// <summary> |
| | 997 | | /// Create the Queue.GetPropertiesAsync request. |
| | 998 | | /// </summary> |
| | 999 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1000 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1001 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1002 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1003 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1004 | | /// <returns>The Queue.GetPropertiesAsync Message.</returns> |
| | 1005 | | internal static Azure.Core.HttpMessage GetPropertiesAsync_CreateMessage( |
| | 1006 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1007 | | System.Uri resourceUri, |
| | 1008 | | string version, |
| | 1009 | | int? timeout = default, |
| | 1010 | | string requestId = default) |
| | 1011 | | { |
| | 1012 | | // Validation |
| | 1013 | | if (resourceUri == null) |
| | 1014 | | { |
| | 1015 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1016 | | } |
| | 1017 | | if (version == null) |
| | 1018 | | { |
| | 1019 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1020 | | } |
| | 1021 | |
|
| | 1022 | | // Create the request |
| | 1023 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1024 | | Azure.Core.Request _request = _message.Request; |
| | 1025 | |
|
| | 1026 | | // Set the endpoint |
| | 1027 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 1028 | | _request.Uri.Reset(resourceUri); |
| | 1029 | | _request.Uri.AppendQuery("comp", "metadata", escapeValue: false); |
| | 1030 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1031 | |
|
| | 1032 | | // Add request headers |
| | 1033 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1034 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1035 | |
|
| | 1036 | | return _message; |
| | 1037 | | } |
| | 1038 | |
|
| | 1039 | | /// <summary> |
| | 1040 | | /// Create the Queue.GetPropertiesAsync response or throw a failure exception. |
| | 1041 | | /// </summary> |
| | 1042 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1043 | | /// <param name="response">The raw Response.</param> |
| | 1044 | | /// <returns>The Queue.GetPropertiesAsync Azure.Response{Azure.Storage.Queues.Models.QueueProperties}.</retu |
| | 1045 | | internal static Azure.Response<Azure.Storage.Queues.Models.QueueProperties> GetPropertiesAsync_CreateRespons |
| | 1046 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1047 | | Azure.Response response) |
| | 1048 | | { |
| | 1049 | | // Process the response |
| | 1050 | | switch (response.Status) |
| | 1051 | | { |
| | 1052 | | case 200: |
| | 1053 | | { |
| | 1054 | | // Create the result |
| | 1055 | | Azure.Storage.Queues.Models.QueueProperties _value = new Azure.Storage.Queues.Models.QueueProper |
| | 1056 | |
|
| | 1057 | | // Get response headers |
| | 1058 | | string _header; |
| | 1059 | | _value.Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringCompare |
| | 1060 | | foreach (Azure.Core.HttpHeader _headerPair in response.Headers) |
| | 1061 | | { |
| | 1062 | | if (_headerPair.Name.StartsWith("x-ms-meta-", System.StringComparison.InvariantCulture)) |
| | 1063 | | { |
| | 1064 | | _value.Metadata[_headerPair.Name.Substring(10)] = _headerPair.Value; |
| | 1065 | | } |
| | 1066 | | } |
| | 1067 | | if (response.Headers.TryGetValue("x-ms-approximate-messages-count", out _header)) |
| | 1068 | | { |
| | 1069 | | _value.ApproximateMessagesCount = int.Parse(_header, System.Globalization.CultureInfo.Invari |
| | 1070 | | } |
| | 1071 | |
|
| | 1072 | | // Create the response |
| | 1073 | | return Response.FromValue(_value, response); |
| | 1074 | | } |
| | 1075 | | case 304: |
| | 1076 | | { |
| | 1077 | | return new Azure.NoBodyResponse<Azure.Storage.Queues.Models.QueueProperties>(response); |
| | 1078 | | } |
| | 1079 | | default: |
| | 1080 | | { |
| | 1081 | | // Create the result |
| | 1082 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1083 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 1084 | |
|
| | 1085 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1086 | | } |
| | 1087 | | } |
| | 1088 | | } |
| | 1089 | | #endregion Queue.GetPropertiesAsync |
| | 1090 | |
|
| | 1091 | | #region Queue.SetMetadataAsync |
| | 1092 | | /// <summary> |
| | 1093 | | /// sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value p |
| | 1094 | | /// </summary> |
| | 1095 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 1096 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1097 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1098 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1099 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1100 | | /// <param name="metadata">Optional. Include this parameter to specify that the queue's metadata be returned |
| | 1101 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1102 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 1103 | | /// <param name="operationName">Operation name.</param> |
| | 1104 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 1105 | | /// <returns>Azure.Response</returns> |
| | 1106 | | public static async System.Threading.Tasks.ValueTask<Azure.Response> SetMetadataAsync( |
| | 1107 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1108 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1109 | | System.Uri resourceUri, |
| | 1110 | | string version, |
| | 1111 | | int? timeout = default, |
| | 1112 | | System.Collections.Generic.IDictionary<string, string> metadata = default, |
| | 1113 | | string requestId = default, |
| | 1114 | | bool async = true, |
| | 1115 | | string operationName = "QueueClient.SetMetadata", |
| | 1116 | | System.Threading.CancellationToken cancellationToken = default) |
| | 1117 | | { |
| | 1118 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 1119 | | try |
| | 1120 | | { |
| | 1121 | | _scope.AddAttribute("url", resourceUri); |
| | 1122 | | _scope.Start(); |
| | 1123 | | using (Azure.Core.HttpMessage _message = SetMetadataAsync_CreateMessage( |
| | 1124 | | pipeline, |
| | 1125 | | resourceUri, |
| | 1126 | | version, |
| | 1127 | | timeout, |
| | 1128 | | metadata, |
| | 1129 | | requestId)) |
| | 1130 | | { |
| | 1131 | | if (async) |
| | 1132 | | { |
| | 1133 | | // Send the request asynchronously if we're being called via an async path |
| | 1134 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 1135 | | } |
| | 1136 | | else |
| | 1137 | | { |
| | 1138 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 1139 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 1140 | | pipeline.Send(_message, cancellationToken); |
| | 1141 | | } |
| | 1142 | | Azure.Response _response = _message.Response; |
| | 1143 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 1144 | | return SetMetadataAsync_CreateResponse(clientDiagnostics, _response); |
| | 1145 | | } |
| | 1146 | | } |
| | 1147 | | catch (System.Exception ex) |
| | 1148 | | { |
| | 1149 | | _scope.Failed(ex); |
| | 1150 | | throw; |
| | 1151 | | } |
| | 1152 | | finally |
| | 1153 | | { |
| | 1154 | | _scope.Dispose(); |
| | 1155 | | } |
| | 1156 | | } |
| | 1157 | |
|
| | 1158 | | /// <summary> |
| | 1159 | | /// Create the Queue.SetMetadataAsync request. |
| | 1160 | | /// </summary> |
| | 1161 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1162 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1163 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1164 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1165 | | /// <param name="metadata">Optional. Include this parameter to specify that the queue's metadata be returned |
| | 1166 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1167 | | /// <returns>The Queue.SetMetadataAsync Message.</returns> |
| | 1168 | | internal static Azure.Core.HttpMessage SetMetadataAsync_CreateMessage( |
| | 1169 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1170 | | System.Uri resourceUri, |
| | 1171 | | string version, |
| | 1172 | | int? timeout = default, |
| | 1173 | | System.Collections.Generic.IDictionary<string, string> metadata = default, |
| | 1174 | | string requestId = default) |
| | 1175 | | { |
| | 1176 | | // Validation |
| | 1177 | | if (resourceUri == null) |
| | 1178 | | { |
| | 1179 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1180 | | } |
| | 1181 | | if (version == null) |
| | 1182 | | { |
| | 1183 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1184 | | } |
| | 1185 | |
|
| | 1186 | | // Create the request |
| | 1187 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1188 | | Azure.Core.Request _request = _message.Request; |
| | 1189 | |
|
| | 1190 | | // Set the endpoint |
| | 1191 | | _request.Method = Azure.Core.RequestMethod.Put; |
| | 1192 | | _request.Uri.Reset(resourceUri); |
| | 1193 | | _request.Uri.AppendQuery("comp", "metadata", escapeValue: false); |
| | 1194 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1195 | |
|
| | 1196 | | // Add request headers |
| | 1197 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1198 | | if (metadata != null) { |
| | 1199 | | foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata) |
| | 1200 | | { |
| | 1201 | | _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); |
| | 1202 | | } |
| | 1203 | | } |
| | 1204 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1205 | |
|
| | 1206 | | return _message; |
| | 1207 | | } |
| | 1208 | |
|
| | 1209 | | /// <summary> |
| | 1210 | | /// Create the Queue.SetMetadataAsync response or throw a failure exception. |
| | 1211 | | /// </summary> |
| | 1212 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1213 | | /// <param name="response">The raw Response.</param> |
| | 1214 | | /// <returns>The Queue.SetMetadataAsync Azure.Response.</returns> |
| | 1215 | | internal static Azure.Response SetMetadataAsync_CreateResponse( |
| | 1216 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1217 | | Azure.Response response) |
| | 1218 | | { |
| | 1219 | | // Process the response |
| | 1220 | | switch (response.Status) |
| | 1221 | | { |
| | 1222 | | case 204: |
| | 1223 | | { |
| | 1224 | | return response; |
| | 1225 | | } |
| | 1226 | | default: |
| | 1227 | | { |
| | 1228 | | // Create the result |
| | 1229 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1230 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 1231 | |
|
| | 1232 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1233 | | } |
| | 1234 | | } |
| | 1235 | | } |
| | 1236 | | #endregion Queue.SetMetadataAsync |
| | 1237 | |
|
| | 1238 | | #region Queue.GetAccessPolicyAsync |
| | 1239 | | /// <summary> |
| | 1240 | | /// returns details about any stored access policies specified on the queue that may be used with Shared Acc |
| | 1241 | | /// </summary> |
| | 1242 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 1243 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1244 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1245 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1246 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1247 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1248 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 1249 | | /// <param name="operationName">Operation name.</param> |
| | 1250 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 1251 | | /// <returns>a collection of signed identifiers</returns> |
| | 1252 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<System.Collections.Generic.IEnumerable<A |
| | 1253 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1254 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1255 | | System.Uri resourceUri, |
| | 1256 | | string version, |
| | 1257 | | int? timeout = default, |
| | 1258 | | string requestId = default, |
| | 1259 | | bool async = true, |
| | 1260 | | string operationName = "QueueClient.GetAccessPolicy", |
| | 1261 | | System.Threading.CancellationToken cancellationToken = default) |
| | 1262 | | { |
| | 1263 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 1264 | | try |
| | 1265 | | { |
| | 1266 | | _scope.AddAttribute("url", resourceUri); |
| | 1267 | | _scope.Start(); |
| | 1268 | | using (Azure.Core.HttpMessage _message = GetAccessPolicyAsync_CreateMessage( |
| | 1269 | | pipeline, |
| | 1270 | | resourceUri, |
| | 1271 | | version, |
| | 1272 | | timeout, |
| | 1273 | | requestId)) |
| | 1274 | | { |
| | 1275 | | if (async) |
| | 1276 | | { |
| | 1277 | | // Send the request asynchronously if we're being called via an async path |
| | 1278 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 1279 | | } |
| | 1280 | | else |
| | 1281 | | { |
| | 1282 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 1283 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 1284 | | pipeline.Send(_message, cancellationToken); |
| | 1285 | | } |
| | 1286 | | Azure.Response _response = _message.Response; |
| | 1287 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 1288 | | return GetAccessPolicyAsync_CreateResponse(clientDiagnostics, _response); |
| | 1289 | | } |
| | 1290 | | } |
| | 1291 | | catch (System.Exception ex) |
| | 1292 | | { |
| | 1293 | | _scope.Failed(ex); |
| | 1294 | | throw; |
| | 1295 | | } |
| | 1296 | | finally |
| | 1297 | | { |
| | 1298 | | _scope.Dispose(); |
| | 1299 | | } |
| | 1300 | | } |
| | 1301 | |
|
| | 1302 | | /// <summary> |
| | 1303 | | /// Create the Queue.GetAccessPolicyAsync request. |
| | 1304 | | /// </summary> |
| | 1305 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1306 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1307 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1308 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1309 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1310 | | /// <returns>The Queue.GetAccessPolicyAsync Message.</returns> |
| | 1311 | | internal static Azure.Core.HttpMessage GetAccessPolicyAsync_CreateMessage( |
| | 1312 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1313 | | System.Uri resourceUri, |
| | 1314 | | string version, |
| | 1315 | | int? timeout = default, |
| | 1316 | | string requestId = default) |
| | 1317 | | { |
| | 1318 | | // Validation |
| | 1319 | | if (resourceUri == null) |
| | 1320 | | { |
| | 1321 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1322 | | } |
| | 1323 | | if (version == null) |
| | 1324 | | { |
| | 1325 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1326 | | } |
| | 1327 | |
|
| | 1328 | | // Create the request |
| | 1329 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1330 | | Azure.Core.Request _request = _message.Request; |
| | 1331 | |
|
| | 1332 | | // Set the endpoint |
| | 1333 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 1334 | | _request.Uri.Reset(resourceUri); |
| | 1335 | | _request.Uri.AppendQuery("comp", "acl", escapeValue: false); |
| | 1336 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1337 | |
|
| | 1338 | | // Add request headers |
| | 1339 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1340 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1341 | |
|
| | 1342 | | return _message; |
| | 1343 | | } |
| | 1344 | |
|
| | 1345 | | /// <summary> |
| | 1346 | | /// Create the Queue.GetAccessPolicyAsync response or throw a failure exception. |
| | 1347 | | /// </summary> |
| | 1348 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1349 | | /// <param name="response">The raw Response.</param> |
| | 1350 | | /// <returns>The Queue.GetAccessPolicyAsync Azure.Response{System.Collections.Generic.IEnumerable{Azure.Stor |
| | 1351 | | internal static Azure.Response<System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.QueueSigne |
| | 1352 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1353 | | Azure.Response response) |
| | 1354 | | { |
| | 1355 | | // Process the response |
| | 1356 | | switch (response.Status) |
| | 1357 | | { |
| | 1358 | | case 200: |
| | 1359 | | { |
| | 1360 | | // Create the result |
| | 1361 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1362 | | System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.QueueSignedIdentifier> _value |
| | 1363 | | System.Linq.Enumerable.ToList( |
| | 1364 | | System.Linq.Enumerable.Select( |
| | 1365 | | _xml.Element(System.Xml.Linq.XName.Get("SignedIdentifiers", "")).Elements(System.Xml |
| | 1366 | | Azure.Storage.Queues.Models.QueueSignedIdentifier.FromXml)); |
| | 1367 | |
|
| | 1368 | | // Create the response |
| | 1369 | | return Response.FromValue(_value, response); |
| | 1370 | | } |
| | 1371 | | case 304: |
| | 1372 | | { |
| | 1373 | | return new Azure.NoBodyResponse<System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Mode |
| | 1374 | | } |
| | 1375 | | default: |
| | 1376 | | { |
| | 1377 | | // Create the result |
| | 1378 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1379 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 1380 | |
|
| | 1381 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1382 | | } |
| | 1383 | | } |
| | 1384 | | } |
| | 1385 | | #endregion Queue.GetAccessPolicyAsync |
| | 1386 | |
|
| | 1387 | | #region Queue.SetAccessPolicyAsync |
| | 1388 | | /// <summary> |
| | 1389 | | /// sets stored access policies for the queue that may be used with Shared Access Signatures |
| | 1390 | | /// </summary> |
| | 1391 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 1392 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1393 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1394 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1395 | | /// <param name="permissions">the acls for the queue</param> |
| | 1396 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1397 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1398 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 1399 | | /// <param name="operationName">Operation name.</param> |
| | 1400 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 1401 | | /// <returns>Azure.Response</returns> |
| | 1402 | | public static async System.Threading.Tasks.ValueTask<Azure.Response> SetAccessPolicyAsync( |
| | 1403 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1404 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1405 | | System.Uri resourceUri, |
| | 1406 | | string version, |
| | 1407 | | System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.QueueSignedIdentifier> permissions = |
| | 1408 | | int? timeout = default, |
| | 1409 | | string requestId = default, |
| | 1410 | | bool async = true, |
| | 1411 | | string operationName = "QueueClient.SetAccessPolicy", |
| | 1412 | | System.Threading.CancellationToken cancellationToken = default) |
| | 1413 | | { |
| | 1414 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 1415 | | try |
| | 1416 | | { |
| | 1417 | | _scope.AddAttribute("url", resourceUri); |
| | 1418 | | _scope.Start(); |
| | 1419 | | using (Azure.Core.HttpMessage _message = SetAccessPolicyAsync_CreateMessage( |
| | 1420 | | pipeline, |
| | 1421 | | resourceUri, |
| | 1422 | | version, |
| | 1423 | | permissions, |
| | 1424 | | timeout, |
| | 1425 | | requestId)) |
| | 1426 | | { |
| | 1427 | | if (async) |
| | 1428 | | { |
| | 1429 | | // Send the request asynchronously if we're being called via an async path |
| | 1430 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 1431 | | } |
| | 1432 | | else |
| | 1433 | | { |
| | 1434 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 1435 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 1436 | | pipeline.Send(_message, cancellationToken); |
| | 1437 | | } |
| | 1438 | | Azure.Response _response = _message.Response; |
| | 1439 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 1440 | | return SetAccessPolicyAsync_CreateResponse(clientDiagnostics, _response); |
| | 1441 | | } |
| | 1442 | | } |
| | 1443 | | catch (System.Exception ex) |
| | 1444 | | { |
| | 1445 | | _scope.Failed(ex); |
| | 1446 | | throw; |
| | 1447 | | } |
| | 1448 | | finally |
| | 1449 | | { |
| | 1450 | | _scope.Dispose(); |
| | 1451 | | } |
| | 1452 | | } |
| | 1453 | |
|
| | 1454 | | /// <summary> |
| | 1455 | | /// Create the Queue.SetAccessPolicyAsync request. |
| | 1456 | | /// </summary> |
| | 1457 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1458 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1459 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1460 | | /// <param name="permissions">the acls for the queue</param> |
| | 1461 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1462 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1463 | | /// <returns>The Queue.SetAccessPolicyAsync Message.</returns> |
| | 1464 | | internal static Azure.Core.HttpMessage SetAccessPolicyAsync_CreateMessage( |
| | 1465 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1466 | | System.Uri resourceUri, |
| | 1467 | | string version, |
| | 1468 | | System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.QueueSignedIdentifier> permissions = |
| | 1469 | | int? timeout = default, |
| | 1470 | | string requestId = default) |
| | 1471 | | { |
| | 1472 | | // Validation |
| | 1473 | | if (resourceUri == null) |
| | 1474 | | { |
| | 1475 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1476 | | } |
| | 1477 | | if (version == null) |
| | 1478 | | { |
| | 1479 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1480 | | } |
| | 1481 | |
|
| | 1482 | | // Create the request |
| | 1483 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1484 | | Azure.Core.Request _request = _message.Request; |
| | 1485 | |
|
| | 1486 | | // Set the endpoint |
| | 1487 | | _request.Method = Azure.Core.RequestMethod.Put; |
| | 1488 | | _request.Uri.Reset(resourceUri); |
| | 1489 | | _request.Uri.AppendQuery("comp", "acl", escapeValue: false); |
| | 1490 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1491 | |
|
| | 1492 | | // Add request headers |
| | 1493 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1494 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1495 | |
|
| | 1496 | | // Create the body |
| | 1497 | | System.Xml.Linq.XElement _body = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get("SignedIdentifie |
| | 1498 | | if (permissions != null) |
| | 1499 | | { |
| | 1500 | | foreach (Azure.Storage.Queues.Models.QueueSignedIdentifier _child in permissions) |
| | 1501 | | { |
| | 1502 | | _body.Add(Azure.Storage.Queues.Models.QueueSignedIdentifier.ToXml(_child)); |
| | 1503 | | } |
| | 1504 | | } |
| | 1505 | | string _text = _body.ToString(System.Xml.Linq.SaveOptions.DisableFormatting); |
| | 1506 | | _request.Headers.SetValue("Content-Type", "application/xml"); |
| | 1507 | | _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.Invar |
| | 1508 | | _request.Content = Azure.Core.RequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text)); |
| | 1509 | |
|
| | 1510 | | return _message; |
| | 1511 | | } |
| | 1512 | |
|
| | 1513 | | /// <summary> |
| | 1514 | | /// Create the Queue.SetAccessPolicyAsync response or throw a failure exception. |
| | 1515 | | /// </summary> |
| | 1516 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1517 | | /// <param name="response">The raw Response.</param> |
| | 1518 | | /// <returns>The Queue.SetAccessPolicyAsync Azure.Response.</returns> |
| | 1519 | | internal static Azure.Response SetAccessPolicyAsync_CreateResponse( |
| | 1520 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1521 | | Azure.Response response) |
| | 1522 | | { |
| | 1523 | | // Process the response |
| | 1524 | | switch (response.Status) |
| | 1525 | | { |
| | 1526 | | case 204: |
| | 1527 | | { |
| | 1528 | | return response; |
| | 1529 | | } |
| | 1530 | | default: |
| | 1531 | | { |
| | 1532 | | // Create the result |
| | 1533 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1534 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 1535 | |
|
| | 1536 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1537 | | } |
| | 1538 | | } |
| | 1539 | | } |
| | 1540 | | #endregion Queue.SetAccessPolicyAsync |
| | 1541 | | } |
| | 1542 | | #endregion Queue operations |
| | 1543 | |
|
| | 1544 | | #region Messages operations |
| | 1545 | | /// <summary> |
| | 1546 | | /// Messages operations for Azure Queue Storage |
| | 1547 | | /// </summary> |
| | 1548 | | public static partial class Messages |
| | 1549 | | { |
| | 1550 | | #region Messages.DequeueAsync |
| | 1551 | | /// <summary> |
| | 1552 | | /// The Dequeue operation retrieves one or more messages from the front of the queue. |
| | 1553 | | /// </summary> |
| | 1554 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 1555 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1556 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1557 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1558 | | /// <param name="numberOfMessages">Optional. A nonzero integer value that specifies the number of messages t |
| | 1559 | | /// <param name="visibilitytimeout">Optional. Specifies the new visibility timeout value, in seconds, relati |
| | 1560 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1561 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1562 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 1563 | | /// <param name="operationName">Operation name.</param> |
| | 1564 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 1565 | | /// <returns>The object returned when calling Get Messages on a Queue</returns> |
| | 1566 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<System.Collections.Generic.IEnumerable<A |
| | 1567 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1568 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1569 | | System.Uri resourceUri, |
| | 1570 | | string version, |
| | 1571 | | int? numberOfMessages = default, |
| | 1572 | | int? visibilitytimeout = default, |
| | 1573 | | int? timeout = default, |
| | 1574 | | string requestId = default, |
| | 1575 | | bool async = true, |
| | 1576 | | string operationName = "MessagesClient.Dequeue", |
| | 1577 | | System.Threading.CancellationToken cancellationToken = default) |
| | 1578 | | { |
| | 1579 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 1580 | | try |
| | 1581 | | { |
| | 1582 | | _scope.AddAttribute("url", resourceUri); |
| | 1583 | | _scope.Start(); |
| | 1584 | | using (Azure.Core.HttpMessage _message = DequeueAsync_CreateMessage( |
| | 1585 | | pipeline, |
| | 1586 | | resourceUri, |
| | 1587 | | version, |
| | 1588 | | numberOfMessages, |
| | 1589 | | visibilitytimeout, |
| | 1590 | | timeout, |
| | 1591 | | requestId)) |
| | 1592 | | { |
| | 1593 | | if (async) |
| | 1594 | | { |
| | 1595 | | // Send the request asynchronously if we're being called via an async path |
| | 1596 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 1597 | | } |
| | 1598 | | else |
| | 1599 | | { |
| | 1600 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 1601 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 1602 | | pipeline.Send(_message, cancellationToken); |
| | 1603 | | } |
| | 1604 | | Azure.Response _response = _message.Response; |
| | 1605 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 1606 | | return DequeueAsync_CreateResponse(clientDiagnostics, _response); |
| | 1607 | | } |
| | 1608 | | } |
| | 1609 | | catch (System.Exception ex) |
| | 1610 | | { |
| | 1611 | | _scope.Failed(ex); |
| | 1612 | | throw; |
| | 1613 | | } |
| | 1614 | | finally |
| | 1615 | | { |
| | 1616 | | _scope.Dispose(); |
| | 1617 | | } |
| | 1618 | | } |
| | 1619 | |
|
| | 1620 | | /// <summary> |
| | 1621 | | /// Create the Messages.DequeueAsync request. |
| | 1622 | | /// </summary> |
| | 1623 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1624 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1625 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1626 | | /// <param name="numberOfMessages">Optional. A nonzero integer value that specifies the number of messages t |
| | 1627 | | /// <param name="visibilitytimeout">Optional. Specifies the new visibility timeout value, in seconds, relati |
| | 1628 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1629 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1630 | | /// <returns>The Messages.DequeueAsync Message.</returns> |
| | 1631 | | internal static Azure.Core.HttpMessage DequeueAsync_CreateMessage( |
| | 1632 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1633 | | System.Uri resourceUri, |
| | 1634 | | string version, |
| | 1635 | | int? numberOfMessages = default, |
| | 1636 | | int? visibilitytimeout = default, |
| | 1637 | | int? timeout = default, |
| | 1638 | | string requestId = default) |
| | 1639 | | { |
| | 1640 | | // Validation |
| | 1641 | | if (resourceUri == null) |
| | 1642 | | { |
| | 1643 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1644 | | } |
| | 1645 | | if (version == null) |
| | 1646 | | { |
| | 1647 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1648 | | } |
| | 1649 | |
|
| | 1650 | | // Create the request |
| | 1651 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1652 | | Azure.Core.Request _request = _message.Request; |
| | 1653 | |
|
| | 1654 | | // Set the endpoint |
| | 1655 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 1656 | | _request.Uri.Reset(resourceUri); |
| | 1657 | | if (numberOfMessages != null) { _request.Uri.AppendQuery("numofmessages", numberOfMessages.Value.ToStrin |
| | 1658 | | if (visibilitytimeout != null) { _request.Uri.AppendQuery("visibilitytimeout", visibilitytimeout.Value.T |
| | 1659 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1660 | |
|
| | 1661 | | // Add request headers |
| | 1662 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1663 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1664 | |
|
| | 1665 | | return _message; |
| | 1666 | | } |
| | 1667 | |
|
| | 1668 | | /// <summary> |
| | 1669 | | /// Create the Messages.DequeueAsync response or throw a failure exception. |
| | 1670 | | /// </summary> |
| | 1671 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1672 | | /// <param name="response">The raw Response.</param> |
| | 1673 | | /// <returns>The Messages.DequeueAsync Azure.Response{System.Collections.Generic.IEnumerable{Azure.Storage.Q |
| | 1674 | | internal static Azure.Response<System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.QueueMessa |
| | 1675 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1676 | | Azure.Response response) |
| | 1677 | | { |
| | 1678 | | // Process the response |
| | 1679 | | switch (response.Status) |
| | 1680 | | { |
| | 1681 | | case 200: |
| | 1682 | | { |
| | 1683 | | // Create the result |
| | 1684 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1685 | | System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.QueueMessage> _value = |
| | 1686 | | System.Linq.Enumerable.ToList( |
| | 1687 | | System.Linq.Enumerable.Select( |
| | 1688 | | _xml.Element(System.Xml.Linq.XName.Get("QueueMessagesList", "")).Elements(System.Xml |
| | 1689 | | Azure.Storage.Queues.Models.QueueMessage.FromXml)); |
| | 1690 | |
|
| | 1691 | | // Create the response |
| | 1692 | | return Response.FromValue(_value, response); |
| | 1693 | | } |
| | 1694 | | case 304: |
| | 1695 | | { |
| | 1696 | | return new Azure.NoBodyResponse<System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Mode |
| | 1697 | | } |
| | 1698 | | default: |
| | 1699 | | { |
| | 1700 | | // Create the result |
| | 1701 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1702 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 1703 | |
|
| | 1704 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1705 | | } |
| | 1706 | | } |
| | 1707 | | } |
| | 1708 | | #endregion Messages.DequeueAsync |
| | 1709 | |
|
| | 1710 | | #region Messages.ClearAsync |
| | 1711 | | /// <summary> |
| | 1712 | | /// The Clear operation deletes all messages from the specified queue. |
| | 1713 | | /// </summary> |
| | 1714 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 1715 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1716 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1717 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1718 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1719 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1720 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 1721 | | /// <param name="operationName">Operation name.</param> |
| | 1722 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 1723 | | /// <returns>Azure.Response</returns> |
| | 1724 | | public static async System.Threading.Tasks.ValueTask<Azure.Response> ClearAsync( |
| | 1725 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1726 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1727 | | System.Uri resourceUri, |
| | 1728 | | string version, |
| | 1729 | | int? timeout = default, |
| | 1730 | | string requestId = default, |
| | 1731 | | bool async = true, |
| | 1732 | | string operationName = "MessagesClient.Clear", |
| | 1733 | | System.Threading.CancellationToken cancellationToken = default) |
| | 1734 | | { |
| | 1735 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 1736 | | try |
| | 1737 | | { |
| | 1738 | | _scope.AddAttribute("url", resourceUri); |
| | 1739 | | _scope.Start(); |
| | 1740 | | using (Azure.Core.HttpMessage _message = ClearAsync_CreateMessage( |
| | 1741 | | pipeline, |
| | 1742 | | resourceUri, |
| | 1743 | | version, |
| | 1744 | | timeout, |
| | 1745 | | requestId)) |
| | 1746 | | { |
| | 1747 | | if (async) |
| | 1748 | | { |
| | 1749 | | // Send the request asynchronously if we're being called via an async path |
| | 1750 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 1751 | | } |
| | 1752 | | else |
| | 1753 | | { |
| | 1754 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 1755 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 1756 | | pipeline.Send(_message, cancellationToken); |
| | 1757 | | } |
| | 1758 | | Azure.Response _response = _message.Response; |
| | 1759 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 1760 | | return ClearAsync_CreateResponse(clientDiagnostics, _response); |
| | 1761 | | } |
| | 1762 | | } |
| | 1763 | | catch (System.Exception ex) |
| | 1764 | | { |
| | 1765 | | _scope.Failed(ex); |
| | 1766 | | throw; |
| | 1767 | | } |
| | 1768 | | finally |
| | 1769 | | { |
| | 1770 | | _scope.Dispose(); |
| | 1771 | | } |
| | 1772 | | } |
| | 1773 | |
|
| | 1774 | | /// <summary> |
| | 1775 | | /// Create the Messages.ClearAsync request. |
| | 1776 | | /// </summary> |
| | 1777 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1778 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1779 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1780 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1781 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1782 | | /// <returns>The Messages.ClearAsync Message.</returns> |
| | 1783 | | internal static Azure.Core.HttpMessage ClearAsync_CreateMessage( |
| | 1784 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1785 | | System.Uri resourceUri, |
| | 1786 | | string version, |
| | 1787 | | int? timeout = default, |
| | 1788 | | string requestId = default) |
| | 1789 | | { |
| | 1790 | | // Validation |
| | 1791 | | if (resourceUri == null) |
| | 1792 | | { |
| | 1793 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1794 | | } |
| | 1795 | | if (version == null) |
| | 1796 | | { |
| | 1797 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1798 | | } |
| | 1799 | |
|
| | 1800 | | // Create the request |
| | 1801 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1802 | | Azure.Core.Request _request = _message.Request; |
| | 1803 | |
|
| | 1804 | | // Set the endpoint |
| | 1805 | | _request.Method = Azure.Core.RequestMethod.Delete; |
| | 1806 | | _request.Uri.Reset(resourceUri); |
| | 1807 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1808 | |
|
| | 1809 | | // Add request headers |
| | 1810 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1811 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1812 | |
|
| | 1813 | | return _message; |
| | 1814 | | } |
| | 1815 | |
|
| | 1816 | | /// <summary> |
| | 1817 | | /// Create the Messages.ClearAsync response or throw a failure exception. |
| | 1818 | | /// </summary> |
| | 1819 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1820 | | /// <param name="response">The raw Response.</param> |
| | 1821 | | /// <returns>The Messages.ClearAsync Azure.Response.</returns> |
| | 1822 | | internal static Azure.Response ClearAsync_CreateResponse( |
| | 1823 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1824 | | Azure.Response response) |
| | 1825 | | { |
| | 1826 | | // Process the response |
| | 1827 | | switch (response.Status) |
| | 1828 | | { |
| | 1829 | | case 204: |
| | 1830 | | { |
| | 1831 | | return response; |
| | 1832 | | } |
| | 1833 | | default: |
| | 1834 | | { |
| | 1835 | | // Create the result |
| | 1836 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1837 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 1838 | |
|
| | 1839 | | throw _value.CreateException(clientDiagnostics, response); |
| | 1840 | | } |
| | 1841 | | } |
| | 1842 | | } |
| | 1843 | | #endregion Messages.ClearAsync |
| | 1844 | |
|
| | 1845 | | #region Messages.EnqueueAsync |
| | 1846 | | /// <summary> |
| | 1847 | | /// The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also |
| | 1848 | | /// </summary> |
| | 1849 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 1850 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1851 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1852 | | /// <param name="message">A Message object which can be stored in a Queue</param> |
| | 1853 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1854 | | /// <param name="visibilitytimeout">Optional. Specifies the new visibility timeout value, in seconds, relati |
| | 1855 | | /// <param name="messageTimeToLive">Optional. Specifies the time-to-live interval for the message, in second |
| | 1856 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1857 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1858 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 1859 | | /// <param name="operationName">Operation name.</param> |
| | 1860 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 1861 | | /// <returns>The object returned when calling Put Message on a Queue</returns> |
| | 1862 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<System.Collections.Generic.IEnumerable<A |
| | 1863 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1864 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1865 | | System.Uri resourceUri, |
| | 1866 | | Azure.Storage.Queues.Models.QueueSendMessage message, |
| | 1867 | | string version, |
| | 1868 | | int? visibilitytimeout = default, |
| | 1869 | | int? messageTimeToLive = default, |
| | 1870 | | int? timeout = default, |
| | 1871 | | string requestId = default, |
| | 1872 | | bool async = true, |
| | 1873 | | string operationName = "MessagesClient.Enqueue", |
| | 1874 | | System.Threading.CancellationToken cancellationToken = default) |
| | 1875 | | { |
| | 1876 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 1877 | | try |
| | 1878 | | { |
| | 1879 | | _scope.AddAttribute("url", resourceUri); |
| | 1880 | | _scope.Start(); |
| | 1881 | | using (Azure.Core.HttpMessage _message = EnqueueAsync_CreateMessage( |
| | 1882 | | pipeline, |
| | 1883 | | resourceUri, |
| | 1884 | | message, |
| | 1885 | | version, |
| | 1886 | | visibilitytimeout, |
| | 1887 | | messageTimeToLive, |
| | 1888 | | timeout, |
| | 1889 | | requestId)) |
| | 1890 | | { |
| | 1891 | | if (async) |
| | 1892 | | { |
| | 1893 | | // Send the request asynchronously if we're being called via an async path |
| | 1894 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 1895 | | } |
| | 1896 | | else |
| | 1897 | | { |
| | 1898 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 1899 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 1900 | | pipeline.Send(_message, cancellationToken); |
| | 1901 | | } |
| | 1902 | | Azure.Response _response = _message.Response; |
| | 1903 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 1904 | | return EnqueueAsync_CreateResponse(clientDiagnostics, _response); |
| | 1905 | | } |
| | 1906 | | } |
| | 1907 | | catch (System.Exception ex) |
| | 1908 | | { |
| | 1909 | | _scope.Failed(ex); |
| | 1910 | | throw; |
| | 1911 | | } |
| | 1912 | | finally |
| | 1913 | | { |
| | 1914 | | _scope.Dispose(); |
| | 1915 | | } |
| | 1916 | | } |
| | 1917 | |
|
| | 1918 | | /// <summary> |
| | 1919 | | /// Create the Messages.EnqueueAsync request. |
| | 1920 | | /// </summary> |
| | 1921 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 1922 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 1923 | | /// <param name="message">A Message object which can be stored in a Queue</param> |
| | 1924 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 1925 | | /// <param name="visibilitytimeout">Optional. Specifies the new visibility timeout value, in seconds, relati |
| | 1926 | | /// <param name="messageTimeToLive">Optional. Specifies the time-to-live interval for the message, in second |
| | 1927 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 1928 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 1929 | | /// <returns>The Messages.EnqueueAsync Message.</returns> |
| | 1930 | | internal static Azure.Core.HttpMessage EnqueueAsync_CreateMessage( |
| | 1931 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 1932 | | System.Uri resourceUri, |
| | 1933 | | Azure.Storage.Queues.Models.QueueSendMessage message, |
| | 1934 | | string version, |
| | 1935 | | int? visibilitytimeout = default, |
| | 1936 | | int? messageTimeToLive = default, |
| | 1937 | | int? timeout = default, |
| | 1938 | | string requestId = default) |
| | 1939 | | { |
| | 1940 | | // Validation |
| | 1941 | | if (resourceUri == null) |
| | 1942 | | { |
| | 1943 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 1944 | | } |
| | 1945 | | if (message == null) |
| | 1946 | | { |
| | 1947 | | throw new System.ArgumentNullException(nameof(message)); |
| | 1948 | | } |
| | 1949 | | if (version == null) |
| | 1950 | | { |
| | 1951 | | throw new System.ArgumentNullException(nameof(version)); |
| | 1952 | | } |
| | 1953 | |
|
| | 1954 | | // Create the request |
| | 1955 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 1956 | | Azure.Core.Request _request = _message.Request; |
| | 1957 | |
|
| | 1958 | | // Set the endpoint |
| | 1959 | | _request.Method = Azure.Core.RequestMethod.Post; |
| | 1960 | | _request.Uri.Reset(resourceUri); |
| | 1961 | | if (visibilitytimeout != null) { _request.Uri.AppendQuery("visibilitytimeout", visibilitytimeout.Value.T |
| | 1962 | | if (messageTimeToLive != null) { _request.Uri.AppendQuery("messagettl", messageTimeToLive.Value.ToString |
| | 1963 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 1964 | |
|
| | 1965 | | // Add request headers |
| | 1966 | | _request.Headers.SetValue("x-ms-version", version); |
| | 1967 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 1968 | |
|
| | 1969 | | // Create the body |
| | 1970 | | System.Xml.Linq.XElement _body = Azure.Storage.Queues.Models.QueueSendMessage.ToXml(message, "QueueMessa |
| | 1971 | | string _text = _body.ToString(System.Xml.Linq.SaveOptions.DisableFormatting); |
| | 1972 | | _request.Headers.SetValue("Content-Type", "application/xml"); |
| | 1973 | | _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.Invar |
| | 1974 | | _request.Content = Azure.Core.RequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text)); |
| | 1975 | |
|
| | 1976 | | return _message; |
| | 1977 | | } |
| | 1978 | |
|
| | 1979 | | /// <summary> |
| | 1980 | | /// Create the Messages.EnqueueAsync response or throw a failure exception. |
| | 1981 | | /// </summary> |
| | 1982 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 1983 | | /// <param name="response">The raw Response.</param> |
| | 1984 | | /// <returns>The Messages.EnqueueAsync Azure.Response{System.Collections.Generic.IEnumerable{Azure.Storage.Q |
| | 1985 | | internal static Azure.Response<System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.SendReceip |
| | 1986 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 1987 | | Azure.Response response) |
| | 1988 | | { |
| | 1989 | | // Process the response |
| | 1990 | | switch (response.Status) |
| | 1991 | | { |
| | 1992 | | case 201: |
| | 1993 | | { |
| | 1994 | | // Create the result |
| | 1995 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 1996 | | System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.SendReceipt> _value = |
| | 1997 | | System.Linq.Enumerable.ToList( |
| | 1998 | | System.Linq.Enumerable.Select( |
| | 1999 | | _xml.Element(System.Xml.Linq.XName.Get("QueueMessagesList", "")).Elements(System.Xml |
| | 2000 | | Azure.Storage.Queues.Models.SendReceipt.FromXml)); |
| | 2001 | |
|
| | 2002 | | // Create the response |
| | 2003 | | return Response.FromValue(_value, response); |
| | 2004 | | } |
| | 2005 | | default: |
| | 2006 | | { |
| | 2007 | | // Create the result |
| | 2008 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 2009 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 2010 | |
|
| | 2011 | | throw _value.CreateException(clientDiagnostics, response); |
| | 2012 | | } |
| | 2013 | | } |
| | 2014 | | } |
| | 2015 | | #endregion Messages.EnqueueAsync |
| | 2016 | |
|
| | 2017 | | #region Messages.PeekAsync |
| | 2018 | | /// <summary> |
| | 2019 | | /// The Peek operation retrieves one or more messages from the front of the queue, but does not alter the vi |
| | 2020 | | /// </summary> |
| | 2021 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 2022 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2023 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 2024 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2025 | | /// <param name="numberOfMessages">Optional. A nonzero integer value that specifies the number of messages t |
| | 2026 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 2027 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2028 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 2029 | | /// <param name="operationName">Operation name.</param> |
| | 2030 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 2031 | | /// <returns>The object returned when calling Peek Messages on a Queue</returns> |
| | 2032 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<System.Collections.Generic.IEnumerable<A |
| | 2033 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2034 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2035 | | System.Uri resourceUri, |
| | 2036 | | string version, |
| | 2037 | | int? numberOfMessages = default, |
| | 2038 | | int? timeout = default, |
| | 2039 | | string requestId = default, |
| | 2040 | | bool async = true, |
| | 2041 | | string operationName = "MessagesClient.Peek", |
| | 2042 | | System.Threading.CancellationToken cancellationToken = default) |
| | 2043 | | { |
| | 2044 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 2045 | | try |
| | 2046 | | { |
| | 2047 | | _scope.AddAttribute("url", resourceUri); |
| | 2048 | | _scope.Start(); |
| | 2049 | | using (Azure.Core.HttpMessage _message = PeekAsync_CreateMessage( |
| | 2050 | | pipeline, |
| | 2051 | | resourceUri, |
| | 2052 | | version, |
| | 2053 | | numberOfMessages, |
| | 2054 | | timeout, |
| | 2055 | | requestId)) |
| | 2056 | | { |
| | 2057 | | if (async) |
| | 2058 | | { |
| | 2059 | | // Send the request asynchronously if we're being called via an async path |
| | 2060 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 2061 | | } |
| | 2062 | | else |
| | 2063 | | { |
| | 2064 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 2065 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 2066 | | pipeline.Send(_message, cancellationToken); |
| | 2067 | | } |
| | 2068 | | Azure.Response _response = _message.Response; |
| | 2069 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 2070 | | return PeekAsync_CreateResponse(clientDiagnostics, _response); |
| | 2071 | | } |
| | 2072 | | } |
| | 2073 | | catch (System.Exception ex) |
| | 2074 | | { |
| | 2075 | | _scope.Failed(ex); |
| | 2076 | | throw; |
| | 2077 | | } |
| | 2078 | | finally |
| | 2079 | | { |
| | 2080 | | _scope.Dispose(); |
| | 2081 | | } |
| | 2082 | | } |
| | 2083 | |
|
| | 2084 | | /// <summary> |
| | 2085 | | /// Create the Messages.PeekAsync request. |
| | 2086 | | /// </summary> |
| | 2087 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2088 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 2089 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2090 | | /// <param name="numberOfMessages">Optional. A nonzero integer value that specifies the number of messages t |
| | 2091 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 2092 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2093 | | /// <returns>The Messages.PeekAsync Message.</returns> |
| | 2094 | | internal static Azure.Core.HttpMessage PeekAsync_CreateMessage( |
| | 2095 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2096 | | System.Uri resourceUri, |
| | 2097 | | string version, |
| | 2098 | | int? numberOfMessages = default, |
| | 2099 | | int? timeout = default, |
| | 2100 | | string requestId = default) |
| | 2101 | | { |
| | 2102 | | // Validation |
| | 2103 | | if (resourceUri == null) |
| | 2104 | | { |
| | 2105 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 2106 | | } |
| | 2107 | | if (version == null) |
| | 2108 | | { |
| | 2109 | | throw new System.ArgumentNullException(nameof(version)); |
| | 2110 | | } |
| | 2111 | |
|
| | 2112 | | // Create the request |
| | 2113 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 2114 | | Azure.Core.Request _request = _message.Request; |
| | 2115 | |
|
| | 2116 | | // Set the endpoint |
| | 2117 | | _request.Method = Azure.Core.RequestMethod.Get; |
| | 2118 | | _request.Uri.Reset(resourceUri); |
| | 2119 | | _request.Uri.AppendQuery("peekonly", "true", escapeValue: false); |
| | 2120 | | if (numberOfMessages != null) { _request.Uri.AppendQuery("numofmessages", numberOfMessages.Value.ToStrin |
| | 2121 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 2122 | |
|
| | 2123 | | // Add request headers |
| | 2124 | | _request.Headers.SetValue("x-ms-version", version); |
| | 2125 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 2126 | |
|
| | 2127 | | return _message; |
| | 2128 | | } |
| | 2129 | |
|
| | 2130 | | /// <summary> |
| | 2131 | | /// Create the Messages.PeekAsync response or throw a failure exception. |
| | 2132 | | /// </summary> |
| | 2133 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 2134 | | /// <param name="response">The raw Response.</param> |
| | 2135 | | /// <returns>The Messages.PeekAsync Azure.Response{System.Collections.Generic.IEnumerable{Azure.Storage.Queu |
| | 2136 | | internal static Azure.Response<System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.PeekedMess |
| | 2137 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2138 | | Azure.Response response) |
| | 2139 | | { |
| | 2140 | | // Process the response |
| | 2141 | | switch (response.Status) |
| | 2142 | | { |
| | 2143 | | case 200: |
| | 2144 | | { |
| | 2145 | | // Create the result |
| | 2146 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 2147 | | System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.PeekedMessage> _value = |
| | 2148 | | System.Linq.Enumerable.ToList( |
| | 2149 | | System.Linq.Enumerable.Select( |
| | 2150 | | _xml.Element(System.Xml.Linq.XName.Get("QueueMessagesList", "")).Elements(System.Xml |
| | 2151 | | Azure.Storage.Queues.Models.PeekedMessage.FromXml)); |
| | 2152 | |
|
| | 2153 | | // Create the response |
| | 2154 | | return Response.FromValue(_value, response); |
| | 2155 | | } |
| | 2156 | | case 304: |
| | 2157 | | { |
| | 2158 | | return new Azure.NoBodyResponse<System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Mode |
| | 2159 | | } |
| | 2160 | | default: |
| | 2161 | | { |
| | 2162 | | // Create the result |
| | 2163 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 2164 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 2165 | |
|
| | 2166 | | throw _value.CreateException(clientDiagnostics, response); |
| | 2167 | | } |
| | 2168 | | } |
| | 2169 | | } |
| | 2170 | | #endregion Messages.PeekAsync |
| | 2171 | | } |
| | 2172 | | #endregion Messages operations |
| | 2173 | |
|
| | 2174 | | #region MessageId operations |
| | 2175 | | /// <summary> |
| | 2176 | | /// MessageId operations for Azure Queue Storage |
| | 2177 | | /// </summary> |
| | 2178 | | public static partial class MessageId |
| | 2179 | | { |
| | 2180 | | #region MessageId.UpdateAsync |
| | 2181 | | /// <summary> |
| | 2182 | | /// The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message |
| | 2183 | | /// </summary> |
| | 2184 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 2185 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2186 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 2187 | | /// <param name="message">A Message object which can be stored in a Queue</param> |
| | 2188 | | /// <param name="popReceipt">Required. Specifies the valid pop receipt value returned from an earlier call t |
| | 2189 | | /// <param name="visibilitytimeout">Optional. Specifies the new visibility timeout value, in seconds, relati |
| | 2190 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2191 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 2192 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2193 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 2194 | | /// <param name="operationName">Operation name.</param> |
| | 2195 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 2196 | | /// <returns>Azure.Response{Azure.Storage.Queues.Models.UpdateReceipt}</returns> |
| | 2197 | | public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Queues.Models.UpdateReceip |
| | 2198 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2199 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2200 | | System.Uri resourceUri, |
| | 2201 | | Azure.Storage.Queues.Models.QueueSendMessage message, |
| | 2202 | | string popReceipt, |
| | 2203 | | int visibilitytimeout, |
| | 2204 | | string version, |
| | 2205 | | int? timeout = default, |
| | 2206 | | string requestId = default, |
| | 2207 | | bool async = true, |
| | 2208 | | string operationName = "MessageIdClient.Update", |
| | 2209 | | System.Threading.CancellationToken cancellationToken = default) |
| | 2210 | | { |
| | 2211 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 2212 | | try |
| | 2213 | | { |
| | 2214 | | _scope.AddAttribute("url", resourceUri); |
| | 2215 | | _scope.Start(); |
| | 2216 | | using (Azure.Core.HttpMessage _message = UpdateAsync_CreateMessage( |
| | 2217 | | pipeline, |
| | 2218 | | resourceUri, |
| | 2219 | | message, |
| | 2220 | | popReceipt, |
| | 2221 | | visibilitytimeout, |
| | 2222 | | version, |
| | 2223 | | timeout, |
| | 2224 | | requestId)) |
| | 2225 | | { |
| | 2226 | | if (async) |
| | 2227 | | { |
| | 2228 | | // Send the request asynchronously if we're being called via an async path |
| | 2229 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 2230 | | } |
| | 2231 | | else |
| | 2232 | | { |
| | 2233 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 2234 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 2235 | | pipeline.Send(_message, cancellationToken); |
| | 2236 | | } |
| | 2237 | | Azure.Response _response = _message.Response; |
| | 2238 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 2239 | | return UpdateAsync_CreateResponse(clientDiagnostics, _response); |
| | 2240 | | } |
| | 2241 | | } |
| | 2242 | | catch (System.Exception ex) |
| | 2243 | | { |
| | 2244 | | _scope.Failed(ex); |
| | 2245 | | throw; |
| | 2246 | | } |
| | 2247 | | finally |
| | 2248 | | { |
| | 2249 | | _scope.Dispose(); |
| | 2250 | | } |
| | 2251 | | } |
| | 2252 | |
|
| | 2253 | | /// <summary> |
| | 2254 | | /// Create the MessageId.UpdateAsync request. |
| | 2255 | | /// </summary> |
| | 2256 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2257 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 2258 | | /// <param name="message">A Message object which can be stored in a Queue</param> |
| | 2259 | | /// <param name="popReceipt">Required. Specifies the valid pop receipt value returned from an earlier call t |
| | 2260 | | /// <param name="visibilitytimeout">Optional. Specifies the new visibility timeout value, in seconds, relati |
| | 2261 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2262 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 2263 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2264 | | /// <returns>The MessageId.UpdateAsync Message.</returns> |
| | 2265 | | internal static Azure.Core.HttpMessage UpdateAsync_CreateMessage( |
| | 2266 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2267 | | System.Uri resourceUri, |
| | 2268 | | Azure.Storage.Queues.Models.QueueSendMessage message, |
| | 2269 | | string popReceipt, |
| | 2270 | | int visibilitytimeout, |
| | 2271 | | string version, |
| | 2272 | | int? timeout = default, |
| | 2273 | | string requestId = default) |
| | 2274 | | { |
| | 2275 | | // Validation |
| | 2276 | | if (resourceUri == null) |
| | 2277 | | { |
| | 2278 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 2279 | | } |
| | 2280 | | if (message == null) |
| | 2281 | | { |
| | 2282 | | throw new System.ArgumentNullException(nameof(message)); |
| | 2283 | | } |
| | 2284 | | if (popReceipt == null) |
| | 2285 | | { |
| | 2286 | | throw new System.ArgumentNullException(nameof(popReceipt)); |
| | 2287 | | } |
| | 2288 | | if (version == null) |
| | 2289 | | { |
| | 2290 | | throw new System.ArgumentNullException(nameof(version)); |
| | 2291 | | } |
| | 2292 | |
|
| | 2293 | | // Create the request |
| | 2294 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 2295 | | Azure.Core.Request _request = _message.Request; |
| | 2296 | |
|
| | 2297 | | // Set the endpoint |
| | 2298 | | _request.Method = Azure.Core.RequestMethod.Put; |
| | 2299 | | _request.Uri.Reset(resourceUri); |
| | 2300 | | _request.Uri.AppendQuery("popreceipt", popReceipt); |
| | 2301 | | _request.Uri.AppendQuery("visibilitytimeout", visibilitytimeout.ToString(System.Globalization.CultureInf |
| | 2302 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 2303 | |
|
| | 2304 | | // Add request headers |
| | 2305 | | _request.Headers.SetValue("x-ms-version", version); |
| | 2306 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 2307 | |
|
| | 2308 | | // Create the body |
| | 2309 | | System.Xml.Linq.XElement _body = Azure.Storage.Queues.Models.QueueSendMessage.ToXml(message, "QueueMessa |
| | 2310 | | string _text = _body.ToString(System.Xml.Linq.SaveOptions.DisableFormatting); |
| | 2311 | | _request.Headers.SetValue("Content-Type", "application/xml"); |
| | 2312 | | _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.Invar |
| | 2313 | | _request.Content = Azure.Core.RequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text)); |
| | 2314 | |
|
| | 2315 | | return _message; |
| | 2316 | | } |
| | 2317 | |
|
| | 2318 | | /// <summary> |
| | 2319 | | /// Create the MessageId.UpdateAsync response or throw a failure exception. |
| | 2320 | | /// </summary> |
| | 2321 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 2322 | | /// <param name="response">The raw Response.</param> |
| | 2323 | | /// <returns>The MessageId.UpdateAsync Azure.Response{Azure.Storage.Queues.Models.UpdateReceipt}.</returns> |
| | 2324 | | internal static Azure.Response<Azure.Storage.Queues.Models.UpdateReceipt> UpdateAsync_CreateResponse( |
| | 2325 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2326 | | Azure.Response response) |
| | 2327 | | { |
| | 2328 | | // Process the response |
| | 2329 | | switch (response.Status) |
| | 2330 | | { |
| | 2331 | | case 204: |
| | 2332 | | { |
| | 2333 | | // Create the result |
| | 2334 | | Azure.Storage.Queues.Models.UpdateReceipt _value = new Azure.Storage.Queues.Models.UpdateReceipt |
| | 2335 | |
|
| | 2336 | | // Get response headers |
| | 2337 | | string _header; |
| | 2338 | | if (response.Headers.TryGetValue("x-ms-popreceipt", out _header)) |
| | 2339 | | { |
| | 2340 | | _value.PopReceipt = _header; |
| | 2341 | | } |
| | 2342 | | if (response.Headers.TryGetValue("x-ms-time-next-visible", out _header)) |
| | 2343 | | { |
| | 2344 | | _value.NextVisibleOn = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo |
| | 2345 | | } |
| | 2346 | |
|
| | 2347 | | // Create the response |
| | 2348 | | return Response.FromValue(_value, response); |
| | 2349 | | } |
| | 2350 | | default: |
| | 2351 | | { |
| | 2352 | | // Create the result |
| | 2353 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 2354 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 2355 | |
|
| | 2356 | | throw _value.CreateException(clientDiagnostics, response); |
| | 2357 | | } |
| | 2358 | | } |
| | 2359 | | } |
| | 2360 | | #endregion MessageId.UpdateAsync |
| | 2361 | |
|
| | 2362 | | #region MessageId.DeleteAsync |
| | 2363 | | /// <summary> |
| | 2364 | | /// The Delete operation deletes the specified message. |
| | 2365 | | /// </summary> |
| | 2366 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param> |
| | 2367 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2368 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 2369 | | /// <param name="popReceipt">Required. Specifies the valid pop receipt value returned from an earlier call t |
| | 2370 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2371 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 2372 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2373 | | /// <param name="async">Whether to invoke the operation asynchronously. The default value is true.</param> |
| | 2374 | | /// <param name="operationName">Operation name.</param> |
| | 2375 | | /// <param name="cancellationToken">Cancellation token.</param> |
| | 2376 | | /// <returns>Azure.Response</returns> |
| | 2377 | | public static async System.Threading.Tasks.ValueTask<Azure.Response> DeleteAsync( |
| | 2378 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2379 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2380 | | System.Uri resourceUri, |
| | 2381 | | string popReceipt, |
| | 2382 | | string version, |
| | 2383 | | int? timeout = default, |
| | 2384 | | string requestId = default, |
| | 2385 | | bool async = true, |
| | 2386 | | string operationName = "MessageIdClient.Delete", |
| | 2387 | | System.Threading.CancellationToken cancellationToken = default) |
| | 2388 | | { |
| | 2389 | | Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); |
| | 2390 | | try |
| | 2391 | | { |
| | 2392 | | _scope.AddAttribute("url", resourceUri); |
| | 2393 | | _scope.Start(); |
| | 2394 | | using (Azure.Core.HttpMessage _message = DeleteAsync_CreateMessage( |
| | 2395 | | pipeline, |
| | 2396 | | resourceUri, |
| | 2397 | | popReceipt, |
| | 2398 | | version, |
| | 2399 | | timeout, |
| | 2400 | | requestId)) |
| | 2401 | | { |
| | 2402 | | if (async) |
| | 2403 | | { |
| | 2404 | | // Send the request asynchronously if we're being called via an async path |
| | 2405 | | await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); |
| | 2406 | | } |
| | 2407 | | else |
| | 2408 | | { |
| | 2409 | | // Send the request synchronously through the API that blocks if we're being called via a sy |
| | 2410 | | // (this is safe because the Task will complete before the user can call Wait) |
| | 2411 | | pipeline.Send(_message, cancellationToken); |
| | 2412 | | } |
| | 2413 | | Azure.Response _response = _message.Response; |
| | 2414 | | cancellationToken.ThrowIfCancellationRequested(); |
| | 2415 | | return DeleteAsync_CreateResponse(clientDiagnostics, _response); |
| | 2416 | | } |
| | 2417 | | } |
| | 2418 | | catch (System.Exception ex) |
| | 2419 | | { |
| | 2420 | | _scope.Failed(ex); |
| | 2421 | | throw; |
| | 2422 | | } |
| | 2423 | | finally |
| | 2424 | | { |
| | 2425 | | _scope.Dispose(); |
| | 2426 | | } |
| | 2427 | | } |
| | 2428 | |
|
| | 2429 | | /// <summary> |
| | 2430 | | /// Create the MessageId.DeleteAsync request. |
| | 2431 | | /// </summary> |
| | 2432 | | /// <param name="pipeline">The pipeline used for sending requests.</param> |
| | 2433 | | /// <param name="resourceUri">The URL of the service account, queue or message that is the targe of the desi |
| | 2434 | | /// <param name="popReceipt">Required. Specifies the valid pop receipt value returned from an earlier call t |
| | 2435 | | /// <param name="version">Specifies the version of the operation to use for this request.</param> |
| | 2436 | | /// <param name="timeout">The The timeout parameter is expressed in seconds. For more information, see <a hr |
| | 2437 | | /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re |
| | 2438 | | /// <returns>The MessageId.DeleteAsync Message.</returns> |
| | 2439 | | internal static Azure.Core.HttpMessage DeleteAsync_CreateMessage( |
| | 2440 | | Azure.Core.Pipeline.HttpPipeline pipeline, |
| | 2441 | | System.Uri resourceUri, |
| | 2442 | | string popReceipt, |
| | 2443 | | string version, |
| | 2444 | | int? timeout = default, |
| | 2445 | | string requestId = default) |
| | 2446 | | { |
| | 2447 | | // Validation |
| | 2448 | | if (resourceUri == null) |
| | 2449 | | { |
| | 2450 | | throw new System.ArgumentNullException(nameof(resourceUri)); |
| | 2451 | | } |
| | 2452 | | if (popReceipt == null) |
| | 2453 | | { |
| | 2454 | | throw new System.ArgumentNullException(nameof(popReceipt)); |
| | 2455 | | } |
| | 2456 | | if (version == null) |
| | 2457 | | { |
| | 2458 | | throw new System.ArgumentNullException(nameof(version)); |
| | 2459 | | } |
| | 2460 | |
|
| | 2461 | | // Create the request |
| | 2462 | | Azure.Core.HttpMessage _message = pipeline.CreateMessage(); |
| | 2463 | | Azure.Core.Request _request = _message.Request; |
| | 2464 | |
|
| | 2465 | | // Set the endpoint |
| | 2466 | | _request.Method = Azure.Core.RequestMethod.Delete; |
| | 2467 | | _request.Uri.Reset(resourceUri); |
| | 2468 | | _request.Uri.AppendQuery("popreceipt", popReceipt); |
| | 2469 | | if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C |
| | 2470 | |
|
| | 2471 | | // Add request headers |
| | 2472 | | _request.Headers.SetValue("x-ms-version", version); |
| | 2473 | | if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } |
| | 2474 | |
|
| | 2475 | | return _message; |
| | 2476 | | } |
| | 2477 | |
|
| | 2478 | | /// <summary> |
| | 2479 | | /// Create the MessageId.DeleteAsync response or throw a failure exception. |
| | 2480 | | /// </summary> |
| | 2481 | | /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param> |
| | 2482 | | /// <param name="response">The raw Response.</param> |
| | 2483 | | /// <returns>The MessageId.DeleteAsync Azure.Response.</returns> |
| | 2484 | | internal static Azure.Response DeleteAsync_CreateResponse( |
| | 2485 | | Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, |
| | 2486 | | Azure.Response response) |
| | 2487 | | { |
| | 2488 | | // Process the response |
| | 2489 | | switch (response.Status) |
| | 2490 | | { |
| | 2491 | | case 204: |
| | 2492 | | { |
| | 2493 | | return response; |
| | 2494 | | } |
| | 2495 | | default: |
| | 2496 | | { |
| | 2497 | | // Create the result |
| | 2498 | | System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X |
| | 2499 | | Azure.Storage.Queues.Models.StorageError _value = Azure.Storage.Queues.Models.StorageError.FromX |
| | 2500 | |
|
| | 2501 | | throw _value.CreateException(clientDiagnostics, response); |
| | 2502 | | } |
| | 2503 | | } |
| | 2504 | | } |
| | 2505 | | #endregion MessageId.DeleteAsync |
| | 2506 | | } |
| | 2507 | | #endregion MessageId operations |
| | 2508 | | } |
| | 2509 | | } |
| | 2510 | | #endregion Service |
| | 2511 | |
|
| | 2512 | | #region Models |
| | 2513 | | #region enum ListQueuesIncludeType |
| | 2514 | | namespace Azure.Storage.Queues.Models |
| | 2515 | | { |
| | 2516 | | /// <summary> |
| | 2517 | | /// ListQueuesIncludeType values |
| | 2518 | | /// </summary> |
| | 2519 | | internal enum ListQueuesIncludeType |
| | 2520 | | { |
| | 2521 | | /// <summary> |
| | 2522 | | /// metadata |
| | 2523 | | /// </summary> |
| | 2524 | | Metadata |
| | 2525 | | } |
| | 2526 | | } |
| | 2527 | |
|
| | 2528 | | namespace Azure.Storage.Queues |
| | 2529 | | { |
| | 2530 | | internal static partial class QueueRestClient |
| | 2531 | | { |
| | 2532 | | public static partial class Serialization |
| | 2533 | | { |
| | 2534 | | public static string ToString(Azure.Storage.Queues.Models.ListQueuesIncludeType value) |
| | 2535 | | { |
| | 2536 | | return value switch |
| | 2537 | | { |
| | 2538 | | Azure.Storage.Queues.Models.ListQueuesIncludeType.Metadata => "metadata", |
| | 2539 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Queue |
| | 2540 | | }; |
| | 2541 | | } |
| | 2542 | |
|
| | 2543 | | public static Azure.Storage.Queues.Models.ListQueuesIncludeType ParseListQueuesIncludeType(string value) |
| | 2544 | | { |
| | 2545 | | return value switch |
| | 2546 | | { |
| | 2547 | | "metadata" => Azure.Storage.Queues.Models.ListQueuesIncludeType.Metadata, |
| | 2548 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Queue |
| | 2549 | | }; |
| | 2550 | | } |
| | 2551 | | } |
| | 2552 | | } |
| | 2553 | | } |
| | 2554 | | #endregion enum ListQueuesIncludeType |
| | 2555 | |
|
| | 2556 | | #region class PeekedMessage |
| | 2557 | | namespace Azure.Storage.Queues.Models |
| | 2558 | | { |
| | 2559 | | /// <summary> |
| | 2560 | | /// The object returned in the QueueMessageList array when calling Peek Messages on a Queue |
| | 2561 | | /// </summary> |
| | 2562 | | public partial class PeekedMessage |
| | 2563 | | { |
| | 2564 | | /// <summary> |
| | 2565 | | /// The Id of the Message. |
| | 2566 | | /// </summary> |
| | 2567 | | public string MessageId { get; internal set; } |
| | 2568 | |
|
| | 2569 | | /// <summary> |
| | 2570 | | /// The content of the Message. |
| | 2571 | | /// </summary> |
| | 2572 | | public string MessageText { get; internal set; } |
| | 2573 | |
|
| | 2574 | | /// <summary> |
| | 2575 | | /// The time the Message was inserted into the Queue. |
| | 2576 | | /// </summary> |
| | 2577 | | public System.DateTimeOffset? InsertedOn { get; internal set; } |
| | 2578 | |
|
| | 2579 | | /// <summary> |
| | 2580 | | /// The time that the Message will expire and be automatically deleted. |
| | 2581 | | /// </summary> |
| | 2582 | | public System.DateTimeOffset? ExpiresOn { get; internal set; } |
| | 2583 | |
|
| | 2584 | | /// <summary> |
| | 2585 | | /// The number of times the message has been dequeued. |
| | 2586 | | /// </summary> |
| | 2587 | | public long DequeueCount { get; internal set; } |
| | 2588 | |
|
| | 2589 | | /// <summary> |
| | 2590 | | /// Prevent direct instantiation of PeekedMessage instances. |
| | 2591 | | /// You can use QueuesModelFactory.PeekedMessage instead. |
| | 2592 | | /// </summary> |
| | 2593 | | internal PeekedMessage() { } |
| | 2594 | |
|
| | 2595 | | /// <summary> |
| | 2596 | | /// Deserializes XML into a new PeekedMessage instance. |
| | 2597 | | /// </summary> |
| | 2598 | | /// <param name="element">The XML element to deserialize.</param> |
| | 2599 | | /// <returns>A deserialized PeekedMessage instance.</returns> |
| | 2600 | | internal static Azure.Storage.Queues.Models.PeekedMessage FromXml(System.Xml.Linq.XElement element) |
| | 2601 | | { |
| | 2602 | | System.Diagnostics.Debug.Assert(element != null); |
| | 2603 | | System.Xml.Linq.XElement _child; |
| | 2604 | | Azure.Storage.Queues.Models.PeekedMessage _value = new Azure.Storage.Queues.Models.PeekedMessage(); |
| | 2605 | | _child = element.Element(System.Xml.Linq.XName.Get("MessageId", "")); |
| | 2606 | | if (_child != null) |
| | 2607 | | { |
| | 2608 | | _value.MessageId = _child.Value; |
| | 2609 | | } |
| | 2610 | | _child = element.Element(System.Xml.Linq.XName.Get("MessageText", "")); |
| | 2611 | | if (_child != null) |
| | 2612 | | { |
| | 2613 | | _value.MessageText = _child.Value; |
| | 2614 | | } |
| | 2615 | | _child = element.Element(System.Xml.Linq.XName.Get("InsertionTime", "")); |
| | 2616 | | if (_child != null) |
| | 2617 | | { |
| | 2618 | | _value.InsertedOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Invariant |
| | 2619 | | } |
| | 2620 | | _child = element.Element(System.Xml.Linq.XName.Get("ExpirationTime", "")); |
| | 2621 | | if (_child != null) |
| | 2622 | | { |
| | 2623 | | _value.ExpiresOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.InvariantC |
| | 2624 | | } |
| | 2625 | | _child = element.Element(System.Xml.Linq.XName.Get("DequeueCount", "")); |
| | 2626 | | if (_child != null) |
| | 2627 | | { |
| | 2628 | | _value.DequeueCount = long.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); |
| | 2629 | | } |
| | 2630 | | CustomizeFromXml(element, _value); |
| | 2631 | | return _value; |
| | 2632 | | } |
| | 2633 | |
|
| | 2634 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.PeekedMessage |
| | 2635 | | } |
| | 2636 | |
|
| | 2637 | | /// <summary> |
| | 2638 | | /// QueuesModelFactory provides utilities for mocking. |
| | 2639 | | /// </summary> |
| | 2640 | | public static partial class QueuesModelFactory |
| | 2641 | | { |
| | 2642 | | /// <summary> |
| | 2643 | | /// Creates a new PeekedMessage instance for mocking. |
| | 2644 | | /// </summary> |
| | 2645 | | public static PeekedMessage PeekedMessage( |
| | 2646 | | string messageId, |
| | 2647 | | string messageText, |
| | 2648 | | long dequeueCount, |
| | 2649 | | System.DateTimeOffset? insertedOn = default, |
| | 2650 | | System.DateTimeOffset? expiresOn = default) |
| | 2651 | | { |
| | 2652 | | return new PeekedMessage() |
| | 2653 | | { |
| | 2654 | | MessageId = messageId, |
| | 2655 | | MessageText = messageText, |
| | 2656 | | DequeueCount = dequeueCount, |
| | 2657 | | InsertedOn = insertedOn, |
| | 2658 | | ExpiresOn = expiresOn, |
| | 2659 | | }; |
| | 2660 | | } |
| | 2661 | | } |
| | 2662 | | } |
| | 2663 | | #endregion class PeekedMessage |
| | 2664 | |
|
| | 2665 | | #region class QueueAccessPolicy |
| | 2666 | | namespace Azure.Storage.Queues.Models |
| | 2667 | | { |
| | 2668 | | /// <summary> |
| | 2669 | | /// An Access policy |
| | 2670 | | /// </summary> |
| | 2671 | | public partial class QueueAccessPolicy |
| | 2672 | | { |
| | 2673 | | /// <summary> |
| | 2674 | | /// the date-time the policy is active |
| | 2675 | | /// </summary> |
| | 2676 | | public System.DateTimeOffset? StartsOn { get; set; } |
| | 2677 | |
|
| | 2678 | | /// <summary> |
| | 2679 | | /// the date-time the policy expires |
| | 2680 | | /// </summary> |
| | 2681 | | public System.DateTimeOffset? ExpiresOn { get; set; } |
| | 2682 | |
|
| | 2683 | | /// <summary> |
| | 2684 | | /// the permissions for the acl policy |
| | 2685 | | /// </summary> |
| | 2686 | | public string Permissions { get; set; } |
| | 2687 | |
|
| | 2688 | | /// <summary> |
| | 2689 | | /// Creates a new QueueAccessPolicy instance |
| | 2690 | | /// </summary> |
| | 2691 | | public QueueAccessPolicy() { } |
| | 2692 | |
|
| | 2693 | | /// <summary> |
| | 2694 | | /// Serialize a QueueAccessPolicy instance as XML. |
| | 2695 | | /// </summary> |
| | 2696 | | /// <param name="value">The QueueAccessPolicy instance to serialize.</param> |
| | 2697 | | /// <param name="name">An optional name to use for the root element instead of "AccessPolicy".</param> |
| | 2698 | | /// <param name="ns">An optional namespace to use for the root element instead of "".</param> |
| | 2699 | | /// <returns>The serialized XML element.</returns> |
| | 2700 | | internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Queues.Models.QueueAccessPolicy value, string name |
| | 2701 | | { |
| | 2702 | | System.Diagnostics.Debug.Assert(value != null); |
| | 2703 | | System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); |
| | 2704 | | if (value.StartsOn != null) |
| | 2705 | | { |
| | 2706 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2707 | | System.Xml.Linq.XName.Get("Start", ""), |
| | 2708 | | value.StartsOn.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffZ", System.Globalization.Culture |
| | 2709 | | } |
| | 2710 | | if (value.ExpiresOn != null) |
| | 2711 | | { |
| | 2712 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2713 | | System.Xml.Linq.XName.Get("Expiry", ""), |
| | 2714 | | value.ExpiresOn.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffZ", System.Globalization.Cultur |
| | 2715 | | } |
| | 2716 | | if (value.Permissions != null) |
| | 2717 | | { |
| | 2718 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2719 | | System.Xml.Linq.XName.Get("Permission", ""), |
| | 2720 | | value.Permissions)); |
| | 2721 | | } |
| | 2722 | | return _element; |
| | 2723 | | } |
| | 2724 | |
|
| | 2725 | | /// <summary> |
| | 2726 | | /// Deserializes XML into a new QueueAccessPolicy instance. |
| | 2727 | | /// </summary> |
| | 2728 | | /// <param name="element">The XML element to deserialize.</param> |
| | 2729 | | /// <returns>A deserialized QueueAccessPolicy instance.</returns> |
| | 2730 | | internal static Azure.Storage.Queues.Models.QueueAccessPolicy FromXml(System.Xml.Linq.XElement element) |
| | 2731 | | { |
| | 2732 | | System.Diagnostics.Debug.Assert(element != null); |
| | 2733 | | System.Xml.Linq.XElement _child; |
| | 2734 | | Azure.Storage.Queues.Models.QueueAccessPolicy _value = new Azure.Storage.Queues.Models.QueueAccessPolicy(); |
| | 2735 | | _child = element.Element(System.Xml.Linq.XName.Get("Start", "")); |
| | 2736 | | if (_child != null) |
| | 2737 | | { |
| | 2738 | | _value.StartsOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCu |
| | 2739 | | } |
| | 2740 | | _child = element.Element(System.Xml.Linq.XName.Get("Expiry", "")); |
| | 2741 | | if (_child != null) |
| | 2742 | | { |
| | 2743 | | _value.ExpiresOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.InvariantC |
| | 2744 | | } |
| | 2745 | | _child = element.Element(System.Xml.Linq.XName.Get("Permission", "")); |
| | 2746 | | if (_child != null) |
| | 2747 | | { |
| | 2748 | | _value.Permissions = _child.Value; |
| | 2749 | | } |
| | 2750 | | CustomizeFromXml(element, _value); |
| | 2751 | | return _value; |
| | 2752 | | } |
| | 2753 | |
|
| | 2754 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueAccessPo |
| | 2755 | | } |
| | 2756 | | } |
| | 2757 | | #endregion class QueueAccessPolicy |
| | 2758 | |
|
| | 2759 | | #region class QueueAnalyticsLogging |
| | 2760 | | namespace Azure.Storage.Queues.Models |
| | 2761 | | { |
| | 2762 | | /// <summary> |
| | 2763 | | /// Azure Analytics Logging settings. |
| | 2764 | | /// </summary> |
| | 2765 | | public partial class QueueAnalyticsLogging |
| | 2766 | | { |
| | 2767 | | /// <summary> |
| | 2768 | | /// The version of Storage Analytics to configure. |
| | 2769 | | /// </summary> |
| | 2770 | | public string Version { get; set; } |
| | 2771 | |
|
| | 2772 | | /// <summary> |
| | 2773 | | /// Indicates whether all delete requests should be logged. |
| | 2774 | | /// </summary> |
| | 2775 | | public bool Delete { get; set; } |
| | 2776 | |
|
| | 2777 | | /// <summary> |
| | 2778 | | /// Indicates whether all read requests should be logged. |
| | 2779 | | /// </summary> |
| | 2780 | | public bool Read { get; set; } |
| | 2781 | |
|
| | 2782 | | /// <summary> |
| | 2783 | | /// Indicates whether all write requests should be logged. |
| | 2784 | | /// </summary> |
| | 2785 | | public bool Write { get; set; } |
| | 2786 | |
|
| | 2787 | | /// <summary> |
| | 2788 | | /// the retention policy |
| | 2789 | | /// </summary> |
| | 2790 | | public Azure.Storage.Queues.Models.QueueRetentionPolicy RetentionPolicy { get; set; } |
| | 2791 | |
|
| | 2792 | | /// <summary> |
| | 2793 | | /// Creates a new QueueAnalyticsLogging instance |
| | 2794 | | /// </summary> |
| | 2795 | | public QueueAnalyticsLogging() |
| | 2796 | | : this(false) |
| | 2797 | | { |
| | 2798 | | } |
| | 2799 | |
|
| | 2800 | | /// <summary> |
| | 2801 | | /// Creates a new QueueAnalyticsLogging instance |
| | 2802 | | /// </summary> |
| | 2803 | | /// <param name="skipInitialization">Whether to skip initializing nested objects.</param> |
| | 2804 | | internal QueueAnalyticsLogging(bool skipInitialization) |
| | 2805 | | { |
| | 2806 | | if (!skipInitialization) |
| | 2807 | | { |
| | 2808 | | RetentionPolicy = new Azure.Storage.Queues.Models.QueueRetentionPolicy(); |
| | 2809 | | } |
| | 2810 | | } |
| | 2811 | |
|
| | 2812 | | /// <summary> |
| | 2813 | | /// Serialize a QueueAnalyticsLogging instance as XML. |
| | 2814 | | /// </summary> |
| | 2815 | | /// <param name="value">The QueueAnalyticsLogging instance to serialize.</param> |
| | 2816 | | /// <param name="name">An optional name to use for the root element instead of "Logging".</param> |
| | 2817 | | /// <param name="ns">An optional namespace to use for the root element instead of "".</param> |
| | 2818 | | /// <returns>The serialized XML element.</returns> |
| | 2819 | | internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Queues.Models.QueueAnalyticsLogging value, string n |
| | 2820 | | { |
| | 2821 | | System.Diagnostics.Debug.Assert(value != null); |
| | 2822 | | System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); |
| | 2823 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2824 | | System.Xml.Linq.XName.Get("Version", ""), |
| | 2825 | | value.Version)); |
| | 2826 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2827 | | System.Xml.Linq.XName.Get("Delete", ""), |
| | 2828 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 2829 | | value.Delete.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant())); |
| | 2830 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 2831 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2832 | | System.Xml.Linq.XName.Get("Read", ""), |
| | 2833 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 2834 | | value.Read.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant())); |
| | 2835 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 2836 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2837 | | System.Xml.Linq.XName.Get("Write", ""), |
| | 2838 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 2839 | | value.Write.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant())); |
| | 2840 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 2841 | | _element.Add(Azure.Storage.Queues.Models.QueueRetentionPolicy.ToXml(value.RetentionPolicy, "RetentionPolicy" |
| | 2842 | | return _element; |
| | 2843 | | } |
| | 2844 | |
|
| | 2845 | | /// <summary> |
| | 2846 | | /// Deserializes XML into a new QueueAnalyticsLogging instance. |
| | 2847 | | /// </summary> |
| | 2848 | | /// <param name="element">The XML element to deserialize.</param> |
| | 2849 | | /// <returns>A deserialized QueueAnalyticsLogging instance.</returns> |
| | 2850 | | internal static Azure.Storage.Queues.Models.QueueAnalyticsLogging FromXml(System.Xml.Linq.XElement element) |
| | 2851 | | { |
| | 2852 | | System.Diagnostics.Debug.Assert(element != null); |
| | 2853 | | System.Xml.Linq.XElement _child; |
| | 2854 | | Azure.Storage.Queues.Models.QueueAnalyticsLogging _value = new Azure.Storage.Queues.Models.QueueAnalyticsLog |
| | 2855 | | _child = element.Element(System.Xml.Linq.XName.Get("Version", "")); |
| | 2856 | | if (_child != null) |
| | 2857 | | { |
| | 2858 | | _value.Version = _child.Value; |
| | 2859 | | } |
| | 2860 | | _child = element.Element(System.Xml.Linq.XName.Get("Delete", "")); |
| | 2861 | | if (_child != null) |
| | 2862 | | { |
| | 2863 | | _value.Delete = bool.Parse(_child.Value); |
| | 2864 | | } |
| | 2865 | | _child = element.Element(System.Xml.Linq.XName.Get("Read", "")); |
| | 2866 | | if (_child != null) |
| | 2867 | | { |
| | 2868 | | _value.Read = bool.Parse(_child.Value); |
| | 2869 | | } |
| | 2870 | | _child = element.Element(System.Xml.Linq.XName.Get("Write", "")); |
| | 2871 | | if (_child != null) |
| | 2872 | | { |
| | 2873 | | _value.Write = bool.Parse(_child.Value); |
| | 2874 | | } |
| | 2875 | | _child = element.Element(System.Xml.Linq.XName.Get("RetentionPolicy", "")); |
| | 2876 | | if (_child != null) |
| | 2877 | | { |
| | 2878 | | _value.RetentionPolicy = Azure.Storage.Queues.Models.QueueRetentionPolicy.FromXml(_child); |
| | 2879 | | } |
| | 2880 | | CustomizeFromXml(element, _value); |
| | 2881 | | return _value; |
| | 2882 | | } |
| | 2883 | |
|
| | 2884 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueAnalytic |
| | 2885 | | } |
| | 2886 | | } |
| | 2887 | | #endregion class QueueAnalyticsLogging |
| | 2888 | |
|
| | 2889 | | #region class QueueCorsRule |
| | 2890 | | namespace Azure.Storage.Queues.Models |
| | 2891 | | { |
| | 2892 | | /// <summary> |
| | 2893 | | /// CORS is an HTTP feature that enables a web application running under one domain to access resources in another d |
| | 2894 | | /// </summary> |
| | 2895 | | public partial class QueueCorsRule |
| | 2896 | | { |
| | 2897 | | /// <summary> |
| | 2898 | | /// The origin domains that are permitted to make a request against the storage service via CORS. The origin dom |
| | 2899 | | /// </summary> |
| | 2900 | | public string AllowedOrigins { get; set; } |
| | 2901 | |
|
| | 2902 | | /// <summary> |
| | 2903 | | /// The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated) |
| | 2904 | | /// </summary> |
| | 2905 | | public string AllowedMethods { get; set; } |
| | 2906 | |
|
| | 2907 | | /// <summary> |
| | 2908 | | /// the request headers that the origin domain may specify on the CORS request. |
| | 2909 | | /// </summary> |
| | 2910 | | public string AllowedHeaders { get; set; } |
| | 2911 | |
|
| | 2912 | | /// <summary> |
| | 2913 | | /// The response headers that may be sent in the response to the CORS request and exposed by the browser to the |
| | 2914 | | /// </summary> |
| | 2915 | | public string ExposedHeaders { get; set; } |
| | 2916 | |
|
| | 2917 | | /// <summary> |
| | 2918 | | /// The maximum amount time that a browser should cache the preflight OPTIONS request. |
| | 2919 | | /// </summary> |
| | 2920 | | public int MaxAgeInSeconds { get; set; } |
| | 2921 | |
|
| | 2922 | | /// <summary> |
| | 2923 | | /// Creates a new QueueCorsRule instance |
| | 2924 | | /// </summary> |
| | 2925 | | public QueueCorsRule() { } |
| | 2926 | |
|
| | 2927 | | /// <summary> |
| | 2928 | | /// Serialize a QueueCorsRule instance as XML. |
| | 2929 | | /// </summary> |
| | 2930 | | /// <param name="value">The QueueCorsRule instance to serialize.</param> |
| | 2931 | | /// <param name="name">An optional name to use for the root element instead of "CorsRule".</param> |
| | 2932 | | /// <param name="ns">An optional namespace to use for the root element instead of "".</param> |
| | 2933 | | /// <returns>The serialized XML element.</returns> |
| | 2934 | | internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Queues.Models.QueueCorsRule value, string name = "C |
| | 2935 | | { |
| | 2936 | | System.Diagnostics.Debug.Assert(value != null); |
| | 2937 | | System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); |
| | 2938 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2939 | | System.Xml.Linq.XName.Get("AllowedOrigins", ""), |
| | 2940 | | value.AllowedOrigins)); |
| | 2941 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2942 | | System.Xml.Linq.XName.Get("AllowedMethods", ""), |
| | 2943 | | value.AllowedMethods)); |
| | 2944 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2945 | | System.Xml.Linq.XName.Get("AllowedHeaders", ""), |
| | 2946 | | value.AllowedHeaders)); |
| | 2947 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2948 | | System.Xml.Linq.XName.Get("ExposedHeaders", ""), |
| | 2949 | | value.ExposedHeaders)); |
| | 2950 | | _element.Add(new System.Xml.Linq.XElement( |
| | 2951 | | System.Xml.Linq.XName.Get("MaxAgeInSeconds", ""), |
| | 2952 | | value.MaxAgeInSeconds.ToString(System.Globalization.CultureInfo.InvariantCulture))); |
| | 2953 | | return _element; |
| | 2954 | | } |
| | 2955 | |
|
| | 2956 | | /// <summary> |
| | 2957 | | /// Deserializes XML into a new QueueCorsRule instance. |
| | 2958 | | /// </summary> |
| | 2959 | | /// <param name="element">The XML element to deserialize.</param> |
| | 2960 | | /// <returns>A deserialized QueueCorsRule instance.</returns> |
| | 2961 | | internal static Azure.Storage.Queues.Models.QueueCorsRule FromXml(System.Xml.Linq.XElement element) |
| | 2962 | | { |
| | 2963 | | System.Diagnostics.Debug.Assert(element != null); |
| | 2964 | | System.Xml.Linq.XElement _child; |
| | 2965 | | Azure.Storage.Queues.Models.QueueCorsRule _value = new Azure.Storage.Queues.Models.QueueCorsRule(); |
| | 2966 | | _child = element.Element(System.Xml.Linq.XName.Get("AllowedOrigins", "")); |
| | 2967 | | if (_child != null) |
| | 2968 | | { |
| | 2969 | | _value.AllowedOrigins = _child.Value; |
| | 2970 | | } |
| | 2971 | | _child = element.Element(System.Xml.Linq.XName.Get("AllowedMethods", "")); |
| | 2972 | | if (_child != null) |
| | 2973 | | { |
| | 2974 | | _value.AllowedMethods = _child.Value; |
| | 2975 | | } |
| | 2976 | | _child = element.Element(System.Xml.Linq.XName.Get("AllowedHeaders", "")); |
| | 2977 | | if (_child != null) |
| | 2978 | | { |
| | 2979 | | _value.AllowedHeaders = _child.Value; |
| | 2980 | | } |
| | 2981 | | _child = element.Element(System.Xml.Linq.XName.Get("ExposedHeaders", "")); |
| | 2982 | | if (_child != null) |
| | 2983 | | { |
| | 2984 | | _value.ExposedHeaders = _child.Value; |
| | 2985 | | } |
| | 2986 | | _child = element.Element(System.Xml.Linq.XName.Get("MaxAgeInSeconds", "")); |
| | 2987 | | if (_child != null) |
| | 2988 | | { |
| | 2989 | | _value.MaxAgeInSeconds = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); |
| | 2990 | | } |
| | 2991 | | CustomizeFromXml(element, _value); |
| | 2992 | | return _value; |
| | 2993 | | } |
| | 2994 | |
|
| | 2995 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueCorsRule |
| | 2996 | | } |
| | 2997 | | } |
| | 2998 | | #endregion class QueueCorsRule |
| | 2999 | |
|
| | 3000 | | #region enum strings QueueErrorCode |
| | 3001 | | namespace Azure.Storage.Queues.Models |
| | 3002 | | { |
| | 3003 | | /// <summary> |
| | 3004 | | /// Error codes returned by the service |
| | 3005 | | /// </summary> |
| | 3006 | | public readonly struct QueueErrorCode : System.IEquatable<QueueErrorCode> |
| | 3007 | | { |
| | 3008 | | /// <summary> |
| | 3009 | | /// The QueueErrorCode value. |
| | 3010 | | /// </summary> |
| | 3011 | | private readonly string _value; |
| | 3012 | |
|
| | 3013 | | /// <summary> |
| | 3014 | | /// Initializes a new instance of the <see cref="QueueErrorCode"/> structure. |
| | 3015 | | /// </summary> |
| | 3016 | | /// <param name="value">The string value of the instance.</param> |
| | 3017 | | public QueueErrorCode(string value) { _value = value ?? throw new System.ArgumentNullException(nameof(value)); } |
| | 3018 | |
|
| | 3019 | | /// <summary> |
| | 3020 | | /// AccountAlreadyExists |
| | 3021 | | /// </summary> |
| | 3022 | | public static Azure.Storage.Queues.Models.QueueErrorCode AccountAlreadyExists { get; } = new QueueErrorCode(@"Ac |
| | 3023 | |
|
| | 3024 | | /// <summary> |
| | 3025 | | /// AccountBeingCreated |
| | 3026 | | /// </summary> |
| | 3027 | | public static Azure.Storage.Queues.Models.QueueErrorCode AccountBeingCreated { get; } = new QueueErrorCode(@"Acc |
| | 3028 | |
|
| | 3029 | | /// <summary> |
| | 3030 | | /// AccountIsDisabled |
| | 3031 | | /// </summary> |
| | 3032 | | public static Azure.Storage.Queues.Models.QueueErrorCode AccountIsDisabled { get; } = new QueueErrorCode(@"Accou |
| | 3033 | |
|
| | 3034 | | /// <summary> |
| | 3035 | | /// AuthenticationFailed |
| | 3036 | | /// </summary> |
| | 3037 | | public static Azure.Storage.Queues.Models.QueueErrorCode AuthenticationFailed { get; } = new QueueErrorCode(@"Au |
| | 3038 | |
|
| | 3039 | | /// <summary> |
| | 3040 | | /// AuthorizationFailure |
| | 3041 | | /// </summary> |
| | 3042 | | public static Azure.Storage.Queues.Models.QueueErrorCode AuthorizationFailure { get; } = new QueueErrorCode(@"Au |
| | 3043 | |
|
| | 3044 | | /// <summary> |
| | 3045 | | /// ConditionHeadersNotSupported |
| | 3046 | | /// </summary> |
| | 3047 | | public static Azure.Storage.Queues.Models.QueueErrorCode ConditionHeadersNotSupported { get; } = new QueueErrorC |
| | 3048 | |
|
| | 3049 | | /// <summary> |
| | 3050 | | /// ConditionNotMet |
| | 3051 | | /// </summary> |
| | 3052 | | public static Azure.Storage.Queues.Models.QueueErrorCode ConditionNotMet { get; } = new QueueErrorCode(@"Conditi |
| | 3053 | |
|
| | 3054 | | /// <summary> |
| | 3055 | | /// EmptyMetadataKey |
| | 3056 | | /// </summary> |
| | 3057 | | public static Azure.Storage.Queues.Models.QueueErrorCode EmptyMetadataKey { get; } = new QueueErrorCode(@"EmptyM |
| | 3058 | |
|
| | 3059 | | /// <summary> |
| | 3060 | | /// InsufficientAccountPermissions |
| | 3061 | | /// </summary> |
| | 3062 | | public static Azure.Storage.Queues.Models.QueueErrorCode InsufficientAccountPermissions { get; } = new QueueErro |
| | 3063 | |
|
| | 3064 | | /// <summary> |
| | 3065 | | /// InternalError |
| | 3066 | | /// </summary> |
| | 3067 | | public static Azure.Storage.Queues.Models.QueueErrorCode InternalError { get; } = new QueueErrorCode(@"InternalE |
| | 3068 | |
|
| | 3069 | | /// <summary> |
| | 3070 | | /// InvalidAuthenticationInfo |
| | 3071 | | /// </summary> |
| | 3072 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidAuthenticationInfo { get; } = new QueueErrorCode |
| | 3073 | |
|
| | 3074 | | /// <summary> |
| | 3075 | | /// InvalidHeaderValue |
| | 3076 | | /// </summary> |
| | 3077 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidHeaderValue { get; } = new QueueErrorCode(@"Inva |
| | 3078 | |
|
| | 3079 | | /// <summary> |
| | 3080 | | /// InvalidHttpVerb |
| | 3081 | | /// </summary> |
| | 3082 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidHttpVerb { get; } = new QueueErrorCode(@"Invalid |
| | 3083 | |
|
| | 3084 | | /// <summary> |
| | 3085 | | /// InvalidInput |
| | 3086 | | /// </summary> |
| | 3087 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidInput { get; } = new QueueErrorCode(@"InvalidInp |
| | 3088 | |
|
| | 3089 | | /// <summary> |
| | 3090 | | /// InvalidMd5 |
| | 3091 | | /// </summary> |
| | 3092 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidMd5 { get; } = new QueueErrorCode(@"InvalidMd5") |
| | 3093 | |
|
| | 3094 | | /// <summary> |
| | 3095 | | /// InvalidMetadata |
| | 3096 | | /// </summary> |
| | 3097 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidMetadata { get; } = new QueueErrorCode(@"Invalid |
| | 3098 | |
|
| | 3099 | | /// <summary> |
| | 3100 | | /// InvalidQueryParameterValue |
| | 3101 | | /// </summary> |
| | 3102 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidQueryParameterValue { get; } = new QueueErrorCod |
| | 3103 | |
|
| | 3104 | | /// <summary> |
| | 3105 | | /// InvalidRange |
| | 3106 | | /// </summary> |
| | 3107 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidRange { get; } = new QueueErrorCode(@"InvalidRan |
| | 3108 | |
|
| | 3109 | | /// <summary> |
| | 3110 | | /// InvalidResourceName |
| | 3111 | | /// </summary> |
| | 3112 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidResourceName { get; } = new QueueErrorCode(@"Inv |
| | 3113 | |
|
| | 3114 | | /// <summary> |
| | 3115 | | /// InvalidUri |
| | 3116 | | /// </summary> |
| | 3117 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidUri { get; } = new QueueErrorCode(@"InvalidUri") |
| | 3118 | |
|
| | 3119 | | /// <summary> |
| | 3120 | | /// InvalidXmlDocument |
| | 3121 | | /// </summary> |
| | 3122 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidXmlDocument { get; } = new QueueErrorCode(@"Inva |
| | 3123 | |
|
| | 3124 | | /// <summary> |
| | 3125 | | /// InvalidXmlNodeValue |
| | 3126 | | /// </summary> |
| | 3127 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidXmlNodeValue { get; } = new QueueErrorCode(@"Inv |
| | 3128 | |
|
| | 3129 | | /// <summary> |
| | 3130 | | /// Md5Mismatch |
| | 3131 | | /// </summary> |
| | 3132 | | public static Azure.Storage.Queues.Models.QueueErrorCode Md5Mismatch { get; } = new QueueErrorCode(@"Md5Mismatch |
| | 3133 | |
|
| | 3134 | | /// <summary> |
| | 3135 | | /// MetadataTooLarge |
| | 3136 | | /// </summary> |
| | 3137 | | public static Azure.Storage.Queues.Models.QueueErrorCode MetadataTooLarge { get; } = new QueueErrorCode(@"Metada |
| | 3138 | |
|
| | 3139 | | /// <summary> |
| | 3140 | | /// MissingContentLengthHeader |
| | 3141 | | /// </summary> |
| | 3142 | | public static Azure.Storage.Queues.Models.QueueErrorCode MissingContentLengthHeader { get; } = new QueueErrorCod |
| | 3143 | |
|
| | 3144 | | /// <summary> |
| | 3145 | | /// MissingRequiredQueryParameter |
| | 3146 | | /// </summary> |
| | 3147 | | public static Azure.Storage.Queues.Models.QueueErrorCode MissingRequiredQueryParameter { get; } = new QueueError |
| | 3148 | |
|
| | 3149 | | /// <summary> |
| | 3150 | | /// MissingRequiredHeader |
| | 3151 | | /// </summary> |
| | 3152 | | public static Azure.Storage.Queues.Models.QueueErrorCode MissingRequiredHeader { get; } = new QueueErrorCode(@"M |
| | 3153 | |
|
| | 3154 | | /// <summary> |
| | 3155 | | /// MissingRequiredXmlNode |
| | 3156 | | /// </summary> |
| | 3157 | | public static Azure.Storage.Queues.Models.QueueErrorCode MissingRequiredXmlNode { get; } = new QueueErrorCode(@" |
| | 3158 | |
|
| | 3159 | | /// <summary> |
| | 3160 | | /// MultipleConditionHeadersNotSupported |
| | 3161 | | /// </summary> |
| | 3162 | | public static Azure.Storage.Queues.Models.QueueErrorCode MultipleConditionHeadersNotSupported { get; } = new Que |
| | 3163 | |
|
| | 3164 | | /// <summary> |
| | 3165 | | /// OperationTimedOut |
| | 3166 | | /// </summary> |
| | 3167 | | public static Azure.Storage.Queues.Models.QueueErrorCode OperationTimedOut { get; } = new QueueErrorCode(@"Opera |
| | 3168 | |
|
| | 3169 | | /// <summary> |
| | 3170 | | /// OutOfRangeInput |
| | 3171 | | /// </summary> |
| | 3172 | | public static Azure.Storage.Queues.Models.QueueErrorCode OutOfRangeInput { get; } = new QueueErrorCode(@"OutOfRa |
| | 3173 | |
|
| | 3174 | | /// <summary> |
| | 3175 | | /// OutOfRangeQueryParameterValue |
| | 3176 | | /// </summary> |
| | 3177 | | public static Azure.Storage.Queues.Models.QueueErrorCode OutOfRangeQueryParameterValue { get; } = new QueueError |
| | 3178 | |
|
| | 3179 | | /// <summary> |
| | 3180 | | /// RequestBodyTooLarge |
| | 3181 | | /// </summary> |
| | 3182 | | public static Azure.Storage.Queues.Models.QueueErrorCode RequestBodyTooLarge { get; } = new QueueErrorCode(@"Req |
| | 3183 | |
|
| | 3184 | | /// <summary> |
| | 3185 | | /// ResourceTypeMismatch |
| | 3186 | | /// </summary> |
| | 3187 | | public static Azure.Storage.Queues.Models.QueueErrorCode ResourceTypeMismatch { get; } = new QueueErrorCode(@"Re |
| | 3188 | |
|
| | 3189 | | /// <summary> |
| | 3190 | | /// RequestUrlFailedToParse |
| | 3191 | | /// </summary> |
| | 3192 | | public static Azure.Storage.Queues.Models.QueueErrorCode RequestUrlFailedToParse { get; } = new QueueErrorCode(@ |
| | 3193 | |
|
| | 3194 | | /// <summary> |
| | 3195 | | /// ResourceAlreadyExists |
| | 3196 | | /// </summary> |
| | 3197 | | public static Azure.Storage.Queues.Models.QueueErrorCode ResourceAlreadyExists { get; } = new QueueErrorCode(@"R |
| | 3198 | |
|
| | 3199 | | /// <summary> |
| | 3200 | | /// ResourceNotFound |
| | 3201 | | /// </summary> |
| | 3202 | | public static Azure.Storage.Queues.Models.QueueErrorCode ResourceNotFound { get; } = new QueueErrorCode(@"Resour |
| | 3203 | |
|
| | 3204 | | /// <summary> |
| | 3205 | | /// ServerBusy |
| | 3206 | | /// </summary> |
| | 3207 | | public static Azure.Storage.Queues.Models.QueueErrorCode ServerBusy { get; } = new QueueErrorCode(@"ServerBusy") |
| | 3208 | |
|
| | 3209 | | /// <summary> |
| | 3210 | | /// UnsupportedHeader |
| | 3211 | | /// </summary> |
| | 3212 | | public static Azure.Storage.Queues.Models.QueueErrorCode UnsupportedHeader { get; } = new QueueErrorCode(@"Unsup |
| | 3213 | |
|
| | 3214 | | /// <summary> |
| | 3215 | | /// UnsupportedXmlNode |
| | 3216 | | /// </summary> |
| | 3217 | | public static Azure.Storage.Queues.Models.QueueErrorCode UnsupportedXmlNode { get; } = new QueueErrorCode(@"Unsu |
| | 3218 | |
|
| | 3219 | | /// <summary> |
| | 3220 | | /// UnsupportedQueryParameter |
| | 3221 | | /// </summary> |
| | 3222 | | public static Azure.Storage.Queues.Models.QueueErrorCode UnsupportedQueryParameter { get; } = new QueueErrorCode |
| | 3223 | |
|
| | 3224 | | /// <summary> |
| | 3225 | | /// UnsupportedHttpVerb |
| | 3226 | | /// </summary> |
| | 3227 | | public static Azure.Storage.Queues.Models.QueueErrorCode UnsupportedHttpVerb { get; } = new QueueErrorCode(@"Uns |
| | 3228 | |
|
| | 3229 | | /// <summary> |
| | 3230 | | /// InvalidMarker |
| | 3231 | | /// </summary> |
| | 3232 | | public static Azure.Storage.Queues.Models.QueueErrorCode InvalidMarker { get; } = new QueueErrorCode(@"InvalidMa |
| | 3233 | |
|
| | 3234 | | /// <summary> |
| | 3235 | | /// MessageNotFound |
| | 3236 | | /// </summary> |
| | 3237 | | public static Azure.Storage.Queues.Models.QueueErrorCode MessageNotFound { get; } = new QueueErrorCode(@"Message |
| | 3238 | |
|
| | 3239 | | /// <summary> |
| | 3240 | | /// MessageTooLarge |
| | 3241 | | /// </summary> |
| | 3242 | | public static Azure.Storage.Queues.Models.QueueErrorCode MessageTooLarge { get; } = new QueueErrorCode(@"Message |
| | 3243 | |
|
| | 3244 | | /// <summary> |
| | 3245 | | /// PopReceiptMismatch |
| | 3246 | | /// </summary> |
| | 3247 | | public static Azure.Storage.Queues.Models.QueueErrorCode PopReceiptMismatch { get; } = new QueueErrorCode(@"PopR |
| | 3248 | |
|
| | 3249 | | /// <summary> |
| | 3250 | | /// QueueAlreadyExists |
| | 3251 | | /// </summary> |
| | 3252 | | public static Azure.Storage.Queues.Models.QueueErrorCode QueueAlreadyExists { get; } = new QueueErrorCode(@"Queu |
| | 3253 | |
|
| | 3254 | | /// <summary> |
| | 3255 | | /// QueueBeingDeleted |
| | 3256 | | /// </summary> |
| | 3257 | | public static Azure.Storage.Queues.Models.QueueErrorCode QueueBeingDeleted { get; } = new QueueErrorCode(@"Queue |
| | 3258 | |
|
| | 3259 | | /// <summary> |
| | 3260 | | /// QueueDisabled |
| | 3261 | | /// </summary> |
| | 3262 | | public static Azure.Storage.Queues.Models.QueueErrorCode QueueDisabled { get; } = new QueueErrorCode(@"QueueDisa |
| | 3263 | |
|
| | 3264 | | /// <summary> |
| | 3265 | | /// QueueNotEmpty |
| | 3266 | | /// </summary> |
| | 3267 | | public static Azure.Storage.Queues.Models.QueueErrorCode QueueNotEmpty { get; } = new QueueErrorCode(@"QueueNotE |
| | 3268 | |
|
| | 3269 | | /// <summary> |
| | 3270 | | /// QueueNotFound |
| | 3271 | | /// </summary> |
| | 3272 | | public static Azure.Storage.Queues.Models.QueueErrorCode QueueNotFound { get; } = new QueueErrorCode(@"QueueNotF |
| | 3273 | |
|
| | 3274 | | /// <summary> |
| | 3275 | | /// AuthorizationSourceIPMismatch |
| | 3276 | | /// </summary> |
| | 3277 | | public static Azure.Storage.Queues.Models.QueueErrorCode AuthorizationSourceIPMismatch { get; } = new QueueError |
| | 3278 | |
|
| | 3279 | | /// <summary> |
| | 3280 | | /// AuthorizationProtocolMismatch |
| | 3281 | | /// </summary> |
| | 3282 | | public static Azure.Storage.Queues.Models.QueueErrorCode AuthorizationProtocolMismatch { get; } = new QueueError |
| | 3283 | |
|
| | 3284 | | /// <summary> |
| | 3285 | | /// AuthorizationPermissionMismatch |
| | 3286 | | /// </summary> |
| | 3287 | | public static Azure.Storage.Queues.Models.QueueErrorCode AuthorizationPermissionMismatch { get; } = new QueueErr |
| | 3288 | |
|
| | 3289 | | /// <summary> |
| | 3290 | | /// AuthorizationServiceMismatch |
| | 3291 | | /// </summary> |
| | 3292 | | public static Azure.Storage.Queues.Models.QueueErrorCode AuthorizationServiceMismatch { get; } = new QueueErrorC |
| | 3293 | |
|
| | 3294 | | /// <summary> |
| | 3295 | | /// AuthorizationResourceTypeMismatch |
| | 3296 | | /// </summary> |
| | 3297 | | public static Azure.Storage.Queues.Models.QueueErrorCode AuthorizationResourceTypeMismatch { get; } = new QueueE |
| | 3298 | |
|
| | 3299 | | /// <summary> |
| | 3300 | | /// FeatureVersionMismatch |
| | 3301 | | /// </summary> |
| | 3302 | | public static Azure.Storage.Queues.Models.QueueErrorCode FeatureVersionMismatch { get; } = new QueueErrorCode(@" |
| | 3303 | |
|
| | 3304 | | /// <summary> |
| | 3305 | | /// Determines if two <see cref="QueueErrorCode"/> values are the same. |
| | 3306 | | /// </summary> |
| | 3307 | | /// <param name="left">The first <see cref="QueueErrorCode"/> to compare.</param> |
| | 3308 | | /// <param name="right">The second <see cref="QueueErrorCode"/> to compare.</param> |
| | 3309 | | /// <returns>True if <paramref name="left"/> and <paramref name="right"/> are the same; otherwise, false.</retur |
| | 3310 | | public static bool operator ==(Azure.Storage.Queues.Models.QueueErrorCode left, Azure.Storage.Queues.Models.Queu |
| | 3311 | |
|
| | 3312 | | /// <summary> |
| | 3313 | | /// Determines if two <see cref="QueueErrorCode"/> values are different. |
| | 3314 | | /// </summary> |
| | 3315 | | /// <param name="left">The first <see cref="QueueErrorCode"/> to compare.</param> |
| | 3316 | | /// <param name="right">The second <see cref="QueueErrorCode"/> to compare.</param> |
| | 3317 | | /// <returns>True if <paramref name="left"/> and <paramref name="right"/> are different; otherwise, false.</retu |
| | 3318 | | public static bool operator !=(Azure.Storage.Queues.Models.QueueErrorCode left, Azure.Storage.Queues.Models.Queu |
| | 3319 | |
|
| | 3320 | | /// <summary> |
| | 3321 | | /// Converts a string to a <see cref="QueueErrorCode"/>. |
| | 3322 | | /// </summary> |
| | 3323 | | /// <param name="value">The string value to convert.</param> |
| | 3324 | | /// <returns>The QueueErrorCode value.</returns> |
| | 3325 | | public static implicit operator QueueErrorCode(string value) => new Azure.Storage.Queues.Models.QueueErrorCode(v |
| | 3326 | |
|
| | 3327 | | /// <summary> |
| | 3328 | | /// Check if two <see cref="QueueErrorCode"/> instances are equal. |
| | 3329 | | /// </summary> |
| | 3330 | | /// <param name="obj">The instance to compare to.</param> |
| | 3331 | | /// <returns>True if they're equal, false otherwise.</returns> |
| | 3332 | | [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] |
| | 3333 | | public override bool Equals(object obj) => obj is Azure.Storage.Queues.Models.QueueErrorCode other && Equals(oth |
| | 3334 | |
|
| | 3335 | | /// <summary> |
| | 3336 | | /// Check if two <see cref="QueueErrorCode"/> instances are equal. |
| | 3337 | | /// </summary> |
| | 3338 | | /// <param name="other">The instance to compare to.</param> |
| | 3339 | | /// <returns>True if they're equal, false otherwise.</returns> |
| | 3340 | | public bool Equals(Azure.Storage.Queues.Models.QueueErrorCode other) => string.Equals(_value, other._value, Syst |
| | 3341 | |
|
| | 3342 | | /// <summary> |
| | 3343 | | /// Get a hash code for the <see cref="QueueErrorCode"/>. |
| | 3344 | | /// </summary> |
| | 3345 | | /// <returns>Hash code for the QueueErrorCode.</returns> |
| | 3346 | | [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] |
| | 3347 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 3348 | |
|
| | 3349 | | /// <summary> |
| | 3350 | | /// Convert the <see cref="QueueErrorCode"/> to a string. |
| | 3351 | | /// </summary> |
| | 3352 | | /// <returns>String representation of the QueueErrorCode.</returns> |
| | 3353 | | public override string ToString() => _value; |
| | 3354 | | } |
| | 3355 | | } |
| | 3356 | | #endregion enum strings QueueErrorCode |
| | 3357 | |
|
| | 3358 | | #region class QueueGeoReplication |
| | 3359 | | namespace Azure.Storage.Queues.Models |
| | 3360 | | { |
| | 3361 | | /// <summary> |
| | 3362 | | /// QueueGeoReplication |
| | 3363 | | /// </summary> |
| | 3364 | | public partial class QueueGeoReplication |
| | 3365 | | { |
| | 3366 | | /// <summary> |
| | 3367 | | /// The status of the secondary location |
| | 3368 | | /// </summary> |
| 0 | 3369 | | public Azure.Storage.Queues.Models.QueueGeoReplicationStatus Status { get; internal set; } |
| | 3370 | |
|
| | 3371 | | /// <summary> |
| | 3372 | | /// A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available |
| | 3373 | | /// </summary> |
| 0 | 3374 | | public System.DateTimeOffset? LastSyncedOn { get; internal set; } |
| | 3375 | |
|
| | 3376 | | /// <summary> |
| | 3377 | | /// Prevent direct instantiation of QueueGeoReplication instances. |
| | 3378 | | /// You can use QueuesModelFactory.QueueGeoReplication instead. |
| | 3379 | | /// </summary> |
| 0 | 3380 | | internal QueueGeoReplication() { } |
| | 3381 | |
|
| | 3382 | | /// <summary> |
| | 3383 | | /// Deserializes XML into a new QueueGeoReplication instance. |
| | 3384 | | /// </summary> |
| | 3385 | | /// <param name="element">The XML element to deserialize.</param> |
| | 3386 | | /// <returns>A deserialized QueueGeoReplication instance.</returns> |
| | 3387 | | internal static Azure.Storage.Queues.Models.QueueGeoReplication FromXml(System.Xml.Linq.XElement element) |
| | 3388 | | { |
| | 3389 | | System.Diagnostics.Debug.Assert(element != null); |
| | 3390 | | System.Xml.Linq.XElement _child; |
| 0 | 3391 | | Azure.Storage.Queues.Models.QueueGeoReplication _value = new Azure.Storage.Queues.Models.QueueGeoReplication |
| 0 | 3392 | | _child = element.Element(System.Xml.Linq.XName.Get("Status", "")); |
| 0 | 3393 | | if (_child != null && !string.IsNullOrEmpty(_child.Value)) |
| | 3394 | | { |
| 0 | 3395 | | _value.Status = Azure.Storage.Queues.QueueRestClient.Serialization.ParseQueueGeoReplicationStatus(_child |
| | 3396 | | } |
| 0 | 3397 | | _child = element.Element(System.Xml.Linq.XName.Get("LastSyncTime", "")); |
| 0 | 3398 | | if (_child != null) |
| | 3399 | | { |
| 0 | 3400 | | _value.LastSyncedOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Invaria |
| | 3401 | | } |
| | 3402 | | CustomizeFromXml(element, _value); |
| 0 | 3403 | | return _value; |
| | 3404 | | } |
| | 3405 | |
|
| | 3406 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueGeoRepli |
| | 3407 | | } |
| | 3408 | |
|
| | 3409 | | /// <summary> |
| | 3410 | | /// QueuesModelFactory provides utilities for mocking. |
| | 3411 | | /// </summary> |
| | 3412 | | public static partial class QueuesModelFactory |
| | 3413 | | { |
| | 3414 | | /// <summary> |
| | 3415 | | /// Creates a new QueueGeoReplication instance for mocking. |
| | 3416 | | /// </summary> |
| | 3417 | | public static QueueGeoReplication QueueGeoReplication( |
| | 3418 | | Azure.Storage.Queues.Models.QueueGeoReplicationStatus status, |
| | 3419 | | System.DateTimeOffset? lastSyncedOn = default) |
| | 3420 | | { |
| | 3421 | | return new QueueGeoReplication() |
| | 3422 | | { |
| | 3423 | | Status = status, |
| | 3424 | | LastSyncedOn = lastSyncedOn, |
| | 3425 | | }; |
| | 3426 | | } |
| | 3427 | | } |
| | 3428 | | } |
| | 3429 | | #endregion class QueueGeoReplication |
| | 3430 | |
|
| | 3431 | | #region enum QueueGeoReplicationStatus |
| | 3432 | | namespace Azure.Storage.Queues.Models |
| | 3433 | | { |
| | 3434 | | /// <summary> |
| | 3435 | | /// The status of the secondary location |
| | 3436 | | /// </summary> |
| | 3437 | | #pragma warning disable CA1717 // Only FlagsAttribute enums should have plural names |
| | 3438 | | public enum QueueGeoReplicationStatus |
| | 3439 | | #pragma warning restore CA1717 // Only FlagsAttribute enums should have plural names |
| | 3440 | | { |
| | 3441 | | /// <summary> |
| | 3442 | | /// live |
| | 3443 | | /// </summary> |
| | 3444 | | Live, |
| | 3445 | |
|
| | 3446 | | /// <summary> |
| | 3447 | | /// bootstrap |
| | 3448 | | /// </summary> |
| | 3449 | | Bootstrap, |
| | 3450 | |
|
| | 3451 | | /// <summary> |
| | 3452 | | /// unavailable |
| | 3453 | | /// </summary> |
| | 3454 | | Unavailable |
| | 3455 | | } |
| | 3456 | | } |
| | 3457 | |
|
| | 3458 | | namespace Azure.Storage.Queues |
| | 3459 | | { |
| | 3460 | | internal static partial class QueueRestClient |
| | 3461 | | { |
| | 3462 | | public static partial class Serialization |
| | 3463 | | { |
| | 3464 | | public static string ToString(Azure.Storage.Queues.Models.QueueGeoReplicationStatus value) |
| | 3465 | | { |
| | 3466 | | return value switch |
| | 3467 | | { |
| | 3468 | | Azure.Storage.Queues.Models.QueueGeoReplicationStatus.Live => "live", |
| | 3469 | | Azure.Storage.Queues.Models.QueueGeoReplicationStatus.Bootstrap => "bootstrap", |
| | 3470 | | Azure.Storage.Queues.Models.QueueGeoReplicationStatus.Unavailable => "unavailable", |
| | 3471 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Queue |
| | 3472 | | }; |
| | 3473 | | } |
| | 3474 | |
|
| | 3475 | | public static Azure.Storage.Queues.Models.QueueGeoReplicationStatus ParseQueueGeoReplicationStatus(string va |
| | 3476 | | { |
| | 3477 | | return value switch |
| | 3478 | | { |
| | 3479 | | "live" => Azure.Storage.Queues.Models.QueueGeoReplicationStatus.Live, |
| | 3480 | | "bootstrap" => Azure.Storage.Queues.Models.QueueGeoReplicationStatus.Bootstrap, |
| | 3481 | | "unavailable" => Azure.Storage.Queues.Models.QueueGeoReplicationStatus.Unavailable, |
| | 3482 | | _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Queue |
| | 3483 | | }; |
| | 3484 | | } |
| | 3485 | | } |
| | 3486 | | } |
| | 3487 | | } |
| | 3488 | | #endregion enum QueueGeoReplicationStatus |
| | 3489 | |
|
| | 3490 | | #region class QueueItem |
| | 3491 | | namespace Azure.Storage.Queues.Models |
| | 3492 | | { |
| | 3493 | | /// <summary> |
| | 3494 | | /// An Azure Storage Queue. |
| | 3495 | | /// </summary> |
| | 3496 | | public partial class QueueItem |
| | 3497 | | { |
| | 3498 | | /// <summary> |
| | 3499 | | /// The name of the Queue. |
| | 3500 | | /// </summary> |
| | 3501 | | public string Name { get; internal set; } |
| | 3502 | |
|
| | 3503 | | /// <summary> |
| | 3504 | | /// Metadata |
| | 3505 | | /// </summary> |
| | 3506 | | public System.Collections.Generic.IDictionary<string, string> Metadata { get; internal set; } |
| | 3507 | |
|
| | 3508 | | /// <summary> |
| | 3509 | | /// Creates a new QueueItem instance |
| | 3510 | | /// </summary> |
| | 3511 | | internal QueueItem() |
| | 3512 | | : this(false) |
| | 3513 | | { |
| | 3514 | | } |
| | 3515 | |
|
| | 3516 | | /// <summary> |
| | 3517 | | /// Creates a new QueueItem instance |
| | 3518 | | /// </summary> |
| | 3519 | | /// <param name="skipInitialization">Whether to skip initializing nested objects.</param> |
| | 3520 | | internal QueueItem(bool skipInitialization) |
| | 3521 | | { |
| | 3522 | | if (!skipInitialization) |
| | 3523 | | { |
| | 3524 | | Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringComparer.OrdinalIgnore |
| | 3525 | | } |
| | 3526 | | } |
| | 3527 | |
|
| | 3528 | | /// <summary> |
| | 3529 | | /// Deserializes XML into a new QueueItem instance. |
| | 3530 | | /// </summary> |
| | 3531 | | /// <param name="element">The XML element to deserialize.</param> |
| | 3532 | | /// <returns>A deserialized QueueItem instance.</returns> |
| | 3533 | | internal static Azure.Storage.Queues.Models.QueueItem FromXml(System.Xml.Linq.XElement element) |
| | 3534 | | { |
| | 3535 | | System.Diagnostics.Debug.Assert(element != null); |
| | 3536 | | System.Xml.Linq.XElement _child; |
| | 3537 | | Azure.Storage.Queues.Models.QueueItem _value = new Azure.Storage.Queues.Models.QueueItem(true); |
| | 3538 | | _child = element.Element(System.Xml.Linq.XName.Get("Name", "")); |
| | 3539 | | if (_child != null) |
| | 3540 | | { |
| | 3541 | | _value.Name = _child.Value; |
| | 3542 | | } |
| | 3543 | | _value.Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringComparer.OrdinalIgn |
| | 3544 | | _child = element.Element(System.Xml.Linq.XName.Get("Metadata", "")); |
| | 3545 | | if (_child != null) |
| | 3546 | | { |
| | 3547 | | foreach (System.Xml.Linq.XElement _pair in _child.Elements()) |
| | 3548 | | { |
| | 3549 | | _value.Metadata[_pair.Name.LocalName] = _pair.Value; |
| | 3550 | | } |
| | 3551 | | } |
| | 3552 | | CustomizeFromXml(element, _value); |
| | 3553 | | return _value; |
| | 3554 | | } |
| | 3555 | |
|
| | 3556 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueItem val |
| | 3557 | | } |
| | 3558 | |
|
| | 3559 | | /// <summary> |
| | 3560 | | /// QueuesModelFactory provides utilities for mocking. |
| | 3561 | | /// </summary> |
| | 3562 | | public static partial class QueuesModelFactory |
| | 3563 | | { |
| | 3564 | | /// <summary> |
| | 3565 | | /// Creates a new QueueItem instance for mocking. |
| | 3566 | | /// </summary> |
| | 3567 | | public static QueueItem QueueItem( |
| | 3568 | | string name, |
| | 3569 | | System.Collections.Generic.IDictionary<string, string> metadata = default) |
| | 3570 | | { |
| | 3571 | | return new QueueItem() |
| | 3572 | | { |
| | 3573 | | Name = name, |
| | 3574 | | Metadata = metadata, |
| | 3575 | | }; |
| | 3576 | | } |
| | 3577 | | } |
| | 3578 | | } |
| | 3579 | | #endregion class QueueItem |
| | 3580 | |
|
| | 3581 | | #region class QueueMessage |
| | 3582 | | namespace Azure.Storage.Queues.Models |
| | 3583 | | { |
| | 3584 | | /// <summary> |
| | 3585 | | /// The object returned in the QueueMessageList array when calling Get Messages on a Queue. |
| | 3586 | | /// </summary> |
| | 3587 | | public partial class QueueMessage |
| | 3588 | | { |
| | 3589 | | /// <summary> |
| | 3590 | | /// The Id of the Message. |
| | 3591 | | /// </summary> |
| | 3592 | | public string MessageId { get; internal set; } |
| | 3593 | |
|
| | 3594 | | /// <summary> |
| | 3595 | | /// This value is required to delete the Message. If deletion fails using this popreceipt then the message has b |
| | 3596 | | /// </summary> |
| | 3597 | | public string PopReceipt { get; internal set; } |
| | 3598 | |
|
| | 3599 | | /// <summary> |
| | 3600 | | /// The content of the Message. |
| | 3601 | | /// </summary> |
| | 3602 | | public string MessageText { get; internal set; } |
| | 3603 | |
|
| | 3604 | | /// <summary> |
| | 3605 | | /// The time that the message will again become visible in the Queue. |
| | 3606 | | /// </summary> |
| | 3607 | | public System.DateTimeOffset? NextVisibleOn { get; internal set; } |
| | 3608 | |
|
| | 3609 | | /// <summary> |
| | 3610 | | /// The time the Message was inserted into the Queue. |
| | 3611 | | /// </summary> |
| | 3612 | | public System.DateTimeOffset? InsertedOn { get; internal set; } |
| | 3613 | |
|
| | 3614 | | /// <summary> |
| | 3615 | | /// The time that the Message will expire and be automatically deleted. |
| | 3616 | | /// </summary> |
| | 3617 | | public System.DateTimeOffset? ExpiresOn { get; internal set; } |
| | 3618 | |
|
| | 3619 | | /// <summary> |
| | 3620 | | /// The number of times the message has been dequeued. |
| | 3621 | | /// </summary> |
| | 3622 | | public long DequeueCount { get; internal set; } |
| | 3623 | |
|
| | 3624 | | /// <summary> |
| | 3625 | | /// Prevent direct instantiation of QueueMessage instances. |
| | 3626 | | /// You can use QueuesModelFactory.QueueMessage instead. |
| | 3627 | | /// </summary> |
| | 3628 | | internal QueueMessage() { } |
| | 3629 | |
|
| | 3630 | | /// <summary> |
| | 3631 | | /// Deserializes XML into a new QueueMessage instance. |
| | 3632 | | /// </summary> |
| | 3633 | | /// <param name="element">The XML element to deserialize.</param> |
| | 3634 | | /// <returns>A deserialized QueueMessage instance.</returns> |
| | 3635 | | internal static Azure.Storage.Queues.Models.QueueMessage FromXml(System.Xml.Linq.XElement element) |
| | 3636 | | { |
| | 3637 | | System.Diagnostics.Debug.Assert(element != null); |
| | 3638 | | System.Xml.Linq.XElement _child; |
| | 3639 | | Azure.Storage.Queues.Models.QueueMessage _value = new Azure.Storage.Queues.Models.QueueMessage(); |
| | 3640 | | _child = element.Element(System.Xml.Linq.XName.Get("MessageId", "")); |
| | 3641 | | if (_child != null) |
| | 3642 | | { |
| | 3643 | | _value.MessageId = _child.Value; |
| | 3644 | | } |
| | 3645 | | _child = element.Element(System.Xml.Linq.XName.Get("PopReceipt", "")); |
| | 3646 | | if (_child != null) |
| | 3647 | | { |
| | 3648 | | _value.PopReceipt = _child.Value; |
| | 3649 | | } |
| | 3650 | | _child = element.Element(System.Xml.Linq.XName.Get("MessageText", "")); |
| | 3651 | | if (_child != null) |
| | 3652 | | { |
| | 3653 | | _value.MessageText = _child.Value; |
| | 3654 | | } |
| | 3655 | | _child = element.Element(System.Xml.Linq.XName.Get("TimeNextVisible", "")); |
| | 3656 | | if (_child != null) |
| | 3657 | | { |
| | 3658 | | _value.NextVisibleOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Invari |
| | 3659 | | } |
| | 3660 | | _child = element.Element(System.Xml.Linq.XName.Get("InsertionTime", "")); |
| | 3661 | | if (_child != null) |
| | 3662 | | { |
| | 3663 | | _value.InsertedOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Invariant |
| | 3664 | | } |
| | 3665 | | _child = element.Element(System.Xml.Linq.XName.Get("ExpirationTime", "")); |
| | 3666 | | if (_child != null) |
| | 3667 | | { |
| | 3668 | | _value.ExpiresOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.InvariantC |
| | 3669 | | } |
| | 3670 | | _child = element.Element(System.Xml.Linq.XName.Get("DequeueCount", "")); |
| | 3671 | | if (_child != null) |
| | 3672 | | { |
| | 3673 | | _value.DequeueCount = long.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); |
| | 3674 | | } |
| | 3675 | | CustomizeFromXml(element, _value); |
| | 3676 | | return _value; |
| | 3677 | | } |
| | 3678 | |
|
| | 3679 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueMessage |
| | 3680 | | } |
| | 3681 | |
|
| | 3682 | | /// <summary> |
| | 3683 | | /// QueuesModelFactory provides utilities for mocking. |
| | 3684 | | /// </summary> |
| | 3685 | | public static partial class QueuesModelFactory |
| | 3686 | | { |
| | 3687 | | /// <summary> |
| | 3688 | | /// Creates a new QueueMessage instance for mocking. |
| | 3689 | | /// </summary> |
| | 3690 | | public static QueueMessage QueueMessage( |
| | 3691 | | string messageId, |
| | 3692 | | string popReceipt, |
| | 3693 | | string messageText, |
| | 3694 | | long dequeueCount, |
| | 3695 | | System.DateTimeOffset? nextVisibleOn = default, |
| | 3696 | | System.DateTimeOffset? insertedOn = default, |
| | 3697 | | System.DateTimeOffset? expiresOn = default) |
| | 3698 | | { |
| | 3699 | | return new QueueMessage() |
| | 3700 | | { |
| | 3701 | | MessageId = messageId, |
| | 3702 | | PopReceipt = popReceipt, |
| | 3703 | | MessageText = messageText, |
| | 3704 | | DequeueCount = dequeueCount, |
| | 3705 | | NextVisibleOn = nextVisibleOn, |
| | 3706 | | InsertedOn = insertedOn, |
| | 3707 | | ExpiresOn = expiresOn, |
| | 3708 | | }; |
| | 3709 | | } |
| | 3710 | | } |
| | 3711 | | } |
| | 3712 | | #endregion class QueueMessage |
| | 3713 | |
|
| | 3714 | | #region class QueueMetrics |
| | 3715 | | namespace Azure.Storage.Queues.Models |
| | 3716 | | { |
| | 3717 | | /// <summary> |
| | 3718 | | /// QueueMetrics |
| | 3719 | | /// </summary> |
| | 3720 | | public partial class QueueMetrics |
| | 3721 | | { |
| | 3722 | | /// <summary> |
| | 3723 | | /// The version of Storage Analytics to configure. |
| | 3724 | | /// </summary> |
| | 3725 | | public string Version { get; set; } |
| | 3726 | |
|
| | 3727 | | /// <summary> |
| | 3728 | | /// Indicates whether metrics are enabled for the Queue service. |
| | 3729 | | /// </summary> |
| | 3730 | | public bool Enabled { get; set; } |
| | 3731 | |
|
| | 3732 | | /// <summary> |
| | 3733 | | /// the retention policy |
| | 3734 | | /// </summary> |
| | 3735 | | public Azure.Storage.Queues.Models.QueueRetentionPolicy RetentionPolicy { get; set; } |
| | 3736 | |
|
| | 3737 | | /// <summary> |
| | 3738 | | /// Indicates whether metrics should generate summary statistics for called API operations. |
| | 3739 | | /// </summary> |
| | 3740 | | public bool? IncludeApis { get; set; } |
| | 3741 | |
|
| | 3742 | | /// <summary> |
| | 3743 | | /// Creates a new QueueMetrics instance |
| | 3744 | | /// </summary> |
| | 3745 | | public QueueMetrics() |
| | 3746 | | : this(false) |
| | 3747 | | { |
| | 3748 | | } |
| | 3749 | |
|
| | 3750 | | /// <summary> |
| | 3751 | | /// Creates a new QueueMetrics instance |
| | 3752 | | /// </summary> |
| | 3753 | | /// <param name="skipInitialization">Whether to skip initializing nested objects.</param> |
| | 3754 | | internal QueueMetrics(bool skipInitialization) |
| | 3755 | | { |
| | 3756 | | if (!skipInitialization) |
| | 3757 | | { |
| | 3758 | | RetentionPolicy = new Azure.Storage.Queues.Models.QueueRetentionPolicy(); |
| | 3759 | | } |
| | 3760 | | } |
| | 3761 | |
|
| | 3762 | | /// <summary> |
| | 3763 | | /// Serialize a QueueMetrics instance as XML. |
| | 3764 | | /// </summary> |
| | 3765 | | /// <param name="value">The QueueMetrics instance to serialize.</param> |
| | 3766 | | /// <param name="name">An optional name to use for the root element instead of "Metrics".</param> |
| | 3767 | | /// <param name="ns">An optional namespace to use for the root element instead of "".</param> |
| | 3768 | | /// <returns>The serialized XML element.</returns> |
| | 3769 | | internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Queues.Models.QueueMetrics value, string name = "Me |
| | 3770 | | { |
| | 3771 | | System.Diagnostics.Debug.Assert(value != null); |
| | 3772 | | System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); |
| | 3773 | | if (value.Version != null) |
| | 3774 | | { |
| | 3775 | | _element.Add(new System.Xml.Linq.XElement( |
| | 3776 | | System.Xml.Linq.XName.Get("Version", ""), |
| | 3777 | | value.Version)); |
| | 3778 | | } |
| | 3779 | | _element.Add(new System.Xml.Linq.XElement( |
| | 3780 | | System.Xml.Linq.XName.Get("Enabled", ""), |
| | 3781 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 3782 | | value.Enabled.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant())); |
| | 3783 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 3784 | | if (value.RetentionPolicy != null) |
| | 3785 | | { |
| | 3786 | | _element.Add(Azure.Storage.Queues.Models.QueueRetentionPolicy.ToXml(value.RetentionPolicy, "RetentionPol |
| | 3787 | | } |
| | 3788 | | if (value.IncludeApis != null) |
| | 3789 | | { |
| | 3790 | | _element.Add(new System.Xml.Linq.XElement( |
| | 3791 | | System.Xml.Linq.XName.Get("IncludeAPIs", ""), |
| | 3792 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 3793 | | value.IncludeApis.Value.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant |
| | 3794 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 3795 | | } |
| | 3796 | | return _element; |
| | 3797 | | } |
| | 3798 | |
|
| | 3799 | | /// <summary> |
| | 3800 | | /// Deserializes XML into a new QueueMetrics instance. |
| | 3801 | | /// </summary> |
| | 3802 | | /// <param name="element">The XML element to deserialize.</param> |
| | 3803 | | /// <returns>A deserialized QueueMetrics instance.</returns> |
| | 3804 | | internal static Azure.Storage.Queues.Models.QueueMetrics FromXml(System.Xml.Linq.XElement element) |
| | 3805 | | { |
| | 3806 | | System.Diagnostics.Debug.Assert(element != null); |
| | 3807 | | System.Xml.Linq.XElement _child; |
| | 3808 | | Azure.Storage.Queues.Models.QueueMetrics _value = new Azure.Storage.Queues.Models.QueueMetrics(true); |
| | 3809 | | _child = element.Element(System.Xml.Linq.XName.Get("Version", "")); |
| | 3810 | | if (_child != null) |
| | 3811 | | { |
| | 3812 | | _value.Version = _child.Value; |
| | 3813 | | } |
| | 3814 | | _child = element.Element(System.Xml.Linq.XName.Get("Enabled", "")); |
| | 3815 | | if (_child != null) |
| | 3816 | | { |
| | 3817 | | _value.Enabled = bool.Parse(_child.Value); |
| | 3818 | | } |
| | 3819 | | _child = element.Element(System.Xml.Linq.XName.Get("RetentionPolicy", "")); |
| | 3820 | | if (_child != null) |
| | 3821 | | { |
| | 3822 | | _value.RetentionPolicy = Azure.Storage.Queues.Models.QueueRetentionPolicy.FromXml(_child); |
| | 3823 | | } |
| | 3824 | | _child = element.Element(System.Xml.Linq.XName.Get("IncludeAPIs", "")); |
| | 3825 | | if (_child != null) |
| | 3826 | | { |
| | 3827 | | _value.IncludeApis = bool.Parse(_child.Value); |
| | 3828 | | } |
| | 3829 | | CustomizeFromXml(element, _value); |
| | 3830 | | return _value; |
| | 3831 | | } |
| | 3832 | |
|
| | 3833 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueMetrics |
| | 3834 | | } |
| | 3835 | | } |
| | 3836 | | #endregion class QueueMetrics |
| | 3837 | |
|
| | 3838 | | #region class QueueProperties |
| | 3839 | | namespace Azure.Storage.Queues.Models |
| | 3840 | | { |
| | 3841 | | /// <summary> |
| | 3842 | | /// QueueProperties |
| | 3843 | | /// </summary> |
| | 3844 | | public partial class QueueProperties |
| | 3845 | | { |
| | 3846 | | /// <summary> |
| | 3847 | | /// x-ms-meta |
| | 3848 | | /// </summary> |
| | 3849 | | public System.Collections.Generic.IDictionary<string, string> Metadata { get; internal set; } |
| | 3850 | |
|
| | 3851 | | /// <summary> |
| | 3852 | | /// The approximate number of messages in the queue. This number is not lower than the actual number of messages |
| | 3853 | | /// </summary> |
| | 3854 | | public int ApproximateMessagesCount { get; internal set; } |
| | 3855 | |
|
| | 3856 | | /// <summary> |
| | 3857 | | /// Creates a new QueueProperties instance |
| | 3858 | | /// </summary> |
| | 3859 | | public QueueProperties() |
| | 3860 | | { |
| | 3861 | | Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringComparer.OrdinalIgnoreCase |
| | 3862 | | } |
| | 3863 | | } |
| | 3864 | |
|
| | 3865 | | /// <summary> |
| | 3866 | | /// QueuesModelFactory provides utilities for mocking. |
| | 3867 | | /// </summary> |
| | 3868 | | public static partial class QueuesModelFactory |
| | 3869 | | { |
| | 3870 | | /// <summary> |
| | 3871 | | /// Creates a new QueueProperties instance for mocking. |
| | 3872 | | /// </summary> |
| | 3873 | | public static QueueProperties QueueProperties( |
| | 3874 | | System.Collections.Generic.IDictionary<string, string> metadata, |
| | 3875 | | int approximateMessagesCount) |
| | 3876 | | { |
| | 3877 | | return new QueueProperties() |
| | 3878 | | { |
| | 3879 | | Metadata = metadata, |
| | 3880 | | ApproximateMessagesCount = approximateMessagesCount, |
| | 3881 | | }; |
| | 3882 | | } |
| | 3883 | | } |
| | 3884 | | } |
| | 3885 | | #endregion class QueueProperties |
| | 3886 | |
|
| | 3887 | | #region class QueueRetentionPolicy |
| | 3888 | | namespace Azure.Storage.Queues.Models |
| | 3889 | | { |
| | 3890 | | /// <summary> |
| | 3891 | | /// the retention policy |
| | 3892 | | /// </summary> |
| | 3893 | | public partial class QueueRetentionPolicy |
| | 3894 | | { |
| | 3895 | | /// <summary> |
| | 3896 | | /// Indicates whether a retention policy is enabled for the storage service |
| | 3897 | | /// </summary> |
| | 3898 | | public bool Enabled { get; set; } |
| | 3899 | |
|
| | 3900 | | /// <summary> |
| | 3901 | | /// Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older |
| | 3902 | | /// </summary> |
| | 3903 | | public int? Days { get; set; } |
| | 3904 | |
|
| | 3905 | | /// <summary> |
| | 3906 | | /// Creates a new QueueRetentionPolicy instance |
| | 3907 | | /// </summary> |
| | 3908 | | public QueueRetentionPolicy() { } |
| | 3909 | |
|
| | 3910 | | /// <summary> |
| | 3911 | | /// Serialize a QueueRetentionPolicy instance as XML. |
| | 3912 | | /// </summary> |
| | 3913 | | /// <param name="value">The QueueRetentionPolicy instance to serialize.</param> |
| | 3914 | | /// <param name="name">An optional name to use for the root element instead of "RetentionPolicy".</param> |
| | 3915 | | /// <param name="ns">An optional namespace to use for the root element instead of "".</param> |
| | 3916 | | /// <returns>The serialized XML element.</returns> |
| | 3917 | | internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Queues.Models.QueueRetentionPolicy value, string na |
| | 3918 | | { |
| | 3919 | | System.Diagnostics.Debug.Assert(value != null); |
| | 3920 | | System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); |
| | 3921 | | _element.Add(new System.Xml.Linq.XElement( |
| | 3922 | | System.Xml.Linq.XName.Get("Enabled", ""), |
| | 3923 | | #pragma warning disable CA1308 // Normalize strings to uppercase |
| | 3924 | | value.Enabled.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant())); |
| | 3925 | | #pragma warning restore CA1308 // Normalize strings to uppercase |
| | 3926 | | if (value.Days != null) |
| | 3927 | | { |
| | 3928 | | _element.Add(new System.Xml.Linq.XElement( |
| | 3929 | | System.Xml.Linq.XName.Get("Days", ""), |
| | 3930 | | value.Days.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); |
| | 3931 | | } |
| | 3932 | | return _element; |
| | 3933 | | } |
| | 3934 | |
|
| | 3935 | | /// <summary> |
| | 3936 | | /// Deserializes XML into a new QueueRetentionPolicy instance. |
| | 3937 | | /// </summary> |
| | 3938 | | /// <param name="element">The XML element to deserialize.</param> |
| | 3939 | | /// <returns>A deserialized QueueRetentionPolicy instance.</returns> |
| | 3940 | | internal static Azure.Storage.Queues.Models.QueueRetentionPolicy FromXml(System.Xml.Linq.XElement element) |
| | 3941 | | { |
| | 3942 | | System.Diagnostics.Debug.Assert(element != null); |
| | 3943 | | System.Xml.Linq.XElement _child; |
| | 3944 | | Azure.Storage.Queues.Models.QueueRetentionPolicy _value = new Azure.Storage.Queues.Models.QueueRetentionPoli |
| | 3945 | | _child = element.Element(System.Xml.Linq.XName.Get("Enabled", "")); |
| | 3946 | | if (_child != null) |
| | 3947 | | { |
| | 3948 | | _value.Enabled = bool.Parse(_child.Value); |
| | 3949 | | } |
| | 3950 | | _child = element.Element(System.Xml.Linq.XName.Get("Days", "")); |
| | 3951 | | if (_child != null) |
| | 3952 | | { |
| | 3953 | | _value.Days = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); |
| | 3954 | | } |
| | 3955 | | CustomizeFromXml(element, _value); |
| | 3956 | | return _value; |
| | 3957 | | } |
| | 3958 | |
|
| | 3959 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueRetentio |
| | 3960 | | } |
| | 3961 | | } |
| | 3962 | | #endregion class QueueRetentionPolicy |
| | 3963 | |
|
| | 3964 | | #region class QueueSendMessage |
| | 3965 | | namespace Azure.Storage.Queues.Models |
| | 3966 | | { |
| | 3967 | | /// <summary> |
| | 3968 | | /// A Message object which can be stored in a Queue |
| | 3969 | | /// </summary> |
| | 3970 | | internal partial class QueueSendMessage |
| | 3971 | | { |
| | 3972 | | /// <summary> |
| | 3973 | | /// The content of the message |
| | 3974 | | /// </summary> |
| | 3975 | | public string MessageText { get; set; } |
| | 3976 | |
|
| | 3977 | | /// <summary> |
| | 3978 | | /// Creates a new QueueSendMessage instance |
| | 3979 | | /// </summary> |
| | 3980 | | public QueueSendMessage() { } |
| | 3981 | |
|
| | 3982 | | /// <summary> |
| | 3983 | | /// Serialize a QueueSendMessage instance as XML. |
| | 3984 | | /// </summary> |
| | 3985 | | /// <param name="value">The QueueSendMessage instance to serialize.</param> |
| | 3986 | | /// <param name="name">An optional name to use for the root element instead of "QueueMessage".</param> |
| | 3987 | | /// <param name="ns">An optional namespace to use for the root element instead of "".</param> |
| | 3988 | | /// <returns>The serialized XML element.</returns> |
| | 3989 | | internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Queues.Models.QueueSendMessage value, string name = |
| | 3990 | | { |
| | 3991 | | System.Diagnostics.Debug.Assert(value != null); |
| | 3992 | | System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); |
| | 3993 | | _element.Add(new System.Xml.Linq.XElement( |
| | 3994 | | System.Xml.Linq.XName.Get("MessageText", ""), |
| | 3995 | | value.MessageText)); |
| | 3996 | | return _element; |
| | 3997 | | } |
| | 3998 | | } |
| | 3999 | | } |
| | 4000 | | #endregion class QueueSendMessage |
| | 4001 | |
|
| | 4002 | | #region class QueueServiceProperties |
| | 4003 | | namespace Azure.Storage.Queues.Models |
| | 4004 | | { |
| | 4005 | | /// <summary> |
| | 4006 | | /// Storage Service Properties. |
| | 4007 | | /// </summary> |
| | 4008 | | public partial class QueueServiceProperties |
| | 4009 | | { |
| | 4010 | | /// <summary> |
| | 4011 | | /// Azure Analytics Logging settings |
| | 4012 | | /// </summary> |
| | 4013 | | public Azure.Storage.Queues.Models.QueueAnalyticsLogging Logging { get; set; } |
| | 4014 | |
|
| | 4015 | | /// <summary> |
| | 4016 | | /// A summary of request statistics grouped by API in hourly aggregates for queues |
| | 4017 | | /// </summary> |
| | 4018 | | public Azure.Storage.Queues.Models.QueueMetrics HourMetrics { get; set; } |
| | 4019 | |
|
| | 4020 | | /// <summary> |
| | 4021 | | /// a summary of request statistics grouped by API in minute aggregates for queues |
| | 4022 | | /// </summary> |
| | 4023 | | public Azure.Storage.Queues.Models.QueueMetrics MinuteMetrics { get; set; } |
| | 4024 | |
|
| | 4025 | | /// <summary> |
| | 4026 | | /// The set of CORS rules. |
| | 4027 | | /// </summary> |
| | 4028 | | public System.Collections.Generic.IList<Azure.Storage.Queues.Models.QueueCorsRule> Cors { get; set; } |
| | 4029 | |
|
| | 4030 | | /// <summary> |
| | 4031 | | /// Creates a new QueueServiceProperties instance |
| | 4032 | | /// </summary> |
| | 4033 | | public QueueServiceProperties() |
| | 4034 | | : this(false) |
| | 4035 | | { |
| | 4036 | | } |
| | 4037 | |
|
| | 4038 | | /// <summary> |
| | 4039 | | /// Creates a new QueueServiceProperties instance |
| | 4040 | | /// </summary> |
| | 4041 | | /// <param name="skipInitialization">Whether to skip initializing nested objects.</param> |
| | 4042 | | internal QueueServiceProperties(bool skipInitialization) |
| | 4043 | | { |
| | 4044 | | if (!skipInitialization) |
| | 4045 | | { |
| | 4046 | | Logging = new Azure.Storage.Queues.Models.QueueAnalyticsLogging(); |
| | 4047 | | HourMetrics = new Azure.Storage.Queues.Models.QueueMetrics(); |
| | 4048 | | MinuteMetrics = new Azure.Storage.Queues.Models.QueueMetrics(); |
| | 4049 | | } |
| | 4050 | | } |
| | 4051 | |
|
| | 4052 | | /// <summary> |
| | 4053 | | /// Serialize a QueueServiceProperties instance as XML. |
| | 4054 | | /// </summary> |
| | 4055 | | /// <param name="value">The QueueServiceProperties instance to serialize.</param> |
| | 4056 | | /// <param name="name">An optional name to use for the root element instead of "StorageServiceProperties".</para |
| | 4057 | | /// <param name="ns">An optional namespace to use for the root element instead of "".</param> |
| | 4058 | | /// <returns>The serialized XML element.</returns> |
| | 4059 | | internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Queues.Models.QueueServiceProperties value, string |
| | 4060 | | { |
| | 4061 | | System.Diagnostics.Debug.Assert(value != null); |
| | 4062 | | System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); |
| | 4063 | | if (value.Logging != null) |
| | 4064 | | { |
| | 4065 | | _element.Add(Azure.Storage.Queues.Models.QueueAnalyticsLogging.ToXml(value.Logging, "Logging", "")); |
| | 4066 | | } |
| | 4067 | | if (value.HourMetrics != null) |
| | 4068 | | { |
| | 4069 | | _element.Add(Azure.Storage.Queues.Models.QueueMetrics.ToXml(value.HourMetrics, "HourMetrics", "")); |
| | 4070 | | } |
| | 4071 | | if (value.MinuteMetrics != null) |
| | 4072 | | { |
| | 4073 | | _element.Add(Azure.Storage.Queues.Models.QueueMetrics.ToXml(value.MinuteMetrics, "MinuteMetrics", "")); |
| | 4074 | | } |
| | 4075 | | if (value.Cors != null) |
| | 4076 | | { |
| | 4077 | | System.Xml.Linq.XElement _elements = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get("CorsRule", |
| | 4078 | | foreach (Azure.Storage.Queues.Models.QueueCorsRule _child in value.Cors) |
| | 4079 | | { |
| | 4080 | | _elements.Add(Azure.Storage.Queues.Models.QueueCorsRule.ToXml(_child)); |
| | 4081 | | } |
| | 4082 | | _element.Add(_elements); |
| | 4083 | | } |
| | 4084 | | return _element; |
| | 4085 | | } |
| | 4086 | |
|
| | 4087 | | /// <summary> |
| | 4088 | | /// Deserializes XML into a new QueueServiceProperties instance. |
| | 4089 | | /// </summary> |
| | 4090 | | /// <param name="element">The XML element to deserialize.</param> |
| | 4091 | | /// <returns>A deserialized QueueServiceProperties instance.</returns> |
| | 4092 | | internal static Azure.Storage.Queues.Models.QueueServiceProperties FromXml(System.Xml.Linq.XElement element) |
| | 4093 | | { |
| | 4094 | | System.Diagnostics.Debug.Assert(element != null); |
| | 4095 | | System.Xml.Linq.XElement _child; |
| | 4096 | | Azure.Storage.Queues.Models.QueueServiceProperties _value = new Azure.Storage.Queues.Models.QueueServiceProp |
| | 4097 | | _child = element.Element(System.Xml.Linq.XName.Get("Logging", "")); |
| | 4098 | | if (_child != null) |
| | 4099 | | { |
| | 4100 | | _value.Logging = Azure.Storage.Queues.Models.QueueAnalyticsLogging.FromXml(_child); |
| | 4101 | | } |
| | 4102 | | _child = element.Element(System.Xml.Linq.XName.Get("HourMetrics", "")); |
| | 4103 | | if (_child != null) |
| | 4104 | | { |
| | 4105 | | _value.HourMetrics = Azure.Storage.Queues.Models.QueueMetrics.FromXml(_child); |
| | 4106 | | } |
| | 4107 | | _child = element.Element(System.Xml.Linq.XName.Get("MinuteMetrics", "")); |
| | 4108 | | if (_child != null) |
| | 4109 | | { |
| | 4110 | | _value.MinuteMetrics = Azure.Storage.Queues.Models.QueueMetrics.FromXml(_child); |
| | 4111 | | } |
| | 4112 | | _child = element.Element(System.Xml.Linq.XName.Get("CorsRule", "")); |
| | 4113 | | if (_child != null) |
| | 4114 | | { |
| | 4115 | | _value.Cors = System.Linq.Enumerable.ToList( |
| | 4116 | | System.Linq.Enumerable.Select( |
| | 4117 | | _child.Elements(System.Xml.Linq.XName.Get("CorsRule", "")), |
| | 4118 | | e => Azure.Storage.Queues.Models.QueueCorsRule.FromXml(e))); |
| | 4119 | | } |
| | 4120 | | else |
| | 4121 | | { |
| | 4122 | | _value.Cors = new System.Collections.Generic.List<Azure.Storage.Queues.Models.QueueCorsRule>(); |
| | 4123 | | } |
| | 4124 | | CustomizeFromXml(element, _value); |
| | 4125 | | return _value; |
| | 4126 | | } |
| | 4127 | |
|
| | 4128 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueServiceP |
| | 4129 | | } |
| | 4130 | | } |
| | 4131 | | #endregion class QueueServiceProperties |
| | 4132 | |
|
| | 4133 | | #region class QueueServiceStatistics |
| | 4134 | | namespace Azure.Storage.Queues.Models |
| | 4135 | | { |
| | 4136 | | /// <summary> |
| | 4137 | | /// Statistics for the storage service. |
| | 4138 | | /// </summary> |
| | 4139 | | public partial class QueueServiceStatistics |
| | 4140 | | { |
| | 4141 | | /// <summary> |
| | 4142 | | /// GeoReplication |
| | 4143 | | /// </summary> |
| | 4144 | | public Azure.Storage.Queues.Models.QueueGeoReplication GeoReplication { get; internal set; } |
| | 4145 | |
|
| | 4146 | | /// <summary> |
| | 4147 | | /// Creates a new QueueServiceStatistics instance |
| | 4148 | | /// </summary> |
| | 4149 | | internal QueueServiceStatistics() |
| | 4150 | | : this(false) |
| | 4151 | | { |
| | 4152 | | } |
| | 4153 | |
|
| | 4154 | | /// <summary> |
| | 4155 | | /// Creates a new QueueServiceStatistics instance |
| | 4156 | | /// </summary> |
| | 4157 | | /// <param name="skipInitialization">Whether to skip initializing nested objects.</param> |
| | 4158 | | internal QueueServiceStatistics(bool skipInitialization) |
| | 4159 | | { |
| | 4160 | | if (!skipInitialization) |
| | 4161 | | { |
| | 4162 | | GeoReplication = new Azure.Storage.Queues.Models.QueueGeoReplication(); |
| | 4163 | | } |
| | 4164 | | } |
| | 4165 | |
|
| | 4166 | | /// <summary> |
| | 4167 | | /// Deserializes XML into a new QueueServiceStatistics instance. |
| | 4168 | | /// </summary> |
| | 4169 | | /// <param name="element">The XML element to deserialize.</param> |
| | 4170 | | /// <returns>A deserialized QueueServiceStatistics instance.</returns> |
| | 4171 | | internal static Azure.Storage.Queues.Models.QueueServiceStatistics FromXml(System.Xml.Linq.XElement element) |
| | 4172 | | { |
| | 4173 | | System.Diagnostics.Debug.Assert(element != null); |
| | 4174 | | System.Xml.Linq.XElement _child; |
| | 4175 | | Azure.Storage.Queues.Models.QueueServiceStatistics _value = new Azure.Storage.Queues.Models.QueueServiceStat |
| | 4176 | | _child = element.Element(System.Xml.Linq.XName.Get("GeoReplication", "")); |
| | 4177 | | if (_child != null) |
| | 4178 | | { |
| | 4179 | | _value.GeoReplication = Azure.Storage.Queues.Models.QueueGeoReplication.FromXml(_child); |
| | 4180 | | } |
| | 4181 | | CustomizeFromXml(element, _value); |
| | 4182 | | return _value; |
| | 4183 | | } |
| | 4184 | |
|
| | 4185 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueServiceS |
| | 4186 | | } |
| | 4187 | |
|
| | 4188 | | /// <summary> |
| | 4189 | | /// QueuesModelFactory provides utilities for mocking. |
| | 4190 | | /// </summary> |
| | 4191 | | public static partial class QueuesModelFactory |
| | 4192 | | { |
| | 4193 | | /// <summary> |
| | 4194 | | /// Creates a new QueueServiceStatistics instance for mocking. |
| | 4195 | | /// </summary> |
| | 4196 | | public static QueueServiceStatistics QueueServiceStatistics( |
| | 4197 | | Azure.Storage.Queues.Models.QueueGeoReplication geoReplication = default) |
| | 4198 | | { |
| | 4199 | | return new QueueServiceStatistics() |
| | 4200 | | { |
| | 4201 | | GeoReplication = geoReplication, |
| | 4202 | | }; |
| | 4203 | | } |
| | 4204 | | } |
| | 4205 | | } |
| | 4206 | | #endregion class QueueServiceStatistics |
| | 4207 | |
|
| | 4208 | | #region class QueueSignedIdentifier |
| | 4209 | | namespace Azure.Storage.Queues.Models |
| | 4210 | | { |
| | 4211 | | /// <summary> |
| | 4212 | | /// signed identifier |
| | 4213 | | /// </summary> |
| | 4214 | | public partial class QueueSignedIdentifier |
| | 4215 | | { |
| | 4216 | | /// <summary> |
| | 4217 | | /// a unique id |
| | 4218 | | /// </summary> |
| | 4219 | | public string Id { get; set; } |
| | 4220 | |
|
| | 4221 | | /// <summary> |
| | 4222 | | /// An Access policy |
| | 4223 | | /// </summary> |
| | 4224 | | public Azure.Storage.Queues.Models.QueueAccessPolicy AccessPolicy { get; set; } |
| | 4225 | |
|
| | 4226 | | /// <summary> |
| | 4227 | | /// Creates a new QueueSignedIdentifier instance |
| | 4228 | | /// </summary> |
| | 4229 | | public QueueSignedIdentifier() |
| | 4230 | | : this(false) |
| | 4231 | | { |
| | 4232 | | } |
| | 4233 | |
|
| | 4234 | | /// <summary> |
| | 4235 | | /// Creates a new QueueSignedIdentifier instance |
| | 4236 | | /// </summary> |
| | 4237 | | /// <param name="skipInitialization">Whether to skip initializing nested objects.</param> |
| | 4238 | | internal QueueSignedIdentifier(bool skipInitialization) |
| | 4239 | | { |
| | 4240 | | if (!skipInitialization) |
| | 4241 | | { |
| | 4242 | | AccessPolicy = new Azure.Storage.Queues.Models.QueueAccessPolicy(); |
| | 4243 | | } |
| | 4244 | | } |
| | 4245 | |
|
| | 4246 | | /// <summary> |
| | 4247 | | /// Serialize a QueueSignedIdentifier instance as XML. |
| | 4248 | | /// </summary> |
| | 4249 | | /// <param name="value">The QueueSignedIdentifier instance to serialize.</param> |
| | 4250 | | /// <param name="name">An optional name to use for the root element instead of "SignedIdentifier".</param> |
| | 4251 | | /// <param name="ns">An optional namespace to use for the root element instead of "".</param> |
| | 4252 | | /// <returns>The serialized XML element.</returns> |
| | 4253 | | internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Queues.Models.QueueSignedIdentifier value, string n |
| | 4254 | | { |
| | 4255 | | System.Diagnostics.Debug.Assert(value != null); |
| | 4256 | | System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); |
| | 4257 | | _element.Add(new System.Xml.Linq.XElement( |
| | 4258 | | System.Xml.Linq.XName.Get("Id", ""), |
| | 4259 | | value.Id)); |
| | 4260 | | _element.Add(Azure.Storage.Queues.Models.QueueAccessPolicy.ToXml(value.AccessPolicy, "AccessPolicy", "")); |
| | 4261 | | return _element; |
| | 4262 | | } |
| | 4263 | |
|
| | 4264 | | /// <summary> |
| | 4265 | | /// Deserializes XML into a new QueueSignedIdentifier instance. |
| | 4266 | | /// </summary> |
| | 4267 | | /// <param name="element">The XML element to deserialize.</param> |
| | 4268 | | /// <returns>A deserialized QueueSignedIdentifier instance.</returns> |
| | 4269 | | internal static Azure.Storage.Queues.Models.QueueSignedIdentifier FromXml(System.Xml.Linq.XElement element) |
| | 4270 | | { |
| | 4271 | | System.Diagnostics.Debug.Assert(element != null); |
| | 4272 | | System.Xml.Linq.XElement _child; |
| | 4273 | | Azure.Storage.Queues.Models.QueueSignedIdentifier _value = new Azure.Storage.Queues.Models.QueueSignedIdenti |
| | 4274 | | _child = element.Element(System.Xml.Linq.XName.Get("Id", "")); |
| | 4275 | | if (_child != null) |
| | 4276 | | { |
| | 4277 | | _value.Id = _child.Value; |
| | 4278 | | } |
| | 4279 | | _child = element.Element(System.Xml.Linq.XName.Get("AccessPolicy", "")); |
| | 4280 | | if (_child != null) |
| | 4281 | | { |
| | 4282 | | _value.AccessPolicy = Azure.Storage.Queues.Models.QueueAccessPolicy.FromXml(_child); |
| | 4283 | | } |
| | 4284 | | CustomizeFromXml(element, _value); |
| | 4285 | | return _value; |
| | 4286 | | } |
| | 4287 | |
|
| | 4288 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueueSignedId |
| | 4289 | | } |
| | 4290 | | } |
| | 4291 | | #endregion class QueueSignedIdentifier |
| | 4292 | |
|
| | 4293 | | #region class QueuesSegment |
| | 4294 | | namespace Azure.Storage.Queues.Models |
| | 4295 | | { |
| | 4296 | | /// <summary> |
| | 4297 | | /// The object returned when calling List Queues on a Queue Service. |
| | 4298 | | /// </summary> |
| | 4299 | | internal partial class QueuesSegment |
| | 4300 | | { |
| | 4301 | | /// <summary> |
| | 4302 | | /// ServiceEndpoint |
| | 4303 | | /// </summary> |
| | 4304 | | public string ServiceEndpoint { get; internal set; } |
| | 4305 | |
|
| | 4306 | | /// <summary> |
| | 4307 | | /// Prefix |
| | 4308 | | /// </summary> |
| | 4309 | | public string Prefix { get; internal set; } |
| | 4310 | |
|
| | 4311 | | /// <summary> |
| | 4312 | | /// Marker |
| | 4313 | | /// </summary> |
| | 4314 | | public string Marker { get; internal set; } |
| | 4315 | |
|
| | 4316 | | /// <summary> |
| | 4317 | | /// MaxResults |
| | 4318 | | /// </summary> |
| | 4319 | | public int? MaxResults { get; internal set; } |
| | 4320 | |
|
| | 4321 | | /// <summary> |
| | 4322 | | /// QueueItems |
| | 4323 | | /// </summary> |
| | 4324 | | public System.Collections.Generic.IEnumerable<Azure.Storage.Queues.Models.QueueItem> QueueItems { get; internal |
| | 4325 | |
|
| | 4326 | | /// <summary> |
| | 4327 | | /// NextMarker |
| | 4328 | | /// </summary> |
| | 4329 | | public string NextMarker { get; internal set; } |
| | 4330 | |
|
| | 4331 | | /// <summary> |
| | 4332 | | /// Creates a new QueuesSegment instance |
| | 4333 | | /// </summary> |
| | 4334 | | public QueuesSegment() |
| | 4335 | | : this(false) |
| | 4336 | | { |
| | 4337 | | } |
| | 4338 | |
|
| | 4339 | | /// <summary> |
| | 4340 | | /// Creates a new QueuesSegment instance |
| | 4341 | | /// </summary> |
| | 4342 | | /// <param name="skipInitialization">Whether to skip initializing nested objects.</param> |
| | 4343 | | internal QueuesSegment(bool skipInitialization) |
| | 4344 | | { |
| | 4345 | | if (!skipInitialization) |
| | 4346 | | { |
| | 4347 | | QueueItems = new System.Collections.Generic.List<Azure.Storage.Queues.Models.QueueItem>(); |
| | 4348 | | } |
| | 4349 | | } |
| | 4350 | |
|
| | 4351 | | /// <summary> |
| | 4352 | | /// Deserializes XML into a new QueuesSegment instance. |
| | 4353 | | /// </summary> |
| | 4354 | | /// <param name="element">The XML element to deserialize.</param> |
| | 4355 | | /// <returns>A deserialized QueuesSegment instance.</returns> |
| | 4356 | | internal static Azure.Storage.Queues.Models.QueuesSegment FromXml(System.Xml.Linq.XElement element) |
| | 4357 | | { |
| | 4358 | | System.Diagnostics.Debug.Assert(element != null); |
| | 4359 | | System.Xml.Linq.XElement _child; |
| | 4360 | | System.Xml.Linq.XAttribute _attribute; |
| | 4361 | | Azure.Storage.Queues.Models.QueuesSegment _value = new Azure.Storage.Queues.Models.QueuesSegment(true); |
| | 4362 | | _attribute = element.Attribute(System.Xml.Linq.XName.Get("ServiceEndpoint", "")); |
| | 4363 | | if (_attribute != null) |
| | 4364 | | { |
| | 4365 | | _value.ServiceEndpoint = _attribute.Value; |
| | 4366 | | } |
| | 4367 | | _child = element.Element(System.Xml.Linq.XName.Get("Prefix", "")); |
| | 4368 | | if (_child != null) |
| | 4369 | | { |
| | 4370 | | _value.Prefix = _child.Value; |
| | 4371 | | } |
| | 4372 | | _child = element.Element(System.Xml.Linq.XName.Get("Marker", "")); |
| | 4373 | | if (_child != null) |
| | 4374 | | { |
| | 4375 | | _value.Marker = _child.Value; |
| | 4376 | | } |
| | 4377 | | _child = element.Element(System.Xml.Linq.XName.Get("MaxResults", "")); |
| | 4378 | | if (_child != null) |
| | 4379 | | { |
| | 4380 | | _value.MaxResults = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); |
| | 4381 | | } |
| | 4382 | | _child = element.Element(System.Xml.Linq.XName.Get("Queues", "")); |
| | 4383 | | if (_child != null) |
| | 4384 | | { |
| | 4385 | | _value.QueueItems = System.Linq.Enumerable.ToList( |
| | 4386 | | System.Linq.Enumerable.Select( |
| | 4387 | | _child.Elements(System.Xml.Linq.XName.Get("Queue", "")), |
| | 4388 | | e => Azure.Storage.Queues.Models.QueueItem.FromXml(e))); |
| | 4389 | | } |
| | 4390 | | else |
| | 4391 | | { |
| | 4392 | | _value.QueueItems = new System.Collections.Generic.List<Azure.Storage.Queues.Models.QueueItem>(); |
| | 4393 | | } |
| | 4394 | | _child = element.Element(System.Xml.Linq.XName.Get("NextMarker", "")); |
| | 4395 | | if (_child != null) |
| | 4396 | | { |
| | 4397 | | _value.NextMarker = _child.Value; |
| | 4398 | | } |
| | 4399 | | CustomizeFromXml(element, _value); |
| | 4400 | | return _value; |
| | 4401 | | } |
| | 4402 | |
|
| | 4403 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.QueuesSegment |
| | 4404 | | } |
| | 4405 | | } |
| | 4406 | | #endregion class QueuesSegment |
| | 4407 | |
|
| | 4408 | | #region class SendReceipt |
| | 4409 | | namespace Azure.Storage.Queues.Models |
| | 4410 | | { |
| | 4411 | | /// <summary> |
| | 4412 | | /// The object returned in the QueueMessageList array when calling Put Message on a Queue |
| | 4413 | | /// </summary> |
| | 4414 | | public partial class SendReceipt |
| | 4415 | | { |
| | 4416 | | /// <summary> |
| | 4417 | | /// The Id of the Message. |
| | 4418 | | /// </summary> |
| | 4419 | | public string MessageId { get; internal set; } |
| | 4420 | |
|
| | 4421 | | /// <summary> |
| | 4422 | | /// The time the Message was inserted into the Queue. |
| | 4423 | | /// </summary> |
| | 4424 | | public System.DateTimeOffset InsertionTime { get; internal set; } |
| | 4425 | |
|
| | 4426 | | /// <summary> |
| | 4427 | | /// The time that the Message will expire and be automatically deleted. |
| | 4428 | | /// </summary> |
| | 4429 | | public System.DateTimeOffset ExpirationTime { get; internal set; } |
| | 4430 | |
|
| | 4431 | | /// <summary> |
| | 4432 | | /// This value is required to delete the Message. If deletion fails using this popreceipt then the message has b |
| | 4433 | | /// </summary> |
| | 4434 | | public string PopReceipt { get; internal set; } |
| | 4435 | |
|
| | 4436 | | /// <summary> |
| | 4437 | | /// The time that the message will again become visible in the Queue. |
| | 4438 | | /// </summary> |
| | 4439 | | public System.DateTimeOffset TimeNextVisible { get; internal set; } |
| | 4440 | |
|
| | 4441 | | /// <summary> |
| | 4442 | | /// Prevent direct instantiation of SendReceipt instances. |
| | 4443 | | /// You can use QueuesModelFactory.SendReceipt instead. |
| | 4444 | | /// </summary> |
| | 4445 | | internal SendReceipt() { } |
| | 4446 | |
|
| | 4447 | | /// <summary> |
| | 4448 | | /// Deserializes XML into a new SendReceipt instance. |
| | 4449 | | /// </summary> |
| | 4450 | | /// <param name="element">The XML element to deserialize.</param> |
| | 4451 | | /// <returns>A deserialized SendReceipt instance.</returns> |
| | 4452 | | internal static Azure.Storage.Queues.Models.SendReceipt FromXml(System.Xml.Linq.XElement element) |
| | 4453 | | { |
| | 4454 | | System.Diagnostics.Debug.Assert(element != null); |
| | 4455 | | System.Xml.Linq.XElement _child; |
| | 4456 | | Azure.Storage.Queues.Models.SendReceipt _value = new Azure.Storage.Queues.Models.SendReceipt(); |
| | 4457 | | _child = element.Element(System.Xml.Linq.XName.Get("MessageId", "")); |
| | 4458 | | if (_child != null) |
| | 4459 | | { |
| | 4460 | | _value.MessageId = _child.Value; |
| | 4461 | | } |
| | 4462 | | _child = element.Element(System.Xml.Linq.XName.Get("InsertionTime", "")); |
| | 4463 | | if (_child != null) |
| | 4464 | | { |
| | 4465 | | _value.InsertionTime = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Invari |
| | 4466 | | } |
| | 4467 | | _child = element.Element(System.Xml.Linq.XName.Get("ExpirationTime", "")); |
| | 4468 | | if (_child != null) |
| | 4469 | | { |
| | 4470 | | _value.ExpirationTime = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Invar |
| | 4471 | | } |
| | 4472 | | _child = element.Element(System.Xml.Linq.XName.Get("PopReceipt", "")); |
| | 4473 | | if (_child != null) |
| | 4474 | | { |
| | 4475 | | _value.PopReceipt = _child.Value; |
| | 4476 | | } |
| | 4477 | | _child = element.Element(System.Xml.Linq.XName.Get("TimeNextVisible", "")); |
| | 4478 | | if (_child != null) |
| | 4479 | | { |
| | 4480 | | _value.TimeNextVisible = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Inva |
| | 4481 | | } |
| | 4482 | | CustomizeFromXml(element, _value); |
| | 4483 | | return _value; |
| | 4484 | | } |
| | 4485 | |
|
| | 4486 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.SendReceipt v |
| | 4487 | | } |
| | 4488 | |
|
| | 4489 | | /// <summary> |
| | 4490 | | /// QueuesModelFactory provides utilities for mocking. |
| | 4491 | | /// </summary> |
| | 4492 | | public static partial class QueuesModelFactory |
| | 4493 | | { |
| | 4494 | | /// <summary> |
| | 4495 | | /// Creates a new SendReceipt instance for mocking. |
| | 4496 | | /// </summary> |
| | 4497 | | public static SendReceipt SendReceipt( |
| | 4498 | | string messageId, |
| | 4499 | | System.DateTimeOffset insertionTime, |
| | 4500 | | System.DateTimeOffset expirationTime, |
| | 4501 | | string popReceipt, |
| | 4502 | | System.DateTimeOffset timeNextVisible) |
| | 4503 | | { |
| | 4504 | | return new SendReceipt() |
| | 4505 | | { |
| | 4506 | | MessageId = messageId, |
| | 4507 | | InsertionTime = insertionTime, |
| | 4508 | | ExpirationTime = expirationTime, |
| | 4509 | | PopReceipt = popReceipt, |
| | 4510 | | TimeNextVisible = timeNextVisible, |
| | 4511 | | }; |
| | 4512 | | } |
| | 4513 | | } |
| | 4514 | | } |
| | 4515 | | #endregion class SendReceipt |
| | 4516 | |
|
| | 4517 | | #region class StorageError |
| | 4518 | | namespace Azure.Storage.Queues.Models |
| | 4519 | | { |
| | 4520 | | /// <summary> |
| | 4521 | | /// StorageError |
| | 4522 | | /// </summary> |
| | 4523 | | internal partial class StorageError |
| | 4524 | | { |
| | 4525 | | /// <summary> |
| | 4526 | | /// Message |
| | 4527 | | /// </summary> |
| | 4528 | | public string Message { get; internal set; } |
| | 4529 | |
|
| | 4530 | | /// <summary> |
| | 4531 | | /// Code |
| | 4532 | | /// </summary> |
| | 4533 | | public string Code { get; internal set; } |
| | 4534 | |
|
| | 4535 | | /// <summary> |
| | 4536 | | /// Prevent direct instantiation of StorageError instances. |
| | 4537 | | /// You can use QueuesModelFactory.StorageError instead. |
| | 4538 | | /// </summary> |
| | 4539 | | internal StorageError() { } |
| | 4540 | |
|
| | 4541 | | /// <summary> |
| | 4542 | | /// Deserializes XML into a new StorageError instance. |
| | 4543 | | /// </summary> |
| | 4544 | | /// <param name="element">The XML element to deserialize.</param> |
| | 4545 | | /// <returns>A deserialized StorageError instance.</returns> |
| | 4546 | | internal static Azure.Storage.Queues.Models.StorageError FromXml(System.Xml.Linq.XElement element) |
| | 4547 | | { |
| | 4548 | | System.Diagnostics.Debug.Assert(element != null); |
| | 4549 | | System.Xml.Linq.XElement _child; |
| | 4550 | | Azure.Storage.Queues.Models.StorageError _value = new Azure.Storage.Queues.Models.StorageError(); |
| | 4551 | | _child = element.Element(System.Xml.Linq.XName.Get("Message", "")); |
| | 4552 | | if (_child != null) |
| | 4553 | | { |
| | 4554 | | _value.Message = _child.Value; |
| | 4555 | | } |
| | 4556 | | _child = element.Element(System.Xml.Linq.XName.Get("Code", "")); |
| | 4557 | | if (_child != null) |
| | 4558 | | { |
| | 4559 | | _value.Code = _child.Value; |
| | 4560 | | } |
| | 4561 | | CustomizeFromXml(element, _value); |
| | 4562 | | return _value; |
| | 4563 | | } |
| | 4564 | |
|
| | 4565 | | static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Queues.Models.StorageError |
| | 4566 | | } |
| | 4567 | | } |
| | 4568 | | #endregion class StorageError |
| | 4569 | |
|
| | 4570 | | #region class UpdateReceipt |
| | 4571 | | namespace Azure.Storage.Queues.Models |
| | 4572 | | { |
| | 4573 | | /// <summary> |
| | 4574 | | /// UpdateReceipt |
| | 4575 | | /// </summary> |
| | 4576 | | public partial class UpdateReceipt |
| | 4577 | | { |
| | 4578 | | /// <summary> |
| | 4579 | | /// The pop receipt of the queue message. |
| | 4580 | | /// </summary> |
| | 4581 | | public string PopReceipt { get; internal set; } |
| | 4582 | |
|
| | 4583 | | /// <summary> |
| | 4584 | | /// A UTC date/time value that represents when the message will be visible on the queue. |
| | 4585 | | /// </summary> |
| | 4586 | | public System.DateTimeOffset NextVisibleOn { get; internal set; } |
| | 4587 | |
|
| | 4588 | | /// <summary> |
| | 4589 | | /// Prevent direct instantiation of UpdateReceipt instances. |
| | 4590 | | /// You can use QueuesModelFactory.UpdateReceipt instead. |
| | 4591 | | /// </summary> |
| | 4592 | | internal UpdateReceipt() { } |
| | 4593 | | } |
| | 4594 | |
|
| | 4595 | | /// <summary> |
| | 4596 | | /// QueuesModelFactory provides utilities for mocking. |
| | 4597 | | /// </summary> |
| | 4598 | | public static partial class QueuesModelFactory |
| | 4599 | | { |
| | 4600 | | /// <summary> |
| | 4601 | | /// Creates a new UpdateReceipt instance for mocking. |
| | 4602 | | /// </summary> |
| | 4603 | | public static UpdateReceipt UpdateReceipt( |
| | 4604 | | string popReceipt, |
| | 4605 | | System.DateTimeOffset nextVisibleOn) |
| | 4606 | | { |
| | 4607 | | return new UpdateReceipt() |
| | 4608 | | { |
| | 4609 | | PopReceipt = popReceipt, |
| | 4610 | | NextVisibleOn = nextVisibleOn, |
| | 4611 | | }; |
| | 4612 | | } |
| | 4613 | | } |
| | 4614 | | } |
| | 4615 | | #endregion class UpdateReceipt |
| | 4616 | | #endregion Models |
| | 4617 | |
|