Skip to content

Commit

Permalink
STG 93 API View Comments (#43999)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcc-msft authored May 13, 2024
1 parent 209d5cf commit b716566
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion ve
public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
public string EncryptionScope { get { throw null; } set { } }
public Azure.Storage.ExpectContinueOptions ExpectContinueBehavior { get { throw null; } set { } }
public System.Uri GeoRedundantSecondaryUri { get { throw null; } set { } }
public Azure.Storage.Request100ContinueOptions Request100ContinueOptions { get { throw null; } set { } }
public Azure.Storage.TransferValidationOptions TransferValidation { get { throw null; } }
public bool TrimBlobNameSlashes { get { throw null; } set { } }
public Azure.Storage.Blobs.BlobClientOptions.ServiceVersion Version { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion ve
public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
public string EncryptionScope { get { throw null; } set { } }
public Azure.Storage.ExpectContinueOptions ExpectContinueBehavior { get { throw null; } set { } }
public System.Uri GeoRedundantSecondaryUri { get { throw null; } set { } }
public Azure.Storage.Request100ContinueOptions Request100ContinueOptions { get { throw null; } set { } }
public Azure.Storage.TransferValidationOptions TransferValidation { get { throw null; } }
public bool TrimBlobNameSlashes { get { throw null; } set { } }
public Azure.Storage.Blobs.BlobClientOptions.ServiceVersion Version { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion ve
public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } }
public bool EnableTenantDiscovery { get { throw null; } set { } }
public string EncryptionScope { get { throw null; } set { } }
public Azure.Storage.ExpectContinueOptions ExpectContinueBehavior { get { throw null; } set { } }
public System.Uri GeoRedundantSecondaryUri { get { throw null; } set { } }
public Azure.Storage.Request100ContinueOptions Request100ContinueOptions { get { throw null; } set { } }
public Azure.Storage.TransferValidationOptions TransferValidation { get { throw null; } }
public bool TrimBlobNameSlashes { get { throw null; } set { } }
public Azure.Storage.Blobs.BlobClientOptions.ServiceVersion Version { get { throw null; } }
Expand Down
6 changes: 3 additions & 3 deletions sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public enum ServiceVersion
/// <summary>
/// Behavior options for setting HTTP header <c>Expect: 100-continue</c> on requests.
/// </summary>
public ExpectContinueOptions ExpectContinueBehavior { get; set; }
public Request100ContinueOptions Request100ContinueOptions { get; set; }

#region Advanced Options
internal ClientSideEncryptionOptions _clientSideEncryptionOptions;
Expand Down Expand Up @@ -344,7 +344,7 @@ private void AddHeadersAndQueryParameters()
/// <returns>An HttpPipeline to use for Storage requests.</returns>
internal HttpPipeline Build(HttpPipelinePolicy authentication = null)
{
return this.Build(authentication, GeoRedundantSecondaryUri, ExpectContinueBehavior);
return this.Build(authentication, GeoRedundantSecondaryUri, Request100ContinueOptions);
}

/// <summary>
Expand All @@ -354,7 +354,7 @@ internal HttpPipeline Build(HttpPipelinePolicy authentication = null)
/// <returns>An HttpPipeline to use for Storage requests.</returns>
internal HttpPipeline Build(object credentials)
{
return this.Build(credentials, GeoRedundantSecondaryUri, ExpectContinueBehavior);
return this.Build(credentials, GeoRedundantSecondaryUri, Request100ContinueOptions);
}

/// <inheritdoc />
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.Blobs/tests/BlobClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ public async Task UploadAsync_ExpectContinue()
});

