From 3c6c5c671e10f7cbc0133b5edee81661edadb985 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 19 May 2021 14:14:36 -0700 Subject: [PATCH] request conditions per api. --- .../api/Azure.Storage.Blobs.netstandard2.0.cs | 22 + .../src/BlockBlobClient.cs | 542 +++++++++++++++++- .../src/Models/BlockList.cs | 4 +- .../Models/GetBlockListRequestConditions.cs | 17 + .../BlobRequestConditionsInternals.cs | 62 ++ 5 files changed, 643 insertions(+), 4 deletions(-) create mode 100644 sdk/storage/Azure.Storage.Blobs/src/Models/GetBlockListRequestConditions.cs create mode 100644 sdk/storage/Azure.Storage.Blobs/src/Models/Internal/BlobRequestConditionsInternals.cs diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index 2c129f9f53fed..b83bb1624ecd5 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -1120,6 +1120,12 @@ public partial class GetBlobTagResult public GetBlobTagResult() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } } + public partial class GetBlockListRequestConditions + { + public GetBlockListRequestConditions() { } + public string LeaseId { get { throw null; } set { } } + public string TagConditions { get { throw null; } set { } } + } public enum LeaseDurationType { Infinite = 0, @@ -1450,8 +1456,24 @@ public BlockBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredent public virtual System.Threading.Tasks.Task> CommitBlockListAsync(System.Collections.Generic.IEnumerable base64BlockIds, Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary metadata = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, Azure.Storage.Blobs.Models.AccessTier? accessTier = default(Azure.Storage.Blobs.Models.AccessTier?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CommitBlockListAsync(System.Collections.Generic.IEnumerable base64BlockIds, Azure.Storage.Blobs.Models.CommitBlockListOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } protected static Azure.Storage.Blobs.Specialized.BlockBlobClient CreateClient(System.Uri blobUri, Azure.Storage.Blobs.BlobClientOptions options, Azure.Core.Pipeline.HttpPipeline pipeline) { throw null; } + public virtual Azure.Response GetBlockList() { throw null; } + public virtual Azure.Response GetBlockList(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes) { throw null; } + public virtual Azure.Response GetBlockList(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes, string snapshot) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response GetBlockList(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes = Azure.Storage.Blobs.Models.BlockListTypes.All, string snapshot = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBlockList(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes = Azure.Storage.Blobs.Models.BlockListTypes.All, string snapshot = null, Azure.Storage.Blobs.Models.GetBlockListRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBlockList(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes = Azure.Storage.Blobs.Models.BlockListTypes.All, string snapshot = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBlockList(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.Response GetBlockList(System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> GetBlockListAsync() { throw null; } + public virtual System.Threading.Tasks.Task> GetBlockListAsync(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes) { throw null; } + public virtual System.Threading.Tasks.Task> GetBlockListAsync(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes, string snapshot) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> GetBlockListAsync(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes = Azure.Storage.Blobs.Models.BlockListTypes.All, string snapshot = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBlockListAsync(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes = Azure.Storage.Blobs.Models.BlockListTypes.All, string snapshot = null, Azure.Storage.Blobs.Models.GetBlockListRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBlockListAsync(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes = Azure.Storage.Blobs.Models.BlockListTypes.All, string snapshot = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBlockListAsync(Azure.Storage.Blobs.Models.BlockListTypes blockListTypes, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual System.Threading.Tasks.Task> GetBlockListAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.IO.Stream OpenWrite(bool overwrite, Azure.Storage.Blobs.Models.BlockBlobOpenWriteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task OpenWriteAsync(bool overwrite, Azure.Storage.Blobs.Models.BlockBlobOpenWriteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Query(string querySqlExpression, Azure.Storage.Blobs.Models.BlobQueryOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs index 02442e59e833a..b85346ed3c49e 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs @@ -1924,7 +1924,543 @@ internal virtual async Task> CommitBlockListInternal( #region GetBlockList /// - /// The operation operation retrieves + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response GetBlockList() => + GetBlockListInternal( + BlockListTypes.All, + default, + default, + false, // async + default) + .EnsureCompleted(); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> GetBlockListAsync() => + await GetBlockListInternal( + BlockListTypes.All, + default, + default, + true, // async + default) + .ConfigureAwait(false); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response GetBlockList( + CancellationToken cancellationToken) => + GetBlockListInternal( + BlockListTypes.All, + default, + default, + false, // async + cancellationToken) + .EnsureCompleted(); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> GetBlockListAsync( + CancellationToken cancellationToken) => + await GetBlockListInternal( + BlockListTypes.All, + default, + default, + true, // async + cancellationToken) + .ConfigureAwait(false); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response GetBlockList( + BlockListTypes blockListTypes) => + GetBlockListInternal( + blockListTypes, + default, + default, + false, // async + default) + .EnsureCompleted(); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> GetBlockListAsync( + BlockListTypes blockListTypes) => + await GetBlockListInternal( + blockListTypes, + default, + default, + true, // async + default) + .ConfigureAwait(false); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response GetBlockList( + BlockListTypes blockListTypes, CancellationToken cancellationToken) => + GetBlockListInternal( + blockListTypes, + default, + default, + false, // async + cancellationToken) + .EnsureCompleted(); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> GetBlockListAsync( + BlockListTypes blockListTypes, CancellationToken cancellationToken) => + await GetBlockListInternal( + blockListTypes, + default, + default, + true, // async + cancellationToken) + .ConfigureAwait(false); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// Optionally specifies the blob snapshot to retrieve the block list + /// from. For more information on working with blob snapshots, see + /// + /// Create a snapshot of a blob. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response GetBlockList( + BlockListTypes blockListTypes = BlockListTypes.All, + string snapshot = default, + CancellationToken cancellationToken = default) => + GetBlockListInternal( + blockListTypes, + snapshot, + default, + false, // async + cancellationToken) + .EnsureCompleted(); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// Optionally specifies the blob snapshot to retrieve the block list + /// from. For more information on working with blob snapshots, see + /// + /// Create a snapshot of a blob. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> GetBlockListAsync( + BlockListTypes blockListTypes, + string snapshot) => + await GetBlockListInternal( + blockListTypes, + snapshot, + default, + true, // async + default) + .ConfigureAwait(false); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// Optionally specifies the blob snapshot to retrieve the block list + /// from. For more information on working with blob snapshots, see + /// + /// Create a snapshot of a blob. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response GetBlockList( + BlockListTypes blockListTypes, + string snapshot) => + GetBlockListInternal( + blockListTypes, + snapshot, + default, + false, // async + default) + .EnsureCompleted(); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// Optionally specifies the blob snapshot to retrieve the block list + /// from. For more information on working with blob snapshots, see + /// + /// Create a snapshot of a blob. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> GetBlockListAsync( + BlockListTypes blockListTypes = BlockListTypes.All, + string snapshot = default, + CancellationToken cancellationToken = default) => + await GetBlockListInternal( + blockListTypes, + snapshot, + default, + true, // async + cancellationToken) + .ConfigureAwait(false); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// Optionally specifies the blob snapshot to retrieve the block list + /// from. For more information on working with blob snapshots, see + /// + /// Create a snapshot of a blob. + /// + /// + /// Optional to add + /// conditions on retrieving the block list. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response GetBlockList( + BlockListTypes blockListTypes = BlockListTypes.All, + string snapshot = default, + GetBlockListRequestConditions conditions = default, + CancellationToken cancellationToken = default) => + GetBlockListInternal( + blockListTypes, + snapshot, + new BlobRequestConditions() { LeaseId = conditions?.LeaseId, TagConditions = conditions?.TagConditions }, + false, // async + cancellationToken) + .EnsureCompleted(); + + /// + /// The operation operation retrieves + /// the list of blocks that have been uploaded as part of a block blob. + /// There are two block lists maintained for a blob. The Committed + /// Block list has blocks that have been successfully committed to a + /// given blob with . + /// The Uncommitted Block list has blocks that have been uploaded for a + /// blob using , but that have not yet + /// been committed. These blocks are stored in Azure in association + /// with a blob, but do not yet form part of the blob. + /// + /// + /// Specifies whether to return the list of committed blocks, the + /// list of uncommitted blocks, or both lists together. If you omit + /// this parameter, Get Block List returns the list of committed blocks. + /// + /// + /// Optionally specifies the blob snapshot to retrieve the block list + /// from. For more information on working with blob snapshots, see + /// + /// Create a snapshot of a blob. + /// + /// + /// Optional to add + /// conditions on retrieving the block list. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing requested + /// block list. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task> GetBlockListAsync( + BlockListTypes blockListTypes = BlockListTypes.All, + string snapshot = default, + GetBlockListRequestConditions conditions = default, + CancellationToken cancellationToken = default) => + await GetBlockListInternal( + blockListTypes, + snapshot, + new BlobRequestConditions() { LeaseId = conditions?.LeaseId, TagConditions = conditions?.TagConditions }, + true, // async + cancellationToken) + .ConfigureAwait(false); + + /// + /// The operation operation retrieves /// the list of blocks that have been uploaded as part of a block blob. /// There are two block lists maintained for a blob. The Committed /// Block list has blocks that have been successfully committed to a @@ -1961,6 +2497,7 @@ internal virtual async Task> CommitBlockListInternal( /// A will be thrown if /// a failure occurs. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response GetBlockList( BlockListTypes blockListTypes = BlockListTypes.All, string snapshot = default, @@ -1975,7 +2512,7 @@ public virtual Response GetBlockList( .EnsureCompleted(); /// - /// The operation operation retrieves + /// The operation operation retrieves /// the list of blocks that have been uploaded as part of a block blob. /// There are two block lists maintained for a blob. The Committed /// Block list has blocks that have been successfully committed to a @@ -2012,6 +2549,7 @@ public virtual Response GetBlockList( /// A will be thrown if /// a failure occurs. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> GetBlockListAsync( BlockListTypes blockListTypes = BlockListTypes.All, string snapshot = default, diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlockList.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlockList.cs index 45192a33720c2..fc062e33a4e29 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlockList.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlockList.cs @@ -9,7 +9,7 @@ namespace Azure.Storage.Blobs.Models { /// /// A block blob's returned from - /// . + /// . /// public partial class BlockList { @@ -30,7 +30,7 @@ public partial class BlockList /// /// The media type of the body of the response. For the - /// + /// /// operation this is 'application/xml'. /// public string ContentType { get; internal set; } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/GetBlockListRequestConditions.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/GetBlockListRequestConditions.cs new file mode 100644 index 0000000000000..379a634dd0020 --- /dev/null +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/GetBlockListRequestConditions.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Storage.Blobs.Models +{ + /// + /// TODO. + /// + public class GetBlockListRequestConditions : IRequestConditions.ILeaseId, IRequestConditions.ITags + { + /// + public string LeaseId { get; set; } + + /// + public string TagConditions { get; set; } + } +} diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/Internal/BlobRequestConditionsInternals.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/Internal/BlobRequestConditionsInternals.cs new file mode 100644 index 0000000000000..5b08119c9c243 --- /dev/null +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/Internal/BlobRequestConditionsInternals.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Storage.Blobs.Models +{ +#pragma warning disable SA1649 // File name should match first type name + internal interface IRequestConditions + { + internal interface ILeaseId + { + /// + /// Optionally limit requests to resources with an active lease + /// matching this Id. + /// + public string LeaseId { get; set; } + } + + internal interface ITags + { + /// + /// Optional SQL statement to apply to the Tags of the Blob. + /// + public string TagConditions { get; set; } + } + + internal interface IIfModifiedSince + { + /// + /// Optionally limit requests to resources that have only been + /// modified since this point in time. + /// + public DateTimeOffset? IfModifiedSince { get; set; } + } + + internal interface IIfUnmodifiedSince + { + /// + /// Optionally limit requests to resources that have remained + /// unmodified. + /// + public DateTimeOffset? IfUnmodifiedSince { get; set; } + } + + internal interface IIfMatch + { + /// + /// Optionally limit requests to resources that have a matching ETag. + /// + public ETag? IfMatch { get; set; } + } + + internal interface IIfNoneMatch + { + /// + /// Optionally limit requests to resources that do not match the ETag. + /// + public ETag? IfNoneMatch { get; set; } + } + } +}