| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.Collections.Generic; |
| | 6 | |
|
| | 7 | | namespace Azure.Storage.Queues.Models |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// Specifies options for listing queues with the |
| | 11 | | /// <see cref="QueueServiceClient.GetQueuesAsync"/> operation. |
| | 12 | | /// </summary> |
| | 13 | | [Flags] |
| | 14 | | public enum QueueTraits |
| | 15 | | { |
| | 16 | | /// <summary> |
| | 17 | | /// Flag specifying only the default information for queues |
| | 18 | | /// should be included. |
| | 19 | | /// </summary> |
| | 20 | | None = 0, |
| | 21 | |
|
| | 22 | | /// <summary> |
| | 23 | | /// Flag specifying that the queue's metadata should be |
| | 24 | | /// included. |
| | 25 | | /// </summary> |
| | 26 | | Metadata = 1, |
| | 27 | | } |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// QueueTraits enum methods |
| | 31 | | /// </summary> |
| | 32 | | internal static partial class QueueExtensions |
| | 33 | | { |
| | 34 | | /// <summary> |
| | 35 | | /// Convert the details into a <see cref="ListQueuesIncludeType"/> value. |
| | 36 | | /// </summary> |
| | 37 | | /// <returns>A <see cref="ListQueuesIncludeType"/> value.</returns> |
| | 38 | | internal static IEnumerable<ListQueuesIncludeType> AsIncludeTypes(this QueueTraits traits) => |
| 38 | 39 | | ((traits & QueueTraits.Metadata) == QueueTraits.Metadata) |
| 38 | 40 | | ? |
| 38 | 41 | | new ListQueuesIncludeType[] { ListQueuesIncludeType.Metadata } : |
| 38 | 42 | | Array.Empty<ListQueuesIncludeType>(); |
| | 43 | | } |
| | 44 | | } |