/
BlockListTypes.cs
52 lines (47 loc) · 1.5 KB
/
BlockListTypes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using Azure.Storage.Blobs.Models;
namespace Azure.Storage.Blobs.Models
{
/// <summary>
/// Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together.
/// </summary>
[Flags]
public enum BlockListTypes
{
/// <summary>
/// Flag to specify returning both committed and uncommitted blocks.
/// </summary>
All = Committed | Uncommitted,
/// <summary>
/// Flag to specify returning the list of committed blocks.
/// </summary>
Committed = 1,
/// <summary>
/// Flag to specify returning the list of uncommitted blocks.
/// </summary>
Uncommitted = 2
}
}
namespace Azure.Storage.Blobs
{
/// <summary>
/// BlockListTypes extensions
/// </summary>
internal static partial class BlobExtensions
{
/// <summary>
/// Convert the BlockListTypes into a BlockListType.
/// </summary>
/// <param name="options"></param>
/// <returns>The BlockList response.</returns>
internal static BlockListType ToBlockListType(this BlockListTypes options) =>
options switch
{
BlockListTypes.Committed => BlockListType.Committed,
BlockListTypes.Uncommitted => BlockListType.Uncommitted,
_ => BlockListType.All,
};
}
}