BlobClientOptions options = GetOptions();
options.ExpectContinueBehavior = new() { Mode = ExpectContinueMode.On };
options.Request100ContinueOptions = new() { Mode = Request100ContinueMode.Always };
options.AddPolicy(assertPolicy, Core.HttpPipelinePosition.BeforeTransport);
await using DisposingContainer test = await GetTestContainerAsync(
BlobsClientBuilder.GetServiceClient_SharedKey(options));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ public DownloadTransferValidationOptions() { }
public bool AutoValidateChecksum { get { throw null; } set { } }
public Azure.Storage.StorageChecksumAlgorithm ChecksumAlgorithm { get { throw null; } set { } }
}
public enum ExpectContinueMode
public enum Request100ContinueMode
{
ApplyOnThrottle = 0,
On = 1,
Off = 2,
Auto = 0,
Always = 1,
Never = 2,
}
public partial class ExpectContinueOptions
public partial class Request100ContinueOptions
{
public ExpectContinueOptions() { }
public Request100ContinueOptions() { }
public System.TimeSpan AutoInterval { get { throw null; } set { } }
public long? ContentLengthThreshold { get { throw null; } set { } }
public Azure.Storage.ExpectContinueMode Mode { get { throw null; } set { } }
public System.TimeSpan ThrottleInterval { get { throw null; } set { } }
public Azure.Storage.Request100ContinueMode Mode { get { throw null; } set { } }
}
public enum StorageChecksumAlgorithm
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ public DownloadTransferValidationOptions() { }
public bool AutoValidateChecksum { get { throw null; } set { } }
public Azure.Storage.StorageChecksumAlgorithm ChecksumAlgorithm { get { throw null; } set { } }
}
public enum ExpectContinueMode
public enum Request100ContinueMode
{
ApplyOnThrottle = 0,
On = 1,
Off = 2,
Auto = 0,
Always = 1,
Never = 2,
}
public partial class ExpectContinueOptions
public partial class Request100ContinueOptions
{
public ExpectContinueOptions() { }
public Request100ContinueOptions() { }
public System.TimeSpan AutoInterval { get { throw null; } set { } }
public long? ContentLengthThreshold { get { throw null; } set { } }
public Azure.Storage.ExpectContinueMode Mode { get { throw null; } set { } }
public System.TimeSpan ThrottleInterval { get { throw null; } set { } }
public Azure.Storage.Request100ContinueMode Mode { get { throw null; } set { } }
}
public enum StorageChecksumAlgorithm
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Azure.Storage
/// <summary>
/// Mode for applying expect-continue to a PUT request.
/// </summary>
public enum ExpectContinueMode
public enum Request100ContinueMode
{
/// <summary>
/// If no options are provided, this is the default behavior.
Expand All @@ -19,17 +19,17 @@ public enum ExpectContinueMode
/// Response codes that trigger this behavior are 429, 500, and 503.
/// </para>
/// </summary>
ApplyOnThrottle = 0,
Auto = 0,

/// <summary>
/// Expect-continue will be applied regardless of recent error status. There may be
/// some additionally defined thresholds for applying the header.
/// </summary>
On = 1,
Always = 1,

/// <summary>
/// Expect-Continue will never be applied.
/// </summary>
Off = 2,
Never = 2,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ namespace Azure.Storage
/// <summary>
/// Options for applying HTTP header <c>Expect: 100-continue</c> to PUT operations.
/// </summary>
public class ExpectContinueOptions
public class Request100ContinueOptions
{
/// <summary>
/// Mode for these options.
/// </summary>
public ExpectContinueMode Mode { get; set; }
public Request100ContinueMode Mode { get; set; }

/// <summary>
/// The minimum value of HTTP request Content-Length for applying expect-continue.
/// </summary>
public long? ContentLengthThreshold { get; set; }

/// <summary>
/// In mode <see cref="ExpectContinueMode.ApplyOnThrottle"/>, the time interval to apply the header
/// In mode <see cref="Request100ContinueMode.Auto"/>, the time interval to apply the header
/// after recieving a triggering error. The default time is one minute.
/// </summary>
public TimeSpan ThrottleInterval { get; set; } = TimeSpan.FromMinutes(1);
public TimeSpan AutoInterval { get; set; } = TimeSpan.FromMinutes(1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static HttpPipeline Build(
this ClientOptions options,
HttpPipelinePolicy authentication = null,
Uri geoRedundantSecondaryStorageUri = null,
ExpectContinueOptions expectContinue = null)
Request100ContinueOptions expectContinue = null)
{
StorageResponseClassifier classifier = new();
var pipelineOptions = new HttpPipelineOptions(options)
Expand All @@ -131,20 +131,20 @@ public static HttpPipeline Build(
{
switch (expectContinue.Mode)
{
case ExpectContinueMode.ApplyOnThrottle:
case Request100ContinueMode.Auto:
pipelineOptions.PerCallPolicies.Add(new ExpectContinueOnThrottlePolicy()
{
ThrottleInterval = expectContinue.ThrottleInterval,
ThrottleInterval = expectContinue.AutoInterval,
ContentLengthThreshold = expectContinue.ContentLengthThreshold ?? 0,
});
break;
case ExpectContinueMode.On:
case Request100ContinueMode.Always:
pipelineOptions.PerCallPolicies.Add(new ExpectContinuePolicy()
{
ContentLengthThreshold = expectContinue.ContentLengthThreshold ?? 0,
});
break;
case ExpectContinueMode.Off:
case Request100ContinueMode.Never:
break;
}
}
Expand Down Expand Up @@ -172,7 +172,7 @@ public static HttpPipeline Build(
this ClientOptions options,
object credentials,
Uri geoRedundantSecondaryStorageUri = null,
ExpectContinueOptions expectContinue = null) =>
Request100ContinueOptions expectContinue = null) =>
Build(options, GetAuthenticationPolicy(credentials), geoRedundantSecondaryStorageUri, expectContinue);
}
}

0 comments on commit b716566

Please sign in to comment